[][src]Trait ptah::Writer

pub trait Writer {
    fn write(&mut self, buf: &[u8]) -> Result<()>;
fn push_handle(&mut self, handle: Handle) -> Result<HandleSlot>; }

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 Writers are useful for more niche uses, such as sending the serialized bytes over a serial port.

Required methods

fn write(&mut self, buf: &[u8]) -> Result<()>

fn push_handle(&mut self, handle: Handle) -> Result<HandleSlot>

Loading content...

Implementations on Foreign Types

impl<'a> Writer for &'a mut Vec<u8>[src]

Loading content...

Implementors

impl<'a> Writer for CursorWriter<'a>[src]

Loading content...