Skip to main content

TypedCodec

Trait TypedCodec 

Source
pub trait TypedCodec<T> {
    // Required methods
    fn id(&self) -> CodecId;
    fn encode(&self, value: &T) -> Result<Vec<u8>>;
    fn decode(&self, bytes: &[u8]) -> Result<T>;
}

Required Methods§

Source

fn id(&self) -> CodecId

Source

fn encode(&self, value: &T) -> Result<Vec<u8>>

Source

fn decode(&self, bytes: &[u8]) -> Result<T>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§