Skip to main content

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: Write>(&self, writer: &mut W) -> Result<()>;
    fn decode<R: Read>(reader: &mut R, ty: u8) -> Result<Self>;
}

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: Write>(&self, writer: &mut W) -> Result<()>

Encodes self into writer.

Source

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

Decodes Self from reader.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§