Struct stats_alloc::Region
source · [−]pub struct Region<'a, T: GlobalAlloc + 'a> { /* private fields */ }
Expand description
A snapshot of the allocation statistics, which can be used to determine
allocation changes while the Region
is alive.
Implementations
sourceimpl<'a, T: GlobalAlloc + 'a> Region<'a, T>
impl<'a, T: GlobalAlloc + 'a> Region<'a, T>
sourcepub fn new(alloc: &'a StatsAlloc<T>) -> Self
pub fn new(alloc: &'a StatsAlloc<T>) -> Self
Creates a new region using statistics from the given instrumented allocator.
sourcepub fn change(&self) -> Stats
pub fn change(&self) -> Stats
Returns the difference between the currently reported statistics and
those provided by initial()
.
sourcepub fn change_and_reset(&mut self) -> Stats
pub fn change_and_reset(&mut self) -> Stats
Returns the difference between the currently reported statistics and
those provided by initial()
, resetting initial to the latest
reported statistics.
Trait Implementations
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for Region<'a, T> where
T: RefUnwindSafe,
impl<'a, T> Send for Region<'a, T> where
T: Sync,
impl<'a, T> Sync for Region<'a, T> where
T: Sync,
impl<'a, T> Unpin for Region<'a, T>
impl<'a, T> UnwindSafe for Region<'a, T> where
T: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more