Trait Allocator

Source
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§

Source

type Alloc: Alloc

The type of Alloc produced by this allocator.

Required Methods§

Source

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§