Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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. Public Function

discardDelimiterInclusive

Public Function
std.Io.Reader.discardDelimiterInclusive
pub fn discardDelimiterInclusive(r: *Reader, delimiter: u8) Error!usize

Reads from the stream until specified byte is found, discarding all data, including the delimiter.

Returns number of bytes discarded, or error.EndOfStream if the delimiter is not found.

See also:

Params

Errors

ReadFailed

See the Reader implementation for detailed diagnostics.

EndOfStream

File

Io/Reader.zig:1041
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
pub fn discardDelimiterInclusive(r: *Reader, delimiter: u8) Error!usize {
    const n = discardDelimiterLimit(r, delimiter, .unlimited) catch |err| switch (err) {
        error.StreamTooLong => unreachable, // unlimited is passed
        else => |e| return e,
    };
    if (r.seek == r.end) return error.EndOfStream;
    assert(r.buffer[r.seek] == delimiter);
    toss(r, 1);
    return n + 1;
}