BumpScopeGuard

Struct BumpScopeGuard 

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

Returned from BumpScope::scope_guard.

Implementations§

Source§

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

Source

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

Returns a new BumpScope.

Source

pub fn reset(&mut self)

Frees the memory taken up by allocations made since creation of this bump scope guard.

Source

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

Returns a type which provides statistics about the memory usage of the bump allocator.

Source

pub fn allocator(&self) -> &'a A

Returns a reference to the base allocator.

Trait Implementations§

Source§

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

Source§

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

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

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

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, const DEALLOCATES: bool> Freeze for BumpScopeGuard<'a, A, MIN_ALIGN, UP, DEALLOCATES>
where MinimumAlignment<MIN_ALIGN>: Sized,

§

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

§

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

§

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

§

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

§

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

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>,

Source§

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>,

Source§

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.