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

streamDelimiterEnding

Public Function
std.Io.Reader.streamDelimiterEnding
pub fn streamDelimiterEnding(
    r: *Reader,
    w: *Writer,
    delimiter: u8,
) StreamRemainingError!usize

Appends to w contents by reading from the stream until delimiter is found. Does not write the delimiter itself.

Returns number of bytes streamed, which may be zero. If the stream reaches the end, the reader buffer will be empty when this function returns. Otherwise, it will have at least one byte buffered, starting with the delimiter.

Asserts buffer capacity of at least one. This function performs better with larger buffers.

See also:

Params

Errors

ReadFailed

See the Reader implementation for detailed diagnostics.

WriteFailed

See the Writer implementation for detailed diagnostics.

File

Io/Reader.zig:979
979
980
981
982
983
984
985
986
987
988
pub fn streamDelimiterEnding(
    r: *Reader,
    w: *Writer,
    delimiter: u8,
) StreamRemainingError!usize {
    return streamDelimiterLimit(r, w, delimiter, .unlimited) catch |err| switch (err) {
        error.StreamTooLong => unreachable, // unlimited is passed
        else => |e| return e,
    };
}