Trait trust_dns_client::serialize::binary::BinDecodable
source · pub trait BinDecodable<'r>: Sized {
// Required method
fn read(decoder: &mut BinDecoder<'r>) -> Result<Self, ProtoError>;
// Provided method
fn from_bytes(bytes: &'r [u8]) -> Result<Self, ProtoError> { ... }
}
Expand description
A trait for types which are serializable to and from DNS binary formats
Required Methods§
sourcefn read(decoder: &mut BinDecoder<'r>) -> Result<Self, ProtoError>
fn read(decoder: &mut BinDecoder<'r>) -> Result<Self, ProtoError>
Read the type from the stream
Provided Methods§
sourcefn from_bytes(bytes: &'r [u8]) -> Result<Self, ProtoError>
fn from_bytes(bytes: &'r [u8]) -> Result<Self, ProtoError>
Returns the object in binary form
Object Safety§
This trait is not object safe.