pub struct MetricsCounter<const N: usize> {
slots: [(usize, Instant); N],
index: usize,
}
Expand description
A metrics counter storing only latest N
records.
Fields§
§slots: [(usize, Instant); N]
Slots to store metrics.
index: usize
The slot of the oldest record. Also the next slot to store the new record.
Implementations§
source§impl<const N: usize> MetricsCounter<N>
impl<const N: usize> MetricsCounter<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for MetricsCounter<N>
impl<const N: usize> RefUnwindSafe for MetricsCounter<N>
impl<const N: usize> Send for MetricsCounter<N>
impl<const N: usize> Sync for MetricsCounter<N>
impl<const N: usize> Unpin for MetricsCounter<N>
impl<const N: usize> UnwindSafe for MetricsCounter<N>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.