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 library itself.

takeDelimiterExclusive

Returns a slice of the next bytes of buffered data from the stream until delimiter is found, advancing the seek position up to (but not past) the delimiter.

Returned slice excludes the delimiter. End-of-stream is treated equivalent to a delimiter, unless it would result in a length 0 return value, in which case error.EndOfStream is returned instead.

If the delimiter is not found within a number of bytes matching the capacity of this Reader, error.StreamTooLong is returned. In such case, the stream state is unmodified as if this function was never called.

Invalidates previously returned values from peek.

See also:

Reader.takeDelimiterExclusive
pub fn takeDelimiterExclusive(r: *Reader, delimiter: u8) DelimiterError![]u8

File

lib/std/Io/Reader.zig:876

Code

pub fn takeDelimiterExclusive(r: *Reader, delimiter: u8) DelimiterError![]u8 {
    const result = try r.peekDelimiterExclusive(delimiter);
    r.toss(result.len);
    return result;
}