Trait ptah::Writer

source ·
pub trait Writer {
    // Required methods
    fn write(&mut self, buf: &[u8]) -> Result<()>;
    fn push_handle(&mut self, handle: Handle) -> Result<HandleSlot>;
}
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 Writers are useful for more niche uses, such as sending the serialized bytes over a serial port.

Required Methods§

source

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

source

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

Implementations on Foreign Types§

source§

impl<'a> Writer for &'a mut Vec<u8>

source§

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

source§

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

Implementors§

source§

impl<'a> Writer for CursorWriter<'a>