pub fn stream(r: *Reader, w: *Writer, limit: Limit) StreamError!usize ReadFailedSee the Reader implementation for detailed diagnostics.
WriteFailedSee the Writer implementation for detailed diagnostics.
EndOfStreamEnd of stream indicated from the Reader. This error cannot originate from the Writer.
168
169
170
171
172
173
174
175
176
177
178
179pub fn stream(r: *Reader, w: *Writer, limit: Limit) StreamError!usize {
const buffer = limit.slice(r.buffer[r.seek..r.end]);
if (buffer.len > 0) {
@branchHint(.likely);
const n = try w.write(buffer);
r.seek += n;
return n;
}
const n = try r.vtable.stream(r, w, limit);
assert(n <= @backingInt(limit));
return n;
}