Skip to main content

EnvelopeCodec

Trait EnvelopeCodec 

Source
pub trait EnvelopeCodec:
    Send
    + Sync
    + 'static {
    // Required methods
    fn encode(
        &self,
        generation: u8,
        wire_name: &str,
        payload: Vec<u8>,
    ) -> ClientResult<Vec<u8>>;
    fn decode(&self, frame: RawFrame) -> ClientResult<Message>;
}
Expand description

Envelope semantics chosen during setup. Raw routing never invokes this.

Required Methods§

Source

fn encode( &self, generation: u8, wire_name: &str, payload: Vec<u8>, ) -> ClientResult<Vec<u8>>

Encode an envelope without modifying already-encoded payload bytes.

Source

fn decode(&self, frame: RawFrame) -> ClientResult<Message>

Decode an inspectable message while retaining its original wire frame.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§