Trait Codec

Source
pub trait Codec {
    // Required methods
    fn get_code(&self) -> i64;
    fn to_bytes<T: Serialize>(&self, t: &T) -> Result<Vec<u8>, PureError>;
    fn from_bytes<T: DeserializeOwned>(bytes: &[u8]) -> Result<T, PureError>;
}

Required Methods§

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§