pub struct SmartStats {
pub allocation_count: AtomicU64,
pub deallocation_count: AtomicU64,
pub detailed_stats: Mutex<DetailedStats>,
}
Expand description
Macro for smart unwrapping (removed - use safe_operations instead) Performance-aware statistics that use the right tool for the job
Fields§
§allocation_count: AtomicU64
§deallocation_count: AtomicU64
§detailed_stats: Mutex<DetailedStats>
Implementations§
Source§impl SmartStats
impl SmartStats
pub fn new() -> Self
Sourcepub fn record_allocation(&self)
pub fn record_allocation(&self)
Fast path for simple counting
Sourcepub fn record_detailed_allocation(&self, size: usize, time: Duration)
pub fn record_detailed_allocation(&self, size: usize, time: Duration)
Slower path for detailed tracking (only when needed)
pub fn get_simple_stats(&self) -> (u64, u64)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SmartStats
impl !RefUnwindSafe for SmartStats
impl Send for SmartStats
impl Sync for SmartStats
impl Unpin for SmartStats
impl UnwindSafe for SmartStats
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more