Trait Decoder

Source
pub trait Decoder {
    type Item;

    // Required method
    fn decode(&mut self, buf: &mut DecodeBuf<'_>) -> Result<Self::Item, Status>;
}
Expand description

Decodes gRPC message types

Required Associated Types§

Source

type Item

Type that is decoded

Required Methods§

Source

fn decode(&mut self, buf: &mut DecodeBuf<'_>) -> Result<Self::Item, Status>

Decode a message from the buffer.

The buffer will contain exactly the bytes of a full message. There is no need to get the length from the bytes, gRPC framing is handled for you.

Implementors§