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§
sourcefn encode(&self, e: &mut Encoder<'_>) -> EncodeResult<()>
fn encode(&self, e: &mut Encoder<'_>) -> EncodeResult<()>
encode type to buffer in Encoder
Provided Methods§
sourcefn to_vec(&self) -> EncodeResult<Vec<u8>>
fn to_vec(&self) -> EncodeResult<Vec<u8>>
encode this type into its binary form in a new Vec