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§
Sourcefn encode(
&self,
generation: u8,
wire_name: &str,
payload: Vec<u8>,
) -> ClientResult<Vec<u8>>
fn encode( &self, generation: u8, wire_name: &str, payload: Vec<u8>, ) -> ClientResult<Vec<u8>>
Encode an envelope without modifying already-encoded payload bytes.
Sourcefn decode(&self, frame: RawFrame) -> ClientResult<Message>
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".