Trait BinEncodable

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

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

A type which can be encoded into a DNS binary format

Required Methods§

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

Write the type to the stream

Provided Methods§

fn to_bytes(&self) -> Result<Vec<u8>, ProtoError>

Returns the object in binary form

Implementations on Foreign Types§

§

impl BinEncodable for i32

§

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

§

impl BinEncodable for u16

§

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

§

impl BinEncodable for u32

§

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

Implementors§