Skip to main content

PayloadCodec

Trait PayloadCodec 

Source
pub trait PayloadCodec {
    // Required methods
    fn encode(
        &self,
        context: &SerializationContextData,
        payloads: Vec<Payload>,
    ) -> BoxFuture<'static, Vec<Payload>>;
    fn decode(
        &self,
        context: &SerializationContextData,
        payloads: Vec<Payload>,
    ) -> BoxFuture<'static, Vec<Payload>>;
}
Expand description

Encodes and decodes payloads, enabling encryption or compression.

Required Methods§

Source

fn encode( &self, context: &SerializationContextData, payloads: Vec<Payload>, ) -> BoxFuture<'static, Vec<Payload>>

Encode payloads before they are sent to the server.

Source

fn decode( &self, context: &SerializationContextData, payloads: Vec<Payload>, ) -> BoxFuture<'static, Vec<Payload>>

Decode payloads after they are received from the server.

Implementations on Foreign Types§

Source§

impl<T: PayloadCodec> PayloadCodec for Arc<T>

Source§

fn encode( &self, context: &SerializationContextData, payloads: Vec<Payload>, ) -> BoxFuture<'static, Vec<Payload>>

Source§

fn decode( &self, context: &SerializationContextData, payloads: Vec<Payload>, ) -> BoxFuture<'static, Vec<Payload>>

Implementors§