Trait BytesStorage

Source
pub trait BytesStorage: Deref<Target = [u8]> {
    // Required method
    fn from_slice(bytes: &[u8]) -> Self;
}
Expand description

a trait that all storage types must implement (for our main types) (so the user can use their own types if they want)

Required Methods§

Source

fn from_slice(bytes: &[u8]) -> Self

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.

Implementations on Foreign Types§

Source§

impl BytesStorage for Box<[u8]>

Source§

fn from_slice(bytes: &[u8]) -> Self

Source§

impl BytesStorage for Arc<[u8]>

Source§

fn from_slice(bytes: &[u8]) -> Self

Source§

impl BytesStorage for Vec<u8>

Source§

fn from_slice(bytes: &[u8]) -> Self

Source§

impl BytesStorage for SlimmerBox<[u8], u16>

Source§

fn from_slice(bytes: &[u8]) -> Self

§Safety

The input must have a length less than u16::MAX (GUARANTEED AS RECLEN IS U16)

Implementors§