Trait BinDecodable

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§

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

Read the type from the stream

Provided Methods§

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

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§

§

impl BinDecodable<'_> for u16

§

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

§

impl BinDecodable<'_> for u32

§

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

§

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

§

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

Implementors§

§

impl BinDecodable<'_> for DNSClass

§

impl BinDecodable<'_> for RecordType

§

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

§

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

§

impl<'r> BinDecodable<'r> for CertType

§

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

§

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

§

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

§

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

§

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

§

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

§

impl<'r> BinDecodable<'r> for A

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

impl<'r> BinDecodable<'r> for EchConfigList

§

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

§

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

§

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

§

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

§

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