Fragment

Trait Fragment 

Source
pub trait Fragment<'a>: Sized {
    // Required methods
    fn encode_fragment(&self) -> Result<Vec<u8>, Box<dyn Error>>;
    fn decode_fragment(bytes: &'a [u8]) -> Result<Self, Box<dyn Error>>;
}

Required Methods§

Source

fn encode_fragment(&self) -> Result<Vec<u8>, Box<dyn Error>>

Source

fn decode_fragment(bytes: &'a [u8]) -> Result<Self, Box<dyn Error>>

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§

Source§

impl<'a, T> Fragment<'a> for T
where T: Encode<()> + Decode<'a, ()>,