BytesStorage

Trait BytesStorage 

Source
pub trait BytesStorage: BytesStorageSealed { }
Expand description

Trait defining how data for a Byte buffer is stored.

There’s two implementations available:

This allows BytesInner to be generic over either sized or unsized storage. The heapless-bytes crate contains a BytesInner struct that’s generic on BytesStorage, and two type aliases for convenience:

Bytes can be unsized into StrinsgView, either by unsizing coercions such as &mut Bytes -> &mut BytesView or Box<Bytes> -> Box<BytesView>, or explicitly with .as_view() or .as_mut_view().

This trait is sealed, so you cannot implement it for your own types. You can only use the implementations provided by this crate.

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 ViewVecStorage<u8>

Source§

impl<const N: usize> BytesStorage for OwnedVecStorage<u8, N>

Implementors§