Skip to main content

TypedEncoder

Trait TypedEncoder 

Source
pub trait TypedEncoder<T> {
    type Error;

    // Required methods
    fn encode(&self, value: &T) -> Result<Bytes, Self::Error>;
    fn encode_mut(&mut self, value: &T) -> Result<Bytes, Self::Error>;
}
Expand description

An encoder that encodes a specific type of message.

Required Associated Types§

Source

type Error

Type of error returned by this encoder if encoding fails.

Required Methods§

Source

fn encode(&self, value: &T) -> Result<Bytes, Self::Error>

Encode the given value to binary.

Source

fn encode_mut(&mut self, value: &T) -> Result<Bytes, Self::Error>

Encode the given value to binary, mutating the encoder if doing so provides a benefit.

Implementors§