pub struct ScopedBump<'a> { /* private fields */ }Expand description
A scoped bump allocator that automatically resets when dropped.
Useful for allocating temporary data within a scope.
Implementations§
Source§impl<'a> ScopedBump<'a>
impl<'a> ScopedBump<'a>
Sourcepub fn new(bump: &'a mut BumpAllocator) -> Self
pub fn new(bump: &'a mut BumpAllocator) -> Self
Creates a new scoped allocator.
Sourcepub fn scope_allocated_bytes(&self) -> usize
pub fn scope_allocated_bytes(&self) -> usize
Returns the number of bytes allocated in this scope.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ScopedBump<'a>
impl<'a> !RefUnwindSafe for ScopedBump<'a>
impl<'a> Send for ScopedBump<'a>
impl<'a> !Sync for ScopedBump<'a>
impl<'a> Unpin for ScopedBump<'a>
impl<'a> !UnwindSafe for ScopedBump<'a>
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