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§
Sourcefn emit(&self, encoder: &mut BinEncoder<'_>) -> Result<(), ProtoError>
fn emit(&self, encoder: &mut BinEncoder<'_>) -> Result<(), ProtoError>
Write the type to the stream
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".