Skip to main content

Codec

Trait Codec 

Source
pub trait Codec {
    type EncodeOptions;
    type DecodeOptions;

    // Required methods
    fn encode(
        data: &[u8],
        options: &Self::EncodeOptions,
    ) -> Result<Vec<u8>, Error>;
    fn decode(
        data: &[u8],
        options: &Self::DecodeOptions,
    ) -> Result<Vec<u8>, Error>;
}

Required Associated Types§

Required Methods§

Source

fn encode(data: &[u8], options: &Self::EncodeOptions) -> Result<Vec<u8>, Error>

Source

fn decode(data: &[u8], options: &Self::DecodeOptions) -> Result<Vec<u8>, Error>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§