pub struct AllocationStats { /* private fields */ }
Expand description
Statistics for an allocation group.
Implementations§
Source§impl AllocationStats
impl AllocationStats
Sourcepub fn has_allocated(&self) -> bool
pub fn has_allocated(&self) -> bool
Returns true
if the given group has allocated any memory at all.
Sourcepub fn snapshot_delta(
&self,
previous: &AllocationStatsSnapshot,
) -> AllocationStatsSnapshot
pub fn snapshot_delta( &self, previous: &AllocationStatsSnapshot, ) -> AllocationStatsSnapshot
Captures a snapshot of the current statistics based on the delta from a previous snapshot.
This can be used to keep a single local snapshot of the last delta, and then both track the delta since that snapshot, as well as update the snapshot to the current statistics.
Callers should generally create their snapshot via AllocationStatsSnapshot::empty
and then use this method
to get their snapshot delta, utilize those delta values in whatever way is necessary, and then merge the
snapshot delta into the primary snapshot via AllocationStatsSnapshot::merge
to make it current.
Auto Trait Implementations§
impl !Freeze for AllocationStats
impl RefUnwindSafe for AllocationStats
impl Send for AllocationStats
impl Sync for AllocationStats
impl Unpin for AllocationStats
impl UnwindSafe for AllocationStats
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Track for T
impl<T> Track for T
Source§fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self> ⓘ
fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self> ⓘ
Instruments this type by attaching the given allocation group token, returning a
Tracked
wrapper. Read more