pub fn writeByte(w: *Writer, byte: u8) Error!void
Calls drain as many times as necessary such that byte is transferred.
drain
byte
w: *Writer
byte: u8
WriteFailed
See the Writer implementation for detailed diagnostics.
Writer
828 829 830 831 832 833 834 835 836 837
pub fn writeByte(w: *Writer, byte: u8) Error!void { while (w.buffer.len - w.end == 0) { const n = try w.vtable.drain(w, &.{&.{byte}}, 1); if (n > 0) return; } else { @branchHint(.likely); w.buffer[w.end] = byte; w.end += 1; } }
Calls
drainas many times as necessary such thatbyteis transferred.