Function write [src]

Prototype

pub fn write(w: *Writer, bytes: []const u8) Error!usize

Parameters

w: *Writerbytes: []const u8

Possible Errors

WriteFailed

See the Writer implementation for detailed diagnostics.

Source

pub fn write(w: *Writer, bytes: []const u8) Error!usize { if (w.end + bytes.len <= w.buffer.len) { @branchHint(.likely); @memcpy(w.buffer[w.end..][0..bytes.len], bytes); w.end += bytes.len; return bytes.len; } return w.vtable.drain(w, &.{bytes}, 1); }