Skip to main content

Decoder

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.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§