Skip to main content

TypedDecoder

Trait TypedDecoder 

Source
pub trait TypedDecoder {
    type Item;
    type Error;

    // Required methods
    fn decode(&self, data: Bytes) -> Result<Self::Item, Self::Error>;
    fn decode_mut(&mut self, data: Bytes) -> Result<Self::Item, Self::Error>;
}
Expand description

A decoder that decodes a specific type of message.

Required Associated Types§

Source

type Item

The type of messages this Decoder decodes.

Source

type Error

Type of error returned by this decoder if decoding fails.

Required Methods§

Source

fn decode(&self, data: Bytes) -> Result<Self::Item, Self::Error>

Attempt to decode the given data into a value.

Source

fn decode_mut(&mut self, data: Bytes) -> Result<Self::Item, Self::Error>

Attempt to decode the given data into a value, mutating the decoder’s state if doing so provides a benefit.

Implementors§