pub trait Packer {
type Error;
// Required method
fn pack_bytes<B: AsRef<[u8]>>(
&mut self,
bytes: B,
) -> Result<(), Self::Error>;
// Provided method
fn written_bytes(&self) -> Option<usize> { ... }
}Expand description
A type that can pack any value that implements Packable.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn written_bytes(&self) -> Option<usize>
fn written_bytes(&self) -> Option<usize>
Returns the exact number of written bytes if possible.
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.