Trait trust_dns_proto::serialize::binary::BinDecodable
source · [−]pub trait BinDecodable<'r>: Sized {
fn read(decoder: &mut BinDecoder<'r>) -> ProtoResult<Self>;
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
Implementations on Foreign Types
sourceimpl<'r> BinDecodable<'r> for u16
impl<'r> BinDecodable<'r> for u16
fn read(decoder: &mut BinDecoder<'_>) -> ProtoResult<Self>
sourceimpl<'r> BinDecodable<'r> for i32
impl<'r> BinDecodable<'r> for i32
fn read(decoder: &mut BinDecoder<'_>) -> ProtoResult<Self>
sourceimpl<'r> BinDecodable<'r> for u32
impl<'r> BinDecodable<'r> for u32
fn read(decoder: &mut BinDecoder<'_>) -> ProtoResult<Self>
sourceimpl<'r> BinDecodable<'r> for Ipv4Addr
impl<'r> BinDecodable<'r> for Ipv4Addr
fn read(decoder: &mut BinDecoder<'_>) -> ProtoResult<Self>
sourceimpl<'r> BinDecodable<'r> for Ipv6Addr
impl<'r> BinDecodable<'r> for Ipv6Addr
fn read(decoder: &mut BinDecoder<'_>) -> ProtoResult<Self>
Implementors
impl<'r> BinDecodable<'r> for DNSClass
impl<'r> BinDecodable<'r> for Algorithm
Available on crate feature
dnssec
only.