Skip to main content

Allocation

Trait Allocation 

Source
pub trait Allocation<T> {
    // Required method
    fn ptr(&self) -> *mut UnsafeCell<MaybeUninit<T>>;
}
Expand description

Handle for a slot buffer produced by an Allocator.

The pointer returned by ptr stays valid for the lifetime of the Allocation; dropping it releases the underlying memory.

Required Methods§

Source

fn ptr(&self) -> *mut UnsafeCell<MaybeUninit<T>>

Base pointer of the allocated region. Points to items contiguous, aligned cells (see Allocator::allocate).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§