Trait binate::frame::Encode[][src]

pub trait Encode {
    fn encode(&self, buf: &mut BytesMut);
fn len(&self) -> usize; fn is_empty(&self) -> bool { ... }
fn to_bytes(&self) -> Bytes { ... } }
This is supported on crate feature frame only.
Expand description

A trait for encoding a frame into bytes.

Required methods

Encodes self into bytes.

Returns the length (in bytes) of this value.

Provided methods

Returns whether this value is empty.

Encodes self into bytes.

This function is guaranteed to return a Bytes whose capacity is exactly the same as self.len().

Implementors