Struct bump_scope::BumpScopeGuard

source ·
pub struct BumpScopeGuard<'a, A, const MIN_ALIGN: usize = 1, const UP: bool = true>{ /* private fields */ }
Expand description

Returned from BumpScope::scope_guard.

Implementations§

source§

impl<'a, A, const MIN_ALIGN: usize, const UP: bool> BumpScopeGuard<'a, A, MIN_ALIGN, UP>

source

pub fn scope(&mut self) -> BumpScope<'_, A, MIN_ALIGN, UP>

Returns a new BumpScope.

source

pub fn reset(&mut self)

This will only keep around the newest chunk, which is also the biggest.

source

pub fn stats(&self) -> Stats<'_, UP>

Returns Stats, which provides statistics about the memory usage of the bump allocator.

source

pub fn guaranteed_allocated_stats(&self) -> GuaranteedAllocatedStats<'_, UP>

Returns GuaranteedAllocatedStats, which provides statistics about the memory usage of the bump allocator.

source

pub fn allocator(&self) -> &A

Returns a reference to the base allocator.

Trait Implementations§

source§

impl<'a, A, const MIN_ALIGN: usize, const UP: bool> Debug for BumpScopeGuard<'a, A, MIN_ALIGN, UP>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, A, const MIN_ALIGN: usize, const UP: bool> Drop for BumpScopeGuard<'a, A, MIN_ALIGN, UP>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a, A, const MIN_ALIGN: usize, const UP: bool> Freeze for BumpScopeGuard<'a, A, MIN_ALIGN, UP>

§

impl<'a, A, const MIN_ALIGN: usize = 1, const UP: bool = true> !RefUnwindSafe for BumpScopeGuard<'a, A, MIN_ALIGN, UP>

§

impl<'a, A, const MIN_ALIGN: usize = 1, const UP: bool = true> !Send for BumpScopeGuard<'a, A, MIN_ALIGN, UP>

§

impl<'a, A, const MIN_ALIGN: usize = 1, const UP: bool = true> !Sync for BumpScopeGuard<'a, A, MIN_ALIGN, UP>

§

impl<'a, A, const MIN_ALIGN: usize, const UP: bool> Unpin for BumpScopeGuard<'a, A, MIN_ALIGN, UP>

§

impl<'a, A, const MIN_ALIGN: usize = 1, const UP: bool = true> !UnwindSafe for BumpScopeGuard<'a, A, MIN_ALIGN, UP>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.