pub trait Allocator {
type Alloc: Alloc;
// Required method
fn allocate<'life0, 'async_trait>(
&'life0 mut self,
spec: AllocSpec,
) -> Pin<Box<dyn Future<Output = Result<Self::Alloc, AllocatorError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
The core allocator trait, implemented by all allocators.
Required Associated Types§
Required Methods§
Sourcefn allocate<'life0, 'async_trait>(
&'life0 mut self,
spec: AllocSpec,
) -> Pin<Box<dyn Future<Output = Result<Self::Alloc, AllocatorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn allocate<'life0, 'async_trait>(
&'life0 mut self,
spec: AllocSpec,
) -> Pin<Box<dyn Future<Output = Result<Self::Alloc, AllocatorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a new allocation. The allocation itself is generally returned immediately (after validating parameters, etc.); the caller is expected to respond to allocation events as the underlying procs are incrementally allocated.
Implementors§
Source§impl Allocator for LocalAllocator
impl Allocator for LocalAllocator
type Alloc = LocalAlloc
Source§impl Allocator for ProcessAllocator
impl Allocator for ProcessAllocator
type Alloc = ProcessAlloc
Source§impl Allocator for MockAllocator
The core allocator trait, implemented by all allocators.
impl Allocator for MockAllocator
The core allocator trait, implemented by all allocators.