pub fn takeSentinel(r: *Reader, comptime sentinel: u8) DelimiterError![:sentinel]u8 r: *Readersentinel: u8ReadFailedSee the Reader implementation for detailed diagnostics.
EndOfStreamFor "inclusive" functions, stream ended before the delimiter was found. For "exclusive" functions, stream ended and there are no more bytes to return.
StreamTooLongThe delimiter was not found within a number of bytes matching the capacity of the Reader.
773
774
775
776
777pub fn takeSentinel(r: *Reader, comptime sentinel: u8) DelimiterError![:sentinel]u8 {
const result = try r.peekSentinel(sentinel);
r.toss(result.len + 1);
return result;
}
Returns a slice of the next bytes of buffered data from the stream until
sentinelis found, advancing the seek position past the sentinel.Returned slice has a sentinel.
Invalidates previously returned values from
peek.See also:
peekSentineltakeDelimiterExclusivetakeDelimiterInclusive