pub trait MutBumpAllocatorCoreScope<'a>: MutBumpAllocatorCore + BumpAllocatorCoreScope<'a> { }Expand description
A shorthand for MutBumpAllocatorCore + BumpAllocatorCoreScope<’a>
Trait Implementations§
Source§impl BumpAllocatorTyped for dyn MutBumpAllocatorCoreScope<'_> + '_
impl BumpAllocatorTyped for dyn MutBumpAllocatorCoreScope<'_> + '_
Source§type TypedStats<'b> = AnyStats<'b>
where
Self: 'b
type TypedStats<'b> = AnyStats<'b> where Self: 'b
The type returned by the stats method.
Source§fn typed_stats(&self) -> AnyStats<'_>
fn typed_stats(&self) -> AnyStats<'_>
Returns a type which provides statistics about the memory usage of the bump allocator.
Source§fn try_allocate_layout(&self, layout: Layout) -> Result<NonNull<u8>, AllocError>
fn try_allocate_layout(&self, layout: Layout) -> Result<NonNull<u8>, AllocError>
Source§fn try_allocate_sized<T>(&self) -> Result<NonNull<T>, AllocError>
fn try_allocate_sized<T>(&self) -> Result<NonNull<T>, AllocError>
Source§fn allocate_slice<T>(&self, len: usize) -> NonNull<T>
fn allocate_slice<T>(&self, len: usize) -> NonNull<T>
Source§fn try_allocate_slice<T>(&self, len: usize) -> Result<NonNull<T>, AllocError>
fn try_allocate_slice<T>(&self, len: usize) -> Result<NonNull<T>, AllocError>
Source§fn allocate_slice_for<T>(&self, slice: &[T]) -> NonNull<T>
fn allocate_slice_for<T>(&self, slice: &[T]) -> NonNull<T>
Source§fn try_allocate_slice_for<T>(
&self,
slice: &[T],
) -> Result<NonNull<T>, AllocError>
fn try_allocate_slice_for<T>( &self, slice: &[T], ) -> Result<NonNull<T>, AllocError>
Source§unsafe fn shrink_slice<T>(
&self,
ptr: NonNull<T>,
old_len: usize,
new_len: usize,
) -> Option<NonNull<T>>
unsafe fn shrink_slice<T>( &self, ptr: NonNull<T>, old_len: usize, new_len: usize, ) -> Option<NonNull<T>>
Source§fn prepare_slice_allocation<T>(&self, len: usize) -> NonNull<[T]>
fn prepare_slice_allocation<T>(&self, len: usize) -> NonNull<[T]>
A specialized version of
prepare_allocation. Read moreSource§fn try_prepare_slice_allocation<T>(
&self,
len: usize,
) -> Result<NonNull<[T]>, AllocError>
fn try_prepare_slice_allocation<T>( &self, len: usize, ) -> Result<NonNull<[T]>, AllocError>
A specialized version of
prepare_allocation. Read moreSource§unsafe fn allocate_prepared_slice<T>(
&self,
ptr: NonNull<T>,
len: usize,
cap: usize,
) -> NonNull<[T]>
unsafe fn allocate_prepared_slice<T>( &self, ptr: NonNull<T>, len: usize, cap: usize, ) -> NonNull<[T]>
A specialized version of
allocate_prepared. Read moreSource§fn prepare_slice_allocation_rev<T>(&self, len: usize) -> (NonNull<T>, usize)
fn prepare_slice_allocation_rev<T>(&self, len: usize) -> (NonNull<T>, usize)
A specialized version of
prepare_allocation_rev. Read moreSource§fn try_prepare_slice_allocation_rev<T>(
&self,
len: usize,
) -> Result<(NonNull<T>, usize), AllocError>
fn try_prepare_slice_allocation_rev<T>( &self, len: usize, ) -> Result<(NonNull<T>, usize), AllocError>
A specialized version of
prepare_allocation_rev. Read moreSource§unsafe fn allocate_prepared_slice_rev<T>(
&self,
ptr: NonNull<T>,
len: usize,
cap: usize,
) -> NonNull<[T]>
unsafe fn allocate_prepared_slice_rev<T>( &self, ptr: NonNull<T>, len: usize, cap: usize, ) -> NonNull<[T]>
A specialized version of
allocate_prepared_rev. Read moreSource§fn reserve(&self, additional: usize)
fn reserve(&self, additional: usize)
Reserves capacity for at least
additional more bytes to be bump allocated.
The bump allocator may reserve more space to avoid frequent reallocations.
After calling reserve, self.stats().remaining() will be greater than or equal to
additional. Does nothing if the capacity is already sufficient. Read moreSource§fn try_reserve(&self, additional: usize) -> Result<(), AllocError>
fn try_reserve(&self, additional: usize) -> Result<(), AllocError>
Reserves capacity for at least
additional more bytes to be bump allocated.
The bump allocator may reserve more space to avoid frequent reallocations.
After calling reserve, self.stats().remaining() will be greater than or equal to
additional. Does nothing if the capacity is already sufficient. Read more