Skip to main content

Module framing

Module framing 

Source
Expand description

Frame extraction strategies.

A Framer is a stateless protocol that locates and emits one frame at a time from a borrowed byte slice. Frames are described by Frame, which carries a zero-copy reference to the payload alongside the count of bytes the framer consumed from the input.

Two concrete framers ship with the crate:

Custom framers are implemented by writing a Framer impl on a user-defined type.

Re-exports§

pub use delimiter::Delimited;
pub use length::Endian;
pub use length::LengthPrefixed;
pub use length::LengthWidth;

Modules§

delimiter
Byte-delimited framing.
length
Length-prefixed framing.

Structs§

Frame
A frame extracted from an input byte slice.

Traits§

Framer
Strategy that extracts and emits one frame at a time.