pub struct HitCount<C: Counter = AtomicInt<u64>>(pub C);
Expand description

A metric counting how many times an expression as been hit, before it returns.

This is a light-weight metric.

By default, HitCount 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

Requests to clear self.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The resulting type after dereferencing.

Dereferences the value.

The type returned by the enter function and carried to OnResult

enter is called when entering in an aspect Read more

Called when an expression has returned. Read more

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

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Called when an expression has returned. Read more

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.