aboutsummaryrefslogtreecommitdiff
path: root/src/stream/root.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/stream/root.zig')
-rw-r--r--src/stream/root.zig33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/stream/root.zig b/src/stream/root.zig
deleted file mode 100644
index 11580ac..0000000
--- a/src/stream/root.zig
+++ /dev/null
@@ -1,33 +0,0 @@
-const std = @import("std");
-
-pub const Stream = union(enum) {
- const Self = @This();
-
- pub const File = @import("file.zig");
- pub const Buffer = @import("buffer.zig");
-
- file: File,
- buffer: Buffer,
-
- pub fn from_file(file: std.fs.File) Self {
- return .{ .file = File.init(file) };
- }
-
- pub fn from_buffer(buffer: []const u8) Self {
- return .{ .buffer = Buffer.init(buffer) };
- }
-
- pub fn reader(self: *Self, buffer: []u8) *std.Io.Reader {
- return switch(self.*) {
- .file => |*f| f.reader(buffer),
- .buffer => |*b| b.reader(buffer),
- };
- }
-
- pub fn close(self: *Self) void {
- return switch(self.*) {
- .file => |*f| f.close(),
- .buffer => |*b| b.close(),
- };
- }
-};