pub trait BinEncodable {
    // Required method
    fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>;

    // Provided method
    fn to_bytes(&self) -> ProtoResult<Vec<u8>> { ... }
}
Expand description

A type which can be encoded into a DNS binary format

Required Methods§

source

fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>

Write the type to the stream

Provided Methods§

source

fn to_bytes(&self) -> ProtoResult<Vec<u8>>

Returns the object in binary form

Implementations on Foreign Types§

source§

impl BinEncodable for i32

source§

fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>

source§

impl BinEncodable for u16

source§

fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>

source§

impl BinEncodable for u32

source§

fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>

source§

impl BinEncodable for Vec<u8>

source§

fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>

source§

impl BinEncodable for Ipv4Addr

source§

fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>

source§

impl BinEncodable for Ipv6Addr

source§

fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>

Implementors§