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

Object Safety§

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>,