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 › Reader › allocRemainingAlignedSentinel Public Function allocRemainingAlignedSentinel Doc Source Public Function std.Io.Reader.allocRemainingAlignedSentinel
pub fn allocRemainingAlignedSentinel (
r : *Reader ,
gpa : Allocator ,
limit : Limit ,
comptime alignment : std .mem .Alignment ,
comptime sentinel : ?u8 ,
) LimitedAllocError !(if (sentinel ) |s | [:s ]align (alignment .toByteUnits ()) u8 else []align (alignment .toByteUnits ()) u8 ) Params File Io/Reader.zig: 303
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318 pub fn allocRemainingAlignedSentinel (
r : *Reader ,
gpa : Allocator ,
limit : Limit ,
comptime alignment : std .mem .Alignment ,
comptime sentinel : ?u8 ,
) LimitedAllocError !(if (sentinel ) |s | [:s ]align (alignment .toByteUnits ()) u8 else []align (alignment .toByteUnits ()) u8 ) {
var buffer : std .array_list .Aligned (u8 , alignment ) = .empty ;
defer buffer .deinit (gpa );
try appendRemainingAligned (r , gpa , alignment , &buffer , limit );
if (sentinel ) |s | {
return buffer .toOwnedSliceSentinel (gpa , s );
} else {
return buffer .toOwnedSlice (gpa );
}
}