Skip to main content

Encoder

Trait Encoder 

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

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

Encoder for gRPC messages.

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 LinkedBytes, ) -> Result<(), Self::Error>

Encodes a message into the buffer.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§