Trait Framer
pub trait Framer<B>where
B: IoBufMut,{
// Required methods
fn enclose(&mut self, buf: &mut B);
fn extract(&mut self, buf: &Slice<B>) -> Result<Option<Frame>, Error>;
}Available on crate feature
io only.Expand description
Enclosing and extracting frames in a buffer.
Required Methods§
fn enclose(&mut self, buf: &mut B)
fn enclose(&mut self, buf: &mut B)
Enclose a frame in the given buffer.
All initialized bytes in buf (buf[0..buf.buf_len()]) are valid and
required to be enclosed. All modifications should happen in-place; one
can use IoBufMut::reserve, IoBufMut::copy_within or a temporary
buffer if prepending data is necessary.