Trait trust_dns_proto::serialize::binary::BinDecodable[][src]

pub trait BinDecodable<'r>: Sized {
    fn read(decoder: &mut BinDecoder<'r>) -> ProtoResult<Self>;

    fn from_bytes(bytes: &'r [u8]) -> ProtoResult<Self> { ... }
}

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

Required methods

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

Read the type from the stream

Loading content...

Provided methods

fn from_bytes(bytes: &'r [u8]) -> ProtoResult<Self>[src]

Returns the object in binary form

Loading content...

Implementations on Foreign Types

impl<'r> BinDecodable<'r> for u16[src]

impl<'r> BinDecodable<'r> for i32[src]

impl<'r> BinDecodable<'r> for u32[src]

impl<'r> BinDecodable<'r> for Ipv4Addr[src]

impl<'r> BinDecodable<'r> for Ipv6Addr[src]

Loading content...

Implementors

impl<'r> BinDecodable<'r> for DNSClass[src]

impl<'r> BinDecodable<'r> for SvcParamKey[src]

impl<'r> BinDecodable<'r> for RecordType[src]

impl<'r> BinDecodable<'r> for Header[src]

impl<'r> BinDecodable<'r> for Message[src]

impl<'r> BinDecodable<'r> for Query[src]

impl<'r> BinDecodable<'r> for Name[src]

fn read(decoder: &mut BinDecoder<'r>) -> ProtoResult<Name>[src]

parses the chain of labels this has a max of 255 octets, with each label being less than 63. all names will be stored lowercase internally. This will consume the portions of the Vec which it is reading…

impl<'r> BinDecodable<'r> for Alpn[src]

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

This expects the decoder to be limited to only this field, i.e. the end of input for the decoder is the end of input for the fields

  The wire format value for "alpn" consists of at least one "alpn-id"
  prefixed by its length as a single octet, and these length-value
  pairs are concatenated to form the SvcParamValue.  These pairs MUST
  exactly fill the SvcParamValue; otherwise, the SvcParamValue is
  malformed.

impl<'r> BinDecodable<'r> for EchConfig[src]

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

In wire format, the value of the parameter is an ECHConfigs vector [ECH], including the redundant length prefix (a 2 octet field containing the length of the SvcParamValue as an integer between 0 and 65535 in network byte order).

impl<'r> BinDecodable<'r> for Mandatory[src]

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

This expects the decoder to be limited to only this field, i.e. the end of input for the decoder is the end of input for the fields

   In wire format, the keys are represented by their numeric values in
   network byte order, concatenated in ascending order.

impl<'r> BinDecodable<'r> for Unknown[src]

impl<'r> BinDecodable<'r> for Record[src]

fn read(decoder: &mut BinDecoder<'r>) -> ProtoResult<Record>[src]

parse a resource record line example: WARNING: the record_bytes is 100% consumed and destroyed in this parsing process

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

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

The wire format for each parameter is a sequence of IP addresses in network byte order. Like an A or AAAA RRSet, the list of addresses represents an unordered collection, and clients SHOULD pick addresses to use in a random order. An empty list of addresses is invalid.

Loading content...