pub trait AllocBytes: Clone + Debug + Eq + PartialEq<Self> + Hash + Deref<Target = [u8], Target = [u8]> + DerefMut {
    // Required methods
    fn adjust_to_align(self, _align: Align) -> Self;
    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§


fn adjust_to_align(self, _align: Align) -> Self

Adjust the bytes to the specified alignment – by default, this is a no-op.


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

Create an AllocBytes from a slice of u8.


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

Create a zeroed AllocBytes of the specified size and alignment; call the callback error handler if there is an error in allocating the memory.