mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-16 08:18:59 +00:00
move Blob out of files/ + provide subclasses of Blob in _type
This commit is contained in:
@@ -26,6 +26,7 @@ const Page = @import("../../Page.zig");
|
|||||||
/// https://developer.mozilla.org/en-US/docs/Web/API/Blob
|
/// https://developer.mozilla.org/en-US/docs/Web/API/Blob
|
||||||
const Blob = @This();
|
const Blob = @This();
|
||||||
|
|
||||||
|
_type: Type,
|
||||||
/// Immutable slice of blob.
|
/// Immutable slice of blob.
|
||||||
/// Note that another blob may hold a pointer/slice to this,
|
/// Note that another blob may hold a pointer/slice to this,
|
||||||
/// so its better to leave the deallocation of it to arena allocator.
|
/// so its better to leave the deallocation of it to arena allocator.
|
||||||
@@ -33,6 +34,11 @@ slice: []const u8,
|
|||||||
/// MIME attached to blob. Can be an empty string.
|
/// MIME attached to blob. Can be an empty string.
|
||||||
mime: []const u8,
|
mime: []const u8,
|
||||||
|
|
||||||
|
const Type = union(enum) {
|
||||||
|
generic,
|
||||||
|
file: *@import("File.zig"),
|
||||||
|
};
|
||||||
|
|
||||||
const InitOptions = struct {
|
const InitOptions = struct {
|
||||||
/// MIME type.
|
/// MIME type.
|
||||||
type: []const u8 = "",
|
type: []const u8 = "",
|
||||||
Reference in New Issue
Block a user