pub trait Encode {
// Required method
fn encode(&self, writer: &mut impl Write) -> Result<usize, EncodeError>;
// Provided method
fn encode_to_vec(&self) -> Result<Vec<u8>, EncodeError> { ... }
}
Expand description
A trait for encoding values into the matrix-pickle
binary format.
Required Methods§
Provided Methods§
Sourcefn encode_to_vec(&self) -> Result<Vec<u8>, EncodeError>
fn encode_to_vec(&self) -> Result<Vec<u8>, EncodeError>
Try to encode a value into a new Vec
.
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.