pub trait Allocator {
    fn alloc(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>;
    unsafe fn dealloc(&self, ptr: NonNull<u8>, layout: Layout);
    fn capacity(&self) -> Byte;
    fn usage(&self) -> Byte;
}

Required Methods

Try to allocate a layout.

Deallocate memory at a location with a laoyut.

Total capacity of allocator.

Memory used by the allocator,

Implementors