diff --git a/src/ona/io.zig b/src/ona/io.zig index 7714365..c939f49 100644 --- a/src/ona/io.zig +++ b/src/ona/io.zig @@ -98,6 +98,12 @@ pub const FileAccess = struct { } }; +/// +/// Closure that captures a reference to readable resources like block devices, memory buffers, +/// network sockets, and more. +/// +pub const Reader = meta.Function(@sizeOf(usize), []u8, usize); + /// /// Returns a state machine for lazily computing all `Element` components of a given source input /// that match a delimiting pattern. @@ -238,9 +244,9 @@ test "Null writing" { } /// -/// Writes the singular `byte` to `writer`, returning `true` if it was successfully written, +/// Applies the singular `byte` to `writer`, returning `true` if it was successfully written, /// otherwise `false`. /// -pub fn writeByte(writer: Writer, byte: u8) bool { +pub fn writeByte(writer: *Writer, byte: u8) bool { return (writer.apply(std.mem.asBytes(&byte)) != 0); }