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>
fn emit(&self, encoder: &mut BinEncoder<'_>) -> Result<(), ProtoError>
Write the type to the stream
Provided Methods§
fn to_bytes(&self) -> Result<Vec<u8>, ProtoError>
fn to_bytes(&self) -> Result<Vec<u8>, ProtoError>
Returns the object in binary form