Struct metered::ErrorCount
source · [−]Expand description
A metric counting how many times an expression typed std Result
as
returned an Err
variant.
This is a light-weight metric.
By default, ErrorCount
uses a lock-free u64
Counter
, which makes sense
in multithread scenarios. Non-threaded applications can gain performance by
using a std::cell:Cell<u64>
instead.
Tuple Fields
0: C
Trait Implementations
sourceimpl<C: Clone + Counter> Clone for ErrorCount<C>
impl<C: Clone + Counter> Clone for ErrorCount<C>
sourcefn clone(&self) -> ErrorCount<C>
fn clone(&self) -> ErrorCount<C>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<C: Debug + Counter> Debug for ErrorCount<C>
impl<C: Debug + Counter> Debug for ErrorCount<C>
sourceimpl<C: Default + Counter> Default for ErrorCount<C>
impl<C: Default + Counter> Default for ErrorCount<C>
sourcefn default() -> ErrorCount<C>
fn default() -> ErrorCount<C>
Returns the “default value” for a type. Read more
sourceimpl<C: Counter> Deref for ErrorCount<C>
impl<C: Counter> Deref for ErrorCount<C>
sourceimpl<C: Counter> Enter for ErrorCount<C>
impl<C: Counter> Enter for ErrorCount<C>
sourceimpl<C: Counter, T, E> OnResult<Result<T, E>> for ErrorCount<C>
impl<C: Counter, T, E> OnResult<Result<T, E>> for ErrorCount<C>
sourcefn on_result(&self, _: (), r: &Result<T, E>) -> Advice
fn on_result(&self, _: (), r: &Result<T, E>) -> Advice
Called when an expression has returned. Read more
sourcefn leave_scope(&self, _enter: Self::E) -> Advice
fn leave_scope(&self, _enter: Self::E) -> Advice
Called when an expression has exited, but the return value isn’t known.
This can happen because of a panic, or if control flow bypasses a macro.
This is also called by the default implementation of on_result
. Read more
sourceimpl<C: Counter> Serialize for ErrorCount<C> where
C: Serialize,
impl<C: Counter> Serialize for ErrorCount<C> where
C: Serialize,
impl<C: Counter, T, E> Metric<Result<T, E>> for ErrorCount<C>
Auto Trait Implementations
impl<C> RefUnwindSafe for ErrorCount<C> where
C: RefUnwindSafe,
impl<C> Send for ErrorCount<C> where
C: Send,
impl<C> Sync for ErrorCount<C> where
C: Sync,
impl<C> Unpin for ErrorCount<C> where
C: Unpin,
impl<C> UnwindSafe for ErrorCount<C> where
C: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more