BufferAllocator

Trait BufferAllocator 

Source
pub trait BufferAllocator {
    type Buffer<'source>: DerefMut<Target = [MaybeUninit<u8>]>
       where Self: 'source;
    type Error;

    // Required method
    fn alloc<'source>(
        &'source self,
        size: NonZeroUsize,
    ) -> Result<Self::Buffer<'source>, Self::Error>;
}

Required Associated Types§

Source

type Buffer<'source>: DerefMut<Target = [MaybeUninit<u8>]> where Self: 'source

Source

type Error

Required Methods§

Source

fn alloc<'source>( &'source self, size: NonZeroUsize, ) -> Result<Self::Buffer<'source>, Self::Error>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<A> BufferAllocator for A
where A: Allocator,

Source§

type Buffer<'source> = AllocBuf<'source, A> where Self: 'source

Source§

type Error = AllocatorError