Framer

Trait Framer 

Source
pub trait Framer:
    Sized
    + Send
    + Sync {
    // Required methods
    fn message_type(&self) -> u8;
    fn byte_size(&self) -> u32;
    fn encode<W>(&self, writer: &mut W) -> Result<(), Error>
       where W: Write;
    fn decode<R>(reader: &mut R, ty: u8) -> Result<Self, Error>
       where R: Read;
}

Required Methods§

Source

fn message_type(&self) -> u8

Source

fn byte_size(&self) -> u32

Returns the number of bytes necessary to fully encode self.

Source

fn encode<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write,

Encodes self into writer.

Source

fn decode<R>(reader: &mut R, ty: u8) -> Result<Self, Error>
where R: Read,

Decodes Self from reader.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§