authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-06 02:59:08 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-06 02:59:08 -07:00
log22926d4037ab1b331bb7d1b219e0b8ba03e4c05a
tree0d72cb55de16bade4e27a7517a0f186ac8b8b09d
parente6270ad653d1443554cda9c5a020d56a59baa68a
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

add NullWriter


2 files changed, 14 insertions(+), 0 deletions(-)

nio.zig+2
......@@ -301,3 +301,5 @@ pub const BufferedReader = @import("./buffered_reader.zig").BufferedReader;
301301pub const BufferedWriter = @import("./buffered_writer.zig").BufferedWriter;
302302
303303pub const CountingWriter = @import("./counting_writer.zig").CountingWriter;
304
305pub const NullWriter = @import("./null_writer.zig").NullWriter;
null_writer.zig created+12
......@@ -0,0 +1,12 @@
1const std = @import("std");
2const extras = @import("extras");
3const nio = @import("./nio.zig");
4
5pub const NullWriter = struct {
6 pub const WriteError = error{};
7 pub usingnamespace nio.Writable(@This(), ._var);
8 pub fn write(self: NullWriter, bytes: []const u8) WriteError!usize {
9 _ = self;
10 return bytes.len;
11 }
12};