pub struct BumpScopeGuardRoot<'b, A, const MIN_ALIGN: usize = 1, const UP: bool = true, const DEALLOCATES: bool = true>{ /* private fields */ }
Expand description
Returned from Bump::scope_guard
.
This fulfills the same purpose as BumpScopeGuard
, but it does not need to store
the address which the bump pointer needs to be reset to. It simply resets the bump pointer to the very start.
It is allowed to do so because it takes a &mut Bump
to create this guard. This means that no
allocations can be live when the guard is created.
Implementations§
Source§impl<'a, A, const MIN_ALIGN: usize, const UP: bool, const DEALLOCATES: bool> BumpScopeGuardRoot<'a, A, MIN_ALIGN, UP, DEALLOCATES>
impl<'a, A, const MIN_ALIGN: usize, const UP: bool, const DEALLOCATES: bool> BumpScopeGuardRoot<'a, A, MIN_ALIGN, UP, DEALLOCATES>
Sourcepub fn scope(&mut self) -> BumpScope<'_, A, MIN_ALIGN, UP, true, DEALLOCATES>
pub fn scope(&mut self) -> BumpScope<'_, A, MIN_ALIGN, UP, true, DEALLOCATES>
Returns a new BumpScope
.
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Frees the memory taken up by allocations made since creation of this bump scope guard.
Trait Implementations§
Source§impl<A, const MIN_ALIGN: usize, const UP: bool, const DEALLOCATES: bool> Debug for BumpScopeGuardRoot<'_, A, MIN_ALIGN, UP, DEALLOCATES>
impl<A, const MIN_ALIGN: usize, const UP: bool, const DEALLOCATES: bool> Debug for BumpScopeGuardRoot<'_, A, MIN_ALIGN, UP, DEALLOCATES>
Auto Trait Implementations§
impl<'b, A, const MIN_ALIGN: usize, const UP: bool, const DEALLOCATES: bool> Freeze for BumpScopeGuardRoot<'b, A, MIN_ALIGN, UP, DEALLOCATES>where
MinimumAlignment<MIN_ALIGN>: Sized,
impl<'b, A, const MIN_ALIGN: usize = 1, const UP: bool = true, const DEALLOCATES: bool = true> !RefUnwindSafe for BumpScopeGuardRoot<'b, A, MIN_ALIGN, UP, DEALLOCATES>
impl<'b, A, const MIN_ALIGN: usize = 1, const UP: bool = true, const DEALLOCATES: bool = true> !Send for BumpScopeGuardRoot<'b, A, MIN_ALIGN, UP, DEALLOCATES>
impl<'b, A, const MIN_ALIGN: usize = 1, const UP: bool = true, const DEALLOCATES: bool = true> !Sync for BumpScopeGuardRoot<'b, A, MIN_ALIGN, UP, DEALLOCATES>
impl<'b, A, const MIN_ALIGN: usize, const UP: bool, const DEALLOCATES: bool> Unpin for BumpScopeGuardRoot<'b, A, MIN_ALIGN, UP, DEALLOCATES>where
MinimumAlignment<MIN_ALIGN>: Sized,
impl<'b, A, const MIN_ALIGN: usize = 1, const UP: bool = true, const DEALLOCATES: bool = true> !UnwindSafe for BumpScopeGuardRoot<'b, A, MIN_ALIGN, UP, DEALLOCATES>
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