pub trait BinaryEncode {
// Required method
fn encode<W: Write>(&self, encoder: &mut BinaryEncoder<W>) -> ChieResult<()>;
// Provided method
fn encode_to_vec(&self) -> ChieResult<Vec<u8>> { ... }
}Expand description
Trait for types that can be encoded to binary format
Required Methods§
Sourcefn encode<W: Write>(&self, encoder: &mut BinaryEncoder<W>) -> ChieResult<()>
fn encode<W: Write>(&self, encoder: &mut BinaryEncoder<W>) -> ChieResult<()>
Provided Methods§
Sourcefn encode_to_vec(&self) -> ChieResult<Vec<u8>>
fn encode_to_vec(&self) -> ChieResult<Vec<u8>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.