Skip to main content

BinDecodable

Trait BinDecodable 

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

    // Provided method
    fn from_bytes(bytes: &'r [u8]) -> Result<Self, DecodeError> { ... }
}
Available on crate features dns and hickory only.
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, DecodeError>

Read the type from the stream

Provided Methods§

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

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".

Implementations on Foreign Types§

§

impl BinDecodable<'_> for u16

§

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

§

impl BinDecodable<'_> for u32

§

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

§

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

§

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

Implementors§

§

impl BinDecodable<'_> for DNSClass

§

impl BinDecodable<'_> for RecordType

§

impl BinDecodable<'_> for TsigAlgorithm

§

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

§

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

§

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