Trait distant_net::common::Codec

source ·
pub trait Codec: DynClone {
    fn encode<'a>(&mut self, frame: Frame<'a>) -> Result<Frame<'a>>;
    fn decode<'a>(&mut self, frame: Frame<'a>) -> Result<Frame<'a>>;
}
Expand description

Represents abstraction that implements specific encoder and decoder logic to transform an arbitrary collection of bytes. This can be used to encrypt and authenticate bytes sent and received by transports.

Required Methods

Encodes a frame’s item

Decodes a frame’s item

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Encodes a frame’s item
Decodes a frame’s item
Encodes a frame’s item
Decodes a frame’s item
Encodes a frame’s item
Decodes a frame’s item
Encodes a frame’s item
Decodes a frame’s item

Implementations on Foreign Types

Implementors