pub trait Writer {
// Required methods
fn write(&mut self, buf: &[u8]) -> Result<()>;
fn push_handle(&mut self, handle: Handle) -> Result<HandleSlot>;
fn bytes_written(&self) -> usize;
}
Expand description
A Writer
represents a consumer of the bytes produced by serializing a message. In cases where you can
create a slice to put the bytes in, CursorWriter
can be used. Custom Writer
s are useful for more niche
uses, such as sending the serialized bytes over a serial port.