pub trait BinDecodable<'r>: Sized {
// Required method
fn read(decoder: &mut BinDecoder<'r>) -> ProtoResult<Self>;
// Provided method
fn from_bytes(bytes: &'r [u8]) -> ProtoResult<Self> { ... }
}
Expand description
A trait for types which are serializable to and from DNS binary formats
Required Methods§
Sourcefn read(decoder: &mut BinDecoder<'r>) -> ProtoResult<Self>
fn read(decoder: &mut BinDecoder<'r>) -> ProtoResult<Self>
Read the type from the stream
Provided Methods§
Sourcefn from_bytes(bytes: &'r [u8]) -> ProtoResult<Self>
fn from_bytes(bytes: &'r [u8]) -> ProtoResult<Self>
Returns the object in binary form
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.