pub struct Array<const N: usize> { /* private fields */ }
Expand description
An allocator that hands out allocations from a statically-sized chunk of bytes.
If the memory is exhausted, the only way to obtain more is to free all existing allocations. Alternatively, you can layer another allocator on top of this one that uses a more sophisticated allocation strategy.
Implementations§
Trait Implementations§
Source§impl<const N: usize> Allocator for Array<N>
impl<const N: usize> Allocator for Array<N>
Source§fn brand(&self) -> &Brand
fn brand(&self) -> &Brand
The unique brand of this allocator, that prevents allocations from other
allocators from being freed in this one, and vice-versa.
Source§fn alloc_bytes(&self, layout: Layout) -> Result<Alloc<'_, u8>, Error>
fn alloc_bytes(&self, layout: Layout) -> Result<Alloc<'_, u8>, Error>
Create an allocation of a certain layout, treating it as bytes. Read more
Source§fn remaining_size(&self) -> Option<usize>
fn remaining_size(&self) -> Option<usize>
The remaining amount of memory available to be allocated. Read more
Source§fn alloc_zeroed(&self, layout: Layout) -> Result<Alloc<'_, u8>, Error>
fn alloc_zeroed(&self, layout: Layout) -> Result<Alloc<'_, u8>, Error>
Like
alloc_bytes
, but guarantees that it is
filled with zeroes. Read moreSource§fn realloc<'this>(
&'this self,
alloc: Alloc<'this, u8>,
layout: Layout,
) -> Result<Alloc<'this, u8>, Error>
fn realloc<'this>( &'this self, alloc: Alloc<'this, u8>, layout: Layout, ) -> Result<Alloc<'this, u8>, Error>
Transform a given allocation to a new layout (generally to grow/shrink
it). Read more
impl<const N: usize> Sync for Array<N>
Auto Trait Implementations§
impl<const N: usize> !Freeze for Array<N>
impl<const N: usize> !RefUnwindSafe for Array<N>
impl<const N: usize> Send for Array<N>
impl<const N: usize> Unpin for Array<N>
impl<const N: usize> UnwindSafe for Array<N>
Blanket Implementations§
Source§impl<A> AllocatorExt for A
impl<A> AllocatorExt for A
Source§fn alloc<T>(&self) -> Result<Alloc<'_, T>, Error>
fn alloc<T>(&self) -> Result<Alloc<'_, T>, Error>
Creates an allocation suitable for a given type
T
. Read moreSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more