Encodable

Trait Encodable 

Source
pub trait Encodable {
    // Required methods
    fn encoded_size(&self) -> usize;
    fn encode_into(&self, buf: &mut impl BufMut);

    // Provided method
    fn to_bytes(&self) -> Bytes { ... }
}

Required Methods§

Source

fn encoded_size(&self) -> usize

Source

fn encode_into(&self, buf: &mut impl BufMut)

Provided Methods§

Source

fn to_bytes(&self) -> Bytes

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§