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.

sendFile

Unlike writeSplat and writeVec, this function will call into VTable even if there is enough buffer capacity for the file contents.

The caller is responsible for flushing. Although the buffer may be bypassed as an optimization, this is not a guarantee.

Although it would be possible to eliminate error.Unimplemented from the error set by reading directly into the buffer in such case, this is not done because it is more efficient to do it higher up the call stack so that the error does not occur with each write.

See sendFileReading for an alternative that does not have error.Unimplemented in the error set.

Writer.sendFile
pub fn sendFile(w: *Writer, file_reader: *File.Reader, limit: Limit) FileError!usize

File

lib/std/Io/Writer.zig:945

Code

pub fn sendFile(w: *Writer, file_reader: *File.Reader, limit: Limit) FileError!usize {
    return w.vtable.sendFile(w, file_reader, limit);
}