pub struct StatisticsCollector { /* private fields */ }Available on crate feature
stats only.Expand description
Collects statistics about pool operations.
This is used internally by pool implementations to track metrics
when the stats feature is enabled.
Implementations§
Source§impl StatisticsCollector
impl StatisticsCollector
Sourcepub fn record_allocation(&mut self)
pub fn record_allocation(&mut self)
Records an allocation.
Sourcepub fn record_deallocation(&mut self)
pub fn record_deallocation(&mut self)
Records a deallocation.
Sourcepub fn record_failure(&mut self)
pub fn record_failure(&mut self)
Records an allocation failure.
Sourcepub fn record_growth(&mut self, new_capacity: usize)
pub fn record_growth(&mut self, new_capacity: usize)
Records pool growth.
Sourcepub fn snapshot(&self) -> PoolStatistics
pub fn snapshot(&self) -> PoolStatistics
Returns a snapshot of the current statistics.
Auto Trait Implementations§
impl Freeze for StatisticsCollector
impl RefUnwindSafe for StatisticsCollector
impl Send for StatisticsCollector
impl Sync for StatisticsCollector
impl Unpin for StatisticsCollector
impl UnwindSafe for StatisticsCollector
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