[][src]Trait rpos_drv::ProtocolEncoder

pub trait ProtocolEncoder {
    fn encode(&mut self, msg: &Message, bytes: &mut [u8]) -> Result<usize>;
fn estimate_encoded_size(&mut self, msg: &Message) -> Result<usize>;
fn write_to(
        &mut self,
        msg: &Message,
        dest: &mut impl Write
    ) -> Result<usize>;
fn reset_encoder(&mut self); }

Protocol encoder

Required methods

fn encode(&mut self, msg: &Message, bytes: &mut [u8]) -> Result<usize>

Encode message into byte array

fn estimate_encoded_size(&mut self, msg: &Message) -> Result<usize>

Estimate encoded message size (must be greater than or equal to the actual encoded size)

fn write_to(&mut self, msg: &Message, dest: &mut impl Write) -> Result<usize>

Write message to std::io::Write targets

fn reset_encoder(&mut self)

Reset encoder

Loading content...


Loading content...