Codec

Trait Codec 

Source
pub trait Codec:
    Send
    + Sync
    + Copy {
    // Required methods
    fn decode_slice<'a, T>(&self, v: &'a [u8]) -> Result<T>
       where T: Deserialize<'a>;
    fn encode_to_vec<T>(&self, value: &T) -> Result<Vec<u8>>
       where T: ?Sized + Serialize;
}

Required Methods§

Source

fn decode_slice<'a, T>(&self, v: &'a [u8]) -> Result<T>
where T: Deserialize<'a>,

Source

fn encode_to_vec<T>(&self, value: &T) -> Result<Vec<u8>>
where T: ?Sized + Serialize,

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§