pub trait AllocBytes: Clone + Debug + Eq + PartialEq + Hash + Deref<Target = [u8], Target = [u8]> + DerefMut {
    // Required methods
    fn from_bytes<'a>(slice: impl Into<Cow<'a, [u8]>>, _align: Align) -> Self;
    fn zeroed(size: Size, _align: Align) -> Option<Self>;
}
Expand description

Functionality required for the bytes of an Allocation.

Required Methods§

source

fn from_bytes<'a>(slice: impl Into<Cow<'a, [u8]>>, _align: Align) -> Self

Create an AllocBytes from a slice of u8.

source

fn zeroed(size: Size, _align: Align) -> Option<Self>

Create a zeroed AllocBytes of the specified size and alignment. Returns None if we ran out of memory on the host.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl AllocBytes for Box<[u8]>

source§

fn from_bytes<'a>(slice: impl Into<Cow<'a, [u8]>>, _align: Align) -> Box<[u8]>

source§

fn zeroed(size: Size, _align: Align) -> Option<Box<[u8]>>

Implementors§