pub struct WithoutShrink<A>(pub A);Expand description
Wraps a bump allocator and does nothing on shrink.
This type only implements Allocator for wrapped types that implement BumpAllocatorCore, so you don’t accidentally leak memory.
Tuple Fields§
§0: ATrait Implementations§
Source§impl<A: BumpAllocatorCore> Allocator for WithoutShrink<A>
Available on crate feature nightly-allocator-api only.
impl<A: BumpAllocatorCore> Allocator for WithoutShrink<A>
Available on crate feature
nightly-allocator-api only.Source§fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, TargetAllocError>
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, TargetAllocError>
🔬This is a nightly-only experimental API. (
allocator_api)Attempts to allocate a block of memory. Read more
Source§unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
🔬This is a nightly-only experimental API. (
allocator_api)Deallocates the memory referenced by
ptr. Read moreSource§unsafe fn grow(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, TargetAllocError>
unsafe fn grow( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, TargetAllocError>
🔬This is a nightly-only experimental API. (
allocator_api)Attempts to extend the memory block. Read more
Source§unsafe fn grow_zeroed(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, TargetAllocError>
unsafe fn grow_zeroed( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, TargetAllocError>
🔬This is a nightly-only experimental API. (
allocator_api)Behaves like
grow, but also ensures that the new contents are set to zero before being
returned. Read moreSource§unsafe fn shrink(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, TargetAllocError>
unsafe fn shrink( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, TargetAllocError>
🔬This is a nightly-only experimental API. (
allocator_api)Attempts to shrink the memory block. Read more
Source§fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (
allocator_api)Behaves like
allocate, but also ensures that the returned memory is zero-initialized. Read moreSource§impl<A: BumpAllocatorCore> Allocator for WithoutShrink<A>
Available on crate feature allocator-api2-03 only.
impl<A: BumpAllocatorCore> Allocator for WithoutShrink<A>
Available on crate feature
allocator-api2-03 only.Source§fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, TargetAllocError>
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, TargetAllocError>
Attempts to allocate a block of memory. Read more
Source§unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
Deallocates the memory referenced by
ptr. Read moreSource§unsafe fn grow(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, TargetAllocError>
unsafe fn grow( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, TargetAllocError>
Attempts to extend the memory block. Read more
Source§unsafe fn grow_zeroed(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, TargetAllocError>
unsafe fn grow_zeroed( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, TargetAllocError>
Behaves like
grow, but also ensures that the new contents are set to zero before being
returned. Read moreSource§unsafe fn shrink(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, TargetAllocError>
unsafe fn shrink( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, TargetAllocError>
Attempts to shrink the memory block. Read more
Source§fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
Behaves like
allocate, but also ensures that the returned memory is zero-initialized. Read moreSource§impl<A: BumpAllocatorCore> Allocator for WithoutShrink<A>
Available on crate feature allocator-api2-04 only.
impl<A: BumpAllocatorCore> Allocator for WithoutShrink<A>
Available on crate feature
allocator-api2-04 only.Source§fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, TargetAllocError>
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, TargetAllocError>
Attempts to allocate a block of memory. Read more
Source§unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
Deallocates the memory referenced by
ptr. Read moreSource§unsafe fn grow(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, TargetAllocError>
unsafe fn grow( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, TargetAllocError>
Attempts to extend the memory block. Read more
Source§unsafe fn grow_zeroed(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, TargetAllocError>
unsafe fn grow_zeroed( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, TargetAllocError>
Behaves like
grow, but also ensures that the new contents are set to zero before being
returned. Read moreSource§unsafe fn shrink(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, TargetAllocError>
unsafe fn shrink( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, TargetAllocError>
Attempts to shrink the memory block. Read more
Source§fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
Behaves like
allocate, but also ensures that the returned memory is zero-initialized. Read moreSource§impl<A: BumpAllocatorCore> Allocator for WithoutShrink<A>
impl<A: BumpAllocatorCore> Allocator for WithoutShrink<A>
Source§fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
Attempts to allocate a block of memory. Read more
Source§fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
Behaves like
allocate, but also ensures that the returned memory is zero-initialized. Read moreSource§unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
Deallocates the memory referenced by
ptr. Read moreSource§unsafe fn grow(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
Attempts to extend the memory block. Read more
Source§unsafe fn grow_zeroed(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow_zeroed( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
Behaves like
grow, but also ensures that the new contents are set to zero before being
returned. Read moreSource§impl<B: BumpAllocatorCore> BumpAllocatorCore for WithoutShrink<B>
impl<B: BumpAllocatorCore> BumpAllocatorCore for WithoutShrink<B>
Source§fn any_stats(&self) -> AnyStats<'_>
fn any_stats(&self) -> AnyStats<'_>
Returns a type which provides statistics about the memory usage of the bump allocator.
Source§fn checkpoint(&self) -> Checkpoint
fn checkpoint(&self) -> Checkpoint
Creates a checkpoint of the current bump position. Read more
Source§unsafe fn reset_to(&self, checkpoint: Checkpoint)
unsafe fn reset_to(&self, checkpoint: Checkpoint)
Resets the bump position to a previously created checkpoint.
The memory that has been allocated since then will be reused by future allocations. Read more
Source§fn is_claimed(&self) -> bool
fn is_claimed(&self) -> bool
Returns true if the bump allocator is currently claimed.
Source§fn prepare_allocation(
&self,
layout: Layout,
) -> Result<Range<NonNull<u8>>, AllocError>
fn prepare_allocation( &self, layout: Layout, ) -> Result<Range<NonNull<u8>>, AllocError>
Returns a pointer range of free space in the bump allocator with a size of at least
layout.size(). Read moreSource§unsafe fn allocate_prepared(
&self,
layout: Layout,
range: Range<NonNull<u8>>,
) -> NonNull<u8>
unsafe fn allocate_prepared( &self, layout: Layout, range: Range<NonNull<u8>>, ) -> NonNull<u8>
Allocate part of the free space returned from a
prepare_allocation call. Read moreSource§fn prepare_allocation_rev(
&self,
layout: Layout,
) -> Result<Range<NonNull<u8>>, AllocError>
fn prepare_allocation_rev( &self, layout: Layout, ) -> Result<Range<NonNull<u8>>, AllocError>
Returns a pointer range of free space in the bump allocator with a size of at least
layout.size(). Read moreSource§impl<B: BumpAllocatorTyped> BumpAllocatorTyped for WithoutShrink<B>
impl<B: BumpAllocatorTyped> BumpAllocatorTyped for WithoutShrink<B>
Source§type TypedStats<'b> = <B as BumpAllocatorTyped>::TypedStats<'b>
where
Self: 'b
type TypedStats<'b> = <B as BumpAllocatorTyped>::TypedStats<'b> where Self: 'b
The type returned by the stats method.
Source§fn typed_stats(&self) -> Self::TypedStats<'_>
fn typed_stats(&self) -> Self::TypedStats<'_>
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 moreSource§impl<A: Clone> Clone for WithoutShrink<A>
impl<A: Clone> Clone for WithoutShrink<A>
Source§fn clone(&self) -> WithoutShrink<A>
fn clone(&self) -> WithoutShrink<A>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<A: Debug> Debug for WithoutShrink<A>
impl<A: Debug> Debug for WithoutShrink<A>
Source§impl<A: Default> Default for WithoutShrink<A>
impl<A: Default> Default for WithoutShrink<A>
Source§fn default() -> WithoutShrink<A>
fn default() -> WithoutShrink<A>
Returns the “default value” for a type. Read more
Source§impl<A: Hash> Hash for WithoutShrink<A>
impl<A: Hash> Hash for WithoutShrink<A>
Source§impl<A: Ord> Ord for WithoutShrink<A>
impl<A: Ord> Ord for WithoutShrink<A>
Source§fn cmp(&self, other: &WithoutShrink<A>) -> Ordering
fn cmp(&self, other: &WithoutShrink<A>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<A: PartialEq> PartialEq for WithoutShrink<A>
impl<A: PartialEq> PartialEq for WithoutShrink<A>
Source§impl<A: PartialOrd> PartialOrd for WithoutShrink<A>
impl<A: PartialOrd> PartialOrd for WithoutShrink<A>
impl<'a, B: BumpAllocatorCoreScope<'a>> BumpAllocatorCoreScope<'a> for WithoutShrink<B>
impl<A: Copy> Copy for WithoutShrink<A>
impl<A: Eq> Eq for WithoutShrink<A>
impl<A: MutBumpAllocatorCore> MutBumpAllocatorCore for WithoutShrink<A>
impl<A> StructuralPartialEq for WithoutShrink<A>
Auto Trait Implementations§
impl<A> Freeze for WithoutShrink<A>where
A: Freeze,
impl<A> RefUnwindSafe for WithoutShrink<A>where
A: RefUnwindSafe,
impl<A> Send for WithoutShrink<A>where
A: Send,
impl<A> Sync for WithoutShrink<A>where
A: Sync,
impl<A> Unpin for WithoutShrink<A>where
A: Unpin,
impl<A> UnwindSafe for WithoutShrink<A>where
A: UnwindSafe,
Blanket Implementations§
Source§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
Source§impl<'a, B> BumpAllocatorTypedScope<'a> for B
impl<'a, B> BumpAllocatorTypedScope<'a> for B
Source§fn try_alloc<T>(&self, value: T) -> Result<BumpBox<'a, T>, AllocError>
fn try_alloc<T>(&self, value: T) -> Result<BumpBox<'a, T>, AllocError>
Allocate an object. Read more
Source§fn alloc_with<T>(&self, f: impl FnOnce() -> T) -> BumpBox<'a, T> ⓘ
fn alloc_with<T>(&self, f: impl FnOnce() -> T) -> BumpBox<'a, T> ⓘ
Allocates space for an object, then calls
f to produce the
value to be put in that place. Read moreSource§fn try_alloc_with<T>(
&self,
f: impl FnOnce() -> T,
) -> Result<BumpBox<'a, T>, AllocError>
fn try_alloc_with<T>( &self, f: impl FnOnce() -> T, ) -> Result<BumpBox<'a, T>, AllocError>
Allocates space for an object, then calls
f to produce the
value to be put in that place. Read moreSource§fn alloc_default<T: Default>(&self) -> BumpBox<'a, T> ⓘ
fn alloc_default<T: Default>(&self) -> BumpBox<'a, T> ⓘ
Allocate an object with its default value. Read more
Source§fn try_alloc_default<T: Default>(&self) -> Result<BumpBox<'a, T>, AllocError>
fn try_alloc_default<T: Default>(&self) -> Result<BumpBox<'a, T>, AllocError>
Allocate an object with its default value. Read more
Source§fn alloc_clone<T: CloneToUninit + ?Sized>(&self, value: &T) -> BumpBox<'a, T> ⓘ
fn alloc_clone<T: CloneToUninit + ?Sized>(&self, value: &T) -> BumpBox<'a, T> ⓘ
Available on crate feature
nightly-clone-to-uninit only.Allocate an object by cloning it. Read more
Source§fn try_alloc_clone<T: CloneToUninit + ?Sized>(
&self,
value: &T,
) -> Result<BumpBox<'a, T>, AllocError>
fn try_alloc_clone<T: CloneToUninit + ?Sized>( &self, value: &T, ) -> Result<BumpBox<'a, T>, AllocError>
Available on crate feature
nightly-clone-to-uninit only.Allocate an object by cloning it. Read more
Source§fn alloc_uninit<T>(&self) -> BumpBox<'a, MaybeUninit<T>> ⓘ
fn alloc_uninit<T>(&self) -> BumpBox<'a, MaybeUninit<T>> ⓘ
Allocate an uninitialized object. Read more
Source§fn try_alloc_uninit<T>(&self) -> Result<BumpBox<'a, MaybeUninit<T>>, AllocError>
fn try_alloc_uninit<T>(&self) -> Result<BumpBox<'a, MaybeUninit<T>>, AllocError>
Allocate an uninitialized object. Read more
Source§fn alloc_slice_move<T>(
&self,
slice: impl OwnedSlice<Item = T>,
) -> BumpBox<'a, [T]> ⓘ
fn alloc_slice_move<T>( &self, slice: impl OwnedSlice<Item = T>, ) -> BumpBox<'a, [T]> ⓘ
Allocate a slice and fill it by moving elements from an existing slice. Read more
Source§fn try_alloc_slice_move<T>(
&self,
slice: impl OwnedSlice<Item = T>,
) -> Result<BumpBox<'a, [T]>, AllocError>
fn try_alloc_slice_move<T>( &self, slice: impl OwnedSlice<Item = T>, ) -> Result<BumpBox<'a, [T]>, AllocError>
Allocate a slice and fill it by moving elements from an existing slice. Read more
Source§fn alloc_slice_copy<T: Copy>(&self, slice: &[T]) -> BumpBox<'a, [T]> ⓘ
fn alloc_slice_copy<T: Copy>(&self, slice: &[T]) -> BumpBox<'a, [T]> ⓘ
Allocate a slice and fill it by
Copying elements from an existing slice. Read moreSource§fn try_alloc_slice_copy<T: Copy>(
&self,
slice: &[T],
) -> Result<BumpBox<'a, [T]>, AllocError>
fn try_alloc_slice_copy<T: Copy>( &self, slice: &[T], ) -> Result<BumpBox<'a, [T]>, AllocError>
Allocate a slice and fill it by
Copying elements from an existing slice. Read moreSource§fn alloc_slice_clone<T: Clone>(&self, slice: &[T]) -> BumpBox<'a, [T]> ⓘ
fn alloc_slice_clone<T: Clone>(&self, slice: &[T]) -> BumpBox<'a, [T]> ⓘ
Allocate a slice and fill it by
Cloneing elements from an existing slice. Read moreSource§fn try_alloc_slice_clone<T: Clone>(
&self,
slice: &[T],
) -> Result<BumpBox<'a, [T]>, AllocError>
fn try_alloc_slice_clone<T: Clone>( &self, slice: &[T], ) -> Result<BumpBox<'a, [T]>, AllocError>
Allocate a slice and fill it by
Cloneing elements from an existing slice. Read moreSource§fn alloc_slice_fill<T: Clone>(&self, len: usize, value: T) -> BumpBox<'a, [T]> ⓘ
fn alloc_slice_fill<T: Clone>(&self, len: usize, value: T) -> BumpBox<'a, [T]> ⓘ
Allocate a slice and fill it with elements by cloning
value. Read moreSource§fn try_alloc_slice_fill<T: Clone>(
&self,
len: usize,
value: T,
) -> Result<BumpBox<'a, [T]>, AllocError>
fn try_alloc_slice_fill<T: Clone>( &self, len: usize, value: T, ) -> Result<BumpBox<'a, [T]>, AllocError>
Allocate a slice and fill it with elements by cloning
value. Read moreSource§fn alloc_slice_fill_with<T>(
&self,
len: usize,
f: impl FnMut() -> T,
) -> BumpBox<'a, [T]> ⓘ
fn alloc_slice_fill_with<T>( &self, len: usize, f: impl FnMut() -> T, ) -> BumpBox<'a, [T]> ⓘ
Allocates a slice by fill it with elements returned by calling a closure repeatedly. Read more
Source§fn try_alloc_slice_fill_with<T>(
&self,
len: usize,
f: impl FnMut() -> T,
) -> Result<BumpBox<'a, [T]>, AllocError>
fn try_alloc_slice_fill_with<T>( &self, len: usize, f: impl FnMut() -> T, ) -> Result<BumpBox<'a, [T]>, AllocError>
Allocates a slice by fill it with elements returned by calling a closure repeatedly. Read more
Source§fn alloc_uninit_slice<T>(&self, len: usize) -> BumpBox<'a, [MaybeUninit<T>]> ⓘ
fn alloc_uninit_slice<T>(&self, len: usize) -> BumpBox<'a, [MaybeUninit<T>]> ⓘ
Allocate an uninitialized object slice. Read more
Source§fn try_alloc_uninit_slice<T>(
&self,
len: usize,
) -> Result<BumpBox<'a, [MaybeUninit<T>]>, AllocError>
fn try_alloc_uninit_slice<T>( &self, len: usize, ) -> Result<BumpBox<'a, [MaybeUninit<T>]>, AllocError>
Allocate an uninitialized object slice. Read more
Source§fn alloc_uninit_slice_for<T>(
&self,
slice: &[T],
) -> BumpBox<'a, [MaybeUninit<T>]> ⓘ
fn alloc_uninit_slice_for<T>( &self, slice: &[T], ) -> BumpBox<'a, [MaybeUninit<T>]> ⓘ
Allocate an uninitialized object slice. Read more
Source§fn try_alloc_uninit_slice_for<T>(
&self,
slice: &[T],
) -> Result<BumpBox<'a, [MaybeUninit<T>]>, AllocError>
fn try_alloc_uninit_slice_for<T>( &self, slice: &[T], ) -> Result<BumpBox<'a, [MaybeUninit<T>]>, AllocError>
Allocate an uninitialized object slice. Read more
Source§fn try_alloc_str(&self, src: &str) -> Result<BumpBox<'a, str>, AllocError>
fn try_alloc_str(&self, src: &str) -> Result<BumpBox<'a, str>, AllocError>
Allocate a
str. Read moreSource§fn alloc_fmt(&self, args: Arguments<'_>) -> BumpBox<'a, str> ⓘ
fn alloc_fmt(&self, args: Arguments<'_>) -> BumpBox<'a, str> ⓘ
Allocate a
str from format arguments. Read moreSource§fn try_alloc_fmt(
&self,
args: Arguments<'_>,
) -> Result<BumpBox<'a, str>, AllocError>
fn try_alloc_fmt( &self, args: Arguments<'_>, ) -> Result<BumpBox<'a, str>, AllocError>
Allocate a
str from format arguments. Read moreSource§fn try_alloc_cstr(&self, src: &CStr) -> Result<&'a CStr, AllocError>
fn try_alloc_cstr(&self, src: &CStr) -> Result<&'a CStr, AllocError>
Allocate a
CStr. Read moreSource§fn try_alloc_cstr_from_str(&self, src: &str) -> Result<&'a CStr, AllocError>
fn try_alloc_cstr_from_str(&self, src: &str) -> Result<&'a CStr, AllocError>
Source§fn alloc_cstr_fmt(&self, args: Arguments<'_>) -> &'a CStr
fn alloc_cstr_fmt(&self, args: Arguments<'_>) -> &'a CStr
Allocate a
CStr from format arguments. Read moreSource§fn try_alloc_cstr_fmt(
&self,
args: Arguments<'_>,
) -> Result<&'a CStr, AllocError>
fn try_alloc_cstr_fmt( &self, args: Arguments<'_>, ) -> Result<&'a CStr, AllocError>
Allocate a
CStr from format arguments. Read moreSource§fn alloc_iter<T>(&self, iter: impl IntoIterator<Item = T>) -> BumpBox<'a, [T]> ⓘ
fn alloc_iter<T>(&self, iter: impl IntoIterator<Item = T>) -> BumpBox<'a, [T]> ⓘ
Allocate elements of an iterator into a slice. Read more
Source§fn try_alloc_iter<T>(
&self,
iter: impl IntoIterator<Item = T>,
) -> Result<BumpBox<'a, [T]>, AllocError>
fn try_alloc_iter<T>( &self, iter: impl IntoIterator<Item = T>, ) -> Result<BumpBox<'a, [T]>, AllocError>
Allocate elements of an iterator into a slice. Read more
Source§fn alloc_iter_exact<T, I>(
&self,
iter: impl IntoIterator<Item = T, IntoIter = I>,
) -> BumpBox<'a, [T]> ⓘwhere
I: ExactSizeIterator<Item = T>,
fn alloc_iter_exact<T, I>(
&self,
iter: impl IntoIterator<Item = T, IntoIter = I>,
) -> BumpBox<'a, [T]> ⓘwhere
I: ExactSizeIterator<Item = T>,
Allocate elements of an
ExactSizeIterator into a slice. Read moreSource§fn try_alloc_iter_exact<T, I>(
&self,
iter: impl IntoIterator<Item = T, IntoIter = I>,
) -> Result<BumpBox<'a, [T]>, AllocError>where
I: ExactSizeIterator<Item = T>,
fn try_alloc_iter_exact<T, I>(
&self,
iter: impl IntoIterator<Item = T, IntoIter = I>,
) -> Result<BumpBox<'a, [T]>, AllocError>where
I: ExactSizeIterator<Item = T>,
Allocate elements of an
ExactSizeIterator into a slice. Read moreSource§impl<'a, T> BumpAllocatorTypedScopeExt<'a> for Twhere
T: BumpAllocatorTypedScope<'a>,
impl<'a, T> BumpAllocatorTypedScopeExt<'a> for Twhere
T: BumpAllocatorTypedScope<'a>,
Source§fn alloc_zeroed<T>(&self) -> BumpBox<'a, T> ⓘwhere
T: Zeroable,
fn alloc_zeroed<T>(&self) -> BumpBox<'a, T> ⓘwhere
T: Zeroable,
Allocate a zeroed object. Read more
Source§fn try_alloc_zeroed<T>(&self) -> Result<BumpBox<'a, T>, AllocError>where
T: Zeroable,
fn try_alloc_zeroed<T>(&self) -> Result<BumpBox<'a, T>, AllocError>where
T: Zeroable,
Allocate a zeroed object. Read more
Source§fn alloc_zeroed_slice<T>(&self, len: usize) -> BumpBox<'a, [T]> ⓘwhere
T: Zeroable,
fn alloc_zeroed_slice<T>(&self, len: usize) -> BumpBox<'a, [T]> ⓘwhere
T: Zeroable,
Allocate a zeroed object slice. Read more
Source§fn try_alloc_zeroed_slice<T>(
&self,
len: usize,
) -> Result<BumpBox<'a, [T]>, AllocError>where
T: Zeroable,
fn try_alloc_zeroed_slice<T>(
&self,
len: usize,
) -> Result<BumpBox<'a, [T]>, AllocError>where
T: Zeroable,
Allocate a zeroed object slice. Read more
Source§impl<'a, T> BumpAllocatorTypedScopeExt<'a> for Twhere
T: BumpAllocatorTypedScope<'a>,
impl<'a, T> BumpAllocatorTypedScopeExt<'a> for Twhere
T: BumpAllocatorTypedScope<'a>,
Source§fn alloc_zeroed<T>(&self) -> BumpBox<'a, T> ⓘwhere
T: FromZeros,
fn alloc_zeroed<T>(&self) -> BumpBox<'a, T> ⓘwhere
T: FromZeros,
Allocate a zeroed object. Read more
Source§fn try_alloc_zeroed<T>(&self) -> Result<BumpBox<'a, T>, AllocError>where
T: FromZeros,
fn try_alloc_zeroed<T>(&self) -> Result<BumpBox<'a, T>, AllocError>where
T: FromZeros,
Allocate a zeroed object. Read more
Source§fn alloc_zeroed_slice<T>(&self, len: usize) -> BumpBox<'a, [T]> ⓘwhere
T: FromZeros,
fn alloc_zeroed_slice<T>(&self, len: usize) -> BumpBox<'a, [T]> ⓘwhere
T: FromZeros,
Allocate a zeroed object slice. Read more
Source§fn try_alloc_zeroed_slice<T>(
&self,
len: usize,
) -> Result<BumpBox<'a, [T]>, AllocError>where
T: FromZeros,
fn try_alloc_zeroed_slice<T>(
&self,
len: usize,
) -> Result<BumpBox<'a, [T]>, AllocError>where
T: FromZeros,
Allocate a zeroed object slice. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, A> MutBumpAllocatorTypedScope<'a> for A
impl<'a, A> MutBumpAllocatorTypedScope<'a> for A
Source§fn alloc_iter_mut<T>(
&mut self,
iter: impl IntoIterator<Item = T>,
) -> BumpBox<'a, [T]> ⓘ
fn alloc_iter_mut<T>( &mut self, iter: impl IntoIterator<Item = T>, ) -> BumpBox<'a, [T]> ⓘ
Allocate elements of an iterator into a slice. Read more
Source§fn try_alloc_iter_mut<T>(
&mut self,
iter: impl IntoIterator<Item = T>,
) -> Result<BumpBox<'a, [T]>, AllocError>
fn try_alloc_iter_mut<T>( &mut self, iter: impl IntoIterator<Item = T>, ) -> Result<BumpBox<'a, [T]>, AllocError>
Allocate elements of an iterator into a slice. Read more
Source§fn alloc_iter_mut_rev<T>(
&mut self,
iter: impl IntoIterator<Item = T>,
) -> BumpBox<'a, [T]> ⓘ
fn alloc_iter_mut_rev<T>( &mut self, iter: impl IntoIterator<Item = T>, ) -> BumpBox<'a, [T]> ⓘ
Allocate elements of an iterator into a slice in reverse order. Read more
Source§fn try_alloc_iter_mut_rev<T>(
&mut self,
iter: impl IntoIterator<Item = T>,
) -> Result<BumpBox<'a, [T]>, AllocError>
fn try_alloc_iter_mut_rev<T>( &mut self, iter: impl IntoIterator<Item = T>, ) -> Result<BumpBox<'a, [T]>, AllocError>
Allocate elements of an iterator into a slice in reverse order. Read more
Source§fn alloc_fmt_mut(&mut self, args: Arguments<'_>) -> BumpBox<'a, str> ⓘ
fn alloc_fmt_mut(&mut self, args: Arguments<'_>) -> BumpBox<'a, str> ⓘ
Allocate a
str from format arguments. Read moreSource§fn try_alloc_fmt_mut(
&mut self,
args: Arguments<'_>,
) -> Result<BumpBox<'a, str>, AllocError>
fn try_alloc_fmt_mut( &mut self, args: Arguments<'_>, ) -> Result<BumpBox<'a, str>, AllocError>
Allocate a
str from format arguments. Read moreSource§fn alloc_cstr_fmt_mut(&mut self, args: Arguments<'_>) -> &'a CStr
fn alloc_cstr_fmt_mut(&mut self, args: Arguments<'_>) -> &'a CStr
Allocate a
CStr from format arguments. Read moreSource§fn try_alloc_cstr_fmt_mut(
&mut self,
args: Arguments<'_>,
) -> Result<&'a CStr, AllocError>
fn try_alloc_cstr_fmt_mut( &mut self, args: Arguments<'_>, ) -> Result<&'a CStr, AllocError>
Allocate a
CStr from format arguments. Read more