pub trait Encode {
// Required method
fn encode<W: Write>(&self, writer: &mut W) -> Result<()>;
// Provided method
fn encode_to_vec(&self) -> Result<Vec<u8>> { ... }
}Expand description
Hardware and language independent encoding. Uses the Writer pattern for more efficient encoding without intermediate buffers.
Required Methods§
Provided Methods§
Sourcefn encode_to_vec(&self) -> Result<Vec<u8>>
fn encode_to_vec(&self) -> Result<Vec<u8>>
Convenience method to encode into a Vec<u8>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".