pub trait Decodable: Sized {
// Required method
fn decode(decoder: &mut Decoder<'_>) -> DecodeResult<Self>;
// Provided method
fn from_bytes(bytes: &[u8]) -> DecodeResult<Self> { ... }
}
Expand description
A trait for types which are serializable to and from DHCP binary formats
Required Methods§
sourcefn decode(decoder: &mut Decoder<'_>) -> DecodeResult<Self>
fn decode(decoder: &mut Decoder<'_>) -> DecodeResult<Self>
Read the type from the stream
Provided Methods§
sourcefn from_bytes(bytes: &[u8]) -> DecodeResult<Self>
fn from_bytes(bytes: &[u8]) -> DecodeResult<Self>
Returns the object in binary form
Object Safety§
This trait is not object safe.