trust_dns_proto::serialize::binary

Trait 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§

Source

fn read(decoder: &mut BinDecoder<'r>) -> ProtoResult<Self>

Read the type from the stream

Provided Methods§

Source

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.

Implementations on Foreign Types§

Source§

impl<'r> BinDecodable<'r> for i32

Source§

fn read(decoder: &mut BinDecoder<'_>) -> ProtoResult<Self>

Source§

impl<'r> BinDecodable<'r> for u16

Source§

fn read(decoder: &mut BinDecoder<'_>) -> ProtoResult<Self>

Source§

impl<'r> BinDecodable<'r> for u32

Source§

fn read(decoder: &mut BinDecoder<'_>) -> ProtoResult<Self>

Source§

impl<'r> BinDecodable<'r> for Ipv4Addr

Source§

fn read(decoder: &mut BinDecoder<'_>) -> ProtoResult<Self>

Source§

impl<'r> BinDecodable<'r> for Ipv6Addr

Source§

fn read(decoder: &mut BinDecoder<'_>) -> ProtoResult<Self>

Implementors§

Source§

impl<'r> BinDecodable<'r> for DNSClass

Source§

impl<'r> BinDecodable<'r> for SvcParamKey

Source§

impl<'r> BinDecodable<'r> for RecordType

Source§

impl<'r> BinDecodable<'r> for Header

Source§

impl<'r> BinDecodable<'r> for Message

Source§

impl<'r> BinDecodable<'r> for Query

Source§

impl<'r> BinDecodable<'r> for Name

Source§

impl<'r> BinDecodable<'r> for Alpn

Source§

impl<'r> BinDecodable<'r> for EchConfig

Source§

impl<'r> BinDecodable<'r> for Mandatory

Source§

impl<'r> BinDecodable<'r> for Unknown

Source§

impl<'r> BinDecodable<'r> for Record

Source§

impl<'r, T> BinDecodable<'r> for IpHint<T>
where T: BinDecodable<'r>,