pub trait BinDecodable<'r>: Sized {
    // Required method
    fn read(decoder: &mut BinDecoder<'r>) -> Result<Self, ProtoError>;

    // Provided method
    fn from_bytes(bytes: &'r [u8]) -> Result<Self, ProtoError> { ... }
}
Expand description

A trait for types which are serializable to and from DNS binary formats

Required Methods§

source

fn read(decoder: &mut BinDecoder<'r>) -> Result<Self, ProtoError>

Read the type from the stream

Provided Methods§

source

fn from_bytes(bytes: &'r [u8]) -> Result<Self, ProtoError>

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<'r>) -> Result<i32, ProtoError>

source§

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

source§

fn read(decoder: &mut BinDecoder<'_>) -> Result<u16, ProtoError>

source§

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

source§

fn read(decoder: &mut BinDecoder<'_>) -> Result<u32, ProtoError>

Implementors§

source§

impl<'a> BinDecodable<'a> for ClientSubnet

source§

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

source§

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

source§

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

source§

impl<'r> BinDecodable<'r> for Algorithm

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 A

source§

impl<'r> BinDecodable<'r> for AAAA

source§

impl<'r> BinDecodable<'r> for ANAME

source§

impl<'r> BinDecodable<'r> for CNAME

source§

impl<'r> BinDecodable<'r> for HINFO

source§

impl<'r> BinDecodable<'r> for MX

source§

impl<'r> BinDecodable<'r> for NAPTR

source§

impl<'r> BinDecodable<'r> for NS

source§

impl<'r> BinDecodable<'r> for NSEC3PARAM

source§

impl<'r> BinDecodable<'r> for PTR

source§

impl<'r> BinDecodable<'r> for SOA

source§

impl<'r> BinDecodable<'r> for SRV

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 Name

source§

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

source§

impl<'r> BinDecodable<'r> for LowerQuery

source§

impl<'r> BinDecodable<'r> for LowerName

source§

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