Trait MessageWriter

Source
pub trait MessageWriter {
    // Required methods
    fn write(&mut self, data: &[u8]) -> Result<()>;
    fn remaining(&self) -> usize;
    fn finalize(self) -> Result<()>;
}
Expand description

A trait used by tokenize_to_writer! to output tokenized messages.

For more details on how this type is used, see the tokenize_to_writer! documentation.

Required Methods§

Source

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

Append data to the message.

Source

fn remaining(&self) -> usize

Return the remaining space in this message instance.

If there are no space constraints, return usize::MAX.

Source

fn finalize(self) -> Result<()>

Finalize message.

finalize() is called when the tokenized message is complete.

Implementors§