move Blob out of files/ + provide subclasses of Blob in _type

This commit is contained in:
Halil Durak
2025-11-21 14:22:52 +03:00
parent f4d58c8823
commit 3e44d5bfdf

View File

@@ -26,6 +26,7 @@ const Page = @import("../../Page.zig");
/// https://developer.mozilla.org/en-US/docs/Web/API/Blob
const Blob = @This();
_type: Type,
/// Immutable slice of blob.
/// Note that another blob may hold a pointer/slice to this,
/// 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: []const u8,
const Type = union(enum) {
generic,
file: *@import("File.zig"),
};
const InitOptions = struct {
/// MIME type.
type: []const u8 = "",