Skip to main content

BytesEncode

Trait BytesEncode 

Source
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§

Source

type EItem: ?Sized + 'a

The type to encode.

Required Methods§

Source

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".

Implementors§