pub trait BytesEncode<'a> {
type EItem: ?Sized + 'a;
// Required method
fn bytes_encode(item: &'a Self::EItem) -> Result<Cow<'a, [u8]>, BoxedError>;
}
Expand description
A trait that represents an encoding structure.
Required Associated Types§
Required Methods§
Sourcefn bytes_encode(item: &'a Self::EItem) -> Result<Cow<'a, [u8]>, BoxedError>
fn bytes_encode(item: &'a Self::EItem) -> Result<Cow<'a, [u8]>, BoxedError>
Encode the given item as 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.