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
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl<'r> BinDecodable<'r> for i32
impl<'r> BinDecodable<'r> for i32
fn read(decoder: &mut BinDecoder<'r>) -> ProtoResult<Self>
source§impl<'r> BinDecodable<'r> for u16
impl<'r> BinDecodable<'r> for u16
fn read(decoder: &mut BinDecoder<'_>) -> ProtoResult<Self>
source§impl<'r> BinDecodable<'r> for u32
impl<'r> BinDecodable<'r> for u32
fn read(decoder: &mut BinDecoder<'_>) -> ProtoResult<Self>
Implementors§
impl<'a> BinDecodable<'a> for ClientSubnet
impl<'r> BinDecodable<'r> for DNSClass
impl<'r> BinDecodable<'r> for Algorithm
Available on crate feature
dnssec
only.impl<'r> BinDecodable<'r> for SvcParamKey
impl<'r> BinDecodable<'r> for RecordType
impl<'r> BinDecodable<'r> for Header
impl<'r> BinDecodable<'r> for Message
impl<'r> BinDecodable<'r> for Query
impl<'r> BinDecodable<'r> for LowerQuery
impl<'r> BinDecodable<'r> for NSEC3PARAM
Available on crate feature
dnssec
only.