[−][src]Enum alloc::alloc::AllocInit
A desired initial state for allocated memory.
Variants
The contents of the new memory are uninitialized.
The new memory is guaranteed to be zeroed.
Implementations
impl AllocInit[src]
pub unsafe fn init(self, memory: MemoryBlock)[src]
Initialize the specified memory block.
This behaves like calling AllocInit::init_offset(memory, 0).
Safety
memory.ptrmust be valid for writes ofmemory.sizebytes.
pub unsafe fn init_offset(self, memory: MemoryBlock, offset: usize)[src]
Initialize the memory block like specified by init at the specified offset.
This is a no-op for AllocInit::Uninitialized and writes zeroes for
AllocInit::Zeroed at ptr + offset until ptr + layout.size().
Safety
memory.ptrmust be valid for writes ofmemory.sizebytes.offsetmust be smaller than or equal tomemory.size
Trait Implementations
impl Clone for AllocInit[src]
fn clone(&self) -> AllocInit[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Copy for AllocInit[src]
impl Debug for AllocInit[src]
impl Eq for AllocInit[src]
impl PartialEq<AllocInit> for AllocInit[src]
impl StructuralEq for AllocInit[src]
impl StructuralPartialEq for AllocInit[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&Self) -> T[src]
fn clone_into(&Self, &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,