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

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

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

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

Loading content...

Provided methods

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

Returns the object in binary form

Loading content...

Implementations on Foreign Types

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

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

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

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

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

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

Loading content...

Implementors

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

fn read(decoder: &mut BinDecoder<'r>) -> ProtoResult<LowerName>[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...

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

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

fn read(decoder: &mut BinDecoder<'r>) -> Result<Name, ProtoError>[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...

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

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

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

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

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

Loading content...