Trait tonic::codec::Codec[][src]

pub trait Codec: Default {
    type Encode: Send + 'static;
    type Decode: Send + 'static;
    type Encoder: Encoder<Item = Self::Encode, Error = Status> + Send + Sync + 'static;
    type Decoder: Decoder<Item = Self::Decode, Error = Status> + Send + Sync + 'static;
    fn encoder(&mut self) -> Self::Encoder;
fn decoder(&mut self) -> Self::Decoder; }

Trait that knows how to encode and decode gRPC messages.

Associated Types

type Encode: Send + 'static[src]

The encodable message.

type Decode: Send + 'static[src]

The decodable message.

type Encoder: Encoder<Item = Self::Encode, Error = Status> + Send + Sync + 'static[src]

The encoder that can encode a message.

type Decoder: Decoder<Item = Self::Decode, Error = Status> + Send + Sync + 'static[src]

The encoder that can decode a message.

Loading content...

Required methods

fn encoder(&mut self) -> Self::Encoder[src]

Fetch the encoder.

fn decoder(&mut self) -> Self::Decoder[src]

Fetch the decoder.

Loading content...

Implementors

impl<T, U> Codec for ProstCodec<T, U> where
    T: Message + Send + 'static,
    U: Message + Default + Send + 'static, 
[src]

type Encode = T

type Decode = U

type Encoder = ProstEncoder<T>

type Decoder = ProstDecoder<U>

Loading content...