pub trait Encode {
type Item: Sized;
// Required method
fn encode(&mut self, value: Self::Item, buf: &mut Buf);
}
Expand description
A trait for encoding frames into a byte buffer.
This trait is used as a building block of Framed
to define how frames are
encoded into bytes to get passed to the underlying byte stream. each
frame written to Framed
will be encoded with this trait to an internal
buffer. That buffer is then written out when possible to the underlying I/O
stream.