pub trait Packable {
// Required method
fn pack<T>(&self, buf: &mut T) -> usize
where T: Extend<u8>;
// Provided method
fn pack_to_vec(&self) -> Vec<u8> ⓘ { ... }
}Expand description
A packable type.
Required Methods§
Provided Methods§
Sourcefn pack_to_vec(&self) -> Vec<u8> ⓘ
fn pack_to_vec(&self) -> Vec<u8> ⓘ
Packs the value into a vector of bytes.
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.