Skip to main content

WireCodec

Trait WireCodec 

Source
pub trait WireCodec {
    // Required methods
    fn frame(&self, frame: &Frame) -> Vec<u8> ⓘ;
    fn deframe(&self, datagram: &[u8]) -> Result<Frame, WireError>;
}
Expand description

Encodes Frames to datagrams and back. Implemented in M2.

Required Methods§

Source

fn frame(&self, frame: &Frame) -> Vec<u8> ⓘ

Serialize and header-protect a frame into a wire datagram.

Source

fn deframe(&self, datagram: &[u8]) -> Result<Frame, WireError>

Authenticate, deprotect, and parse a datagram into a Frame.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§