pub trait Encodable {
    // Required method
    fn encode(&self, e: &mut Encoder<'_>) -> EncodeResult<()>;

    // Provided method
    fn to_vec(&self) -> EncodeResult<Vec<u8>> { ... }
}
Expand description

A trait for types which are deserializable to DHCP binary formats

Required Methods§

source

fn encode(&self, e: &mut Encoder<'_>) -> EncodeResult<()>

encode type to buffer in Encoder

Provided Methods§

source

fn to_vec(&self) -> EncodeResult<Vec<u8>>

encode this type into its binary form in a new Vec

Implementors§