Trait trust_dns_proto::serialize::binary::BinDecodable
source · 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