Zig 0.17.0-dev (Split by item) This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig standard library.
std › Io › Uring › fileReadStreaming Private Function fileReadStreaming Doc Source Private Function std.Io.Uring.fileReadStreaming
fn fileReadStreaming (
ev : *Evented ,
cancel_region : *CancelRegion ,
file : File ,
data : []const []u8 ,
) File .ReadStreamingError !usize Params File Io/Uring.zig: 2124
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144 fn fileReadStreaming (
ev : *Evented ,
cancel_region : *CancelRegion ,
file : File ,
data : []const []u8 ,
) File .ReadStreamingError !usize {
var iovecs_buffer : [max_iovecs_len ]iovec = undefined ;
var i : usize = 0 ;
for (data ) |buf | {
if (iovecs_buffer .len - i == 0 ) break ;
if (buf .len > 0 ) {
iovecs_buffer [i ] = .{ .base = buf .ptr , .len = buf .len };
i += 1 ;
}
}
const dest = iovecs_buffer [0 ..i ];
assert (dest [0 ].len > 0 );
const n = try ev .preadv (cancel_region , file .handle , dest , null );
return if (n == 0 ) error .EndOfStream else n ;
}