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

fill

Public Function
std.Io.Reader.fill
pub fn fill(r: *Reader, n: usize) Error!void

Fills the buffer such that it contains at least n bytes, without advancing the seek position.

Returns error.EndOfStream if and only if there are fewer than n bytes remaining.

If the end of stream is not encountered, asserts buffer capacity is at least n.

Params

Errors

ReadFailed

See the Reader implementation for detailed diagnostics.

EndOfStream

File

Io/Reader.zig:1109
1109
1110
1111
1112
1113
1114
1115
pub fn fill(r: *Reader, n: usize) Error!void {
    if (r.seek + n <= r.end) {
        @branchHint(.likely);
        return;
    }
    return fillUnbuffered(r, n);
}