Trait apalis_core::Codec

source ·
pub trait Codec<T, Compact> {
    type Error;

    // Required methods
    fn encode(&self, input: &T) -> Result<Compact, Self::Error>;
    fn decode(&self, compact: &Compact) -> Result<T, Self::Error>;
}
Expand description

This allows encoding and decoding of requests in different backends

Required Associated Types§

source

type Error

Error encountered by the codec

Required Methods§

source

fn encode(&self, input: &T) -> Result<Compact, Self::Error>

Convert to the compact version

source

fn decode(&self, compact: &Compact) -> Result<T, Self::Error>

Decode back to our request type

Implementors§