Trait tonic::codec::Encoder

source ·
pub trait Encoder {
    type Item;
    type Error: From<Error>;

    // Required method
    fn encode(
        &mut self,
        item: Self::Item,
        dst: &mut EncodeBuf<'_>,
    ) -> Result<(), Self::Error>;
}
Expand description

Encodes gRPC message types

Required Associated Types§

source

type Item

The type that is encoded.

source

type Error: From<Error>

The type of encoding errors.

The type of unrecoverable frame encoding errors.

Required Methods§

source

fn encode( &mut self, item: Self::Item, dst: &mut EncodeBuf<'_>, ) -> Result<(), Self::Error>

Encodes a message into the provided buffer.

Implementors§