pub struct ScopedMetricTimer<'a> { /* private fields */ }Expand description
A utility for timing the duration of a scope and automatically recording
the result in a Histogram when it is dropped.
This leverages the RAII pattern to ensure that the measurement is always
Implementations§
Source§impl<'a> ScopedMetricTimer<'a>
impl<'a> ScopedMetricTimer<'a>
Sourcepub fn new(histogram: &'a HistogramHandle) -> Self
pub fn new(histogram: &'a HistogramHandle) -> Self
Creates a new timer for the given histogram and starts it immediately.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ScopedMetricTimer<'a>
impl<'a> !RefUnwindSafe for ScopedMetricTimer<'a>
impl<'a> Send for ScopedMetricTimer<'a>
impl<'a> Sync for ScopedMetricTimer<'a>
impl<'a> Unpin for ScopedMetricTimer<'a>
impl<'a> !UnwindSafe for ScopedMetricTimer<'a>
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