pub struct CloneMonitor { /* private fields */ }
Expand description
Clone operation monitor
Implementations§
Source§impl CloneMonitor
impl CloneMonitor
Sourcepub fn record_clone(&self, type_name: &str, size_bytes: usize, duration_ns: u64)
pub fn record_clone(&self, type_name: &str, size_bytes: usize, duration_ns: u64)
Record a clone operation
Sourcepub fn record_optimized_clone(&self, type_name: &str, memory_saved: usize)
pub fn record_optimized_clone(&self, type_name: &str, memory_saved: usize)
Record an optimized clone (using Arc)
Sourcepub fn record_avoided_clone(&self, _type_name: &str, memory_saved: usize)
pub fn record_avoided_clone(&self, _type_name: &str, memory_saved: usize)
Record an avoided clone (Arc sharing)
Sourcepub fn get_stats(&self) -> CloneMonitorStats
pub fn get_stats(&self) -> CloneMonitorStats
Get current statistics
Auto Trait Implementations§
impl !Freeze for CloneMonitor
impl RefUnwindSafe for CloneMonitor
impl Send for CloneMonitor
impl Sync for CloneMonitor
impl Unpin for CloneMonitor
impl UnwindSafe for CloneMonitor
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