DoxigAlpha

readBytesTo

Function parameters

Parameters

#
fbr:*FixedBufferReader
sentinel:u8

Functions in this namespace

Functions

#

Error sets in this namespace

Error Sets

#

Source

Implementation

#
pub fn readBytesTo(fbr: *FixedBufferReader, comptime sentinel: u8) Error![:sentinel]const u8 {
    const end = @call(.always_inline, std.mem.indexOfScalarPos, .{
        u8,
        fbr.buf,
        fbr.pos,
        sentinel,
    }) orelse return error.EndOfBuffer;
    defer fbr.pos = end + 1;
    return fbr.buf[fbr.pos..end :sentinel];
}