authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-22 03:25:29 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-22 03:25:29 -07:00
log7447f19dc77c5d745151949d27fdae25f7ad3954
tree55cb546e95663efd819bd8b519014c66cd11ce4e
parentfd1af7564b8d478ae3ebfd64fdd20802ce9e110e
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

eliminate usingnamespace


1 files changed, 25 insertions(+), 2 deletions(-)

net.zig+25-2
...@@ -192,11 +192,25 @@ pub const Stream = struct {...@@ -192,11 +192,25 @@ pub const Stream = struct {
192 }192 }
193 }193 }
194194
195 const R = nio.Readable(@This(), ._bare);
196 pub const readAll = R.readAll;
197 pub const readAtLeast = R.readAtLeast;
198 pub const readNoEof = R.readNoEof;
199 pub const readAllAlloc = R.readAllAlloc;
200 pub const readArray = R.readArray;
201 pub const readByte = R.readByte;
202 pub const readUntilDelimiterArrayList = R.readUntilDelimiterArrayList;
203 pub const readUntilDelimiterAlloc = R.readUntilDelimiterAlloc;
204 pub const readUntilDelimitersBuf = R.readUntilDelimitersBuf;
205 pub const readUntilDelimitersArrayList = R.readUntilDelimitersArrayList;
206 pub const readAlloc = R.readAlloc;
207 pub const readInt = R.readInt;
208 pub const readUntilDelimitersAlloc = R.readUntilDelimitersAlloc;
209
195 pub const ReadError = switch (builtin.target.os.tag) {210 pub const ReadError = switch (builtin.target.os.tag) {
196 .linux => sys.errno.Error,211 .linux => sys.errno.Error,
197 else => @compileError("TODO"),212 else => @compileError("TODO"),
198 };213 };
199 pub usingnamespace nio.Readable(@This(), ._bare);
200 pub fn read(s: Stream, buffer: []u8) ReadError!usize {214 pub fn read(s: Stream, buffer: []u8) ReadError!usize {
201 return sys.recv(@intFromEnum(s.socket), buffer, 0);215 return sys.recv(@intFromEnum(s.socket), buffer, 0);
202 }216 }
...@@ -213,11 +227,20 @@ pub const Stream = struct {...@@ -213,11 +227,20 @@ pub const Stream = struct {
213 };227 };
214 }228 }
215229
230 const W = nio.Writable(@This(), ._bare);
231 pub const writeAll = W.writeAll;
232 pub const writevAll = W.writevAll;
233 pub const writeByteNTimes = W.writeByteNTimes;
234 pub const writeNTimes = W.writeNTimes;
235 pub const writeInt = W.writeInt;
236 pub const writeStruct = W.writeStruct;
237 pub const writeIntPretty = W.writeIntPretty;
238 pub const print = W.print;
239
216 pub const WriteError = switch (builtin.target.os.tag) {240 pub const WriteError = switch (builtin.target.os.tag) {
217 .linux => sys.errno.Error,241 .linux => sys.errno.Error,
218 else => @compileError("TODO"),242 else => @compileError("TODO"),
219 };243 };
220 pub usingnamespace nio.Writable(@This(), ._bare);
221 pub fn write(s: Stream, bytes: []const u8) WriteError!usize {244 pub fn write(s: Stream, bytes: []const u8) WriteError!usize {
222 return sys.send(@intFromEnum(s.socket), bytes, 0);245 return sys.send(@intFromEnum(s.socket), bytes, 0);
223 }246 }