Struct mz_ore::metrics::DeleteOnDropCounter
source · [−]pub struct DeleteOnDropCounter<'a, P, L> where
P: Atomic,
L: PromLabelsExt<'a>, {
inner: GenericCounter<P>,
labels: L,
vec: GenericCounterVec<P>,
_phantom: &'a PhantomData<()>,
}
Available on crate feature
metrics
only.Expand description
A GenericCounter
wrapper that deletes its labels from the vec when it is dropped
It adds a method to create a concrete metric from the vector that gets removed from the vector when the concrete metric is dropped.
Fields
inner: GenericCounter<P>
labels: L
vec: GenericCounterVec<P>
_phantom: &'a PhantomData<()>
Implementations
sourceimpl<'a, P, L> DeleteOnDropCounter<'a, P, L> where
P: Atomic,
L: PromLabelsExt<'a>,
impl<'a, P, L> DeleteOnDropCounter<'a, P, L> where
P: Atomic,
L: PromLabelsExt<'a>,
fn from_metric_vector(vec: GenericCounterVec<P>, labels: L) -> Self
Methods from Deref<Target = GenericCounter<P>>
sourcepub fn local(&self) -> GenericLocalCounter<P>
pub fn local(&self) -> GenericLocalCounter<P>
Return a GenericLocalCounter
for single thread usage.
Trait Implementations
sourceimpl<'a, P: Debug, L: Debug> Debug for DeleteOnDropCounter<'a, P, L> where
P: Atomic,
L: PromLabelsExt<'a>,
impl<'a, P: Debug, L: Debug> Debug for DeleteOnDropCounter<'a, P, L> where
P: Atomic,
L: PromLabelsExt<'a>,
sourceimpl<'a, P, L> Deref for DeleteOnDropCounter<'a, P, L> where
P: Atomic,
L: PromLabelsExt<'a>,
impl<'a, P, L> Deref for DeleteOnDropCounter<'a, P, L> where
P: Atomic,
L: PromLabelsExt<'a>,
type Target = GenericCounter<P>
type Target = GenericCounter<P>
The resulting type after dereferencing.
sourcefn deref(&self) -> &GenericCounter<P>
fn deref(&self) -> &GenericCounter<P>
Dereferences the value.
sourceimpl<'a, P, L> Drop for DeleteOnDropCounter<'a, P, L> where
P: Atomic,
L: PromLabelsExt<'a>,
impl<'a, P, L> Drop for DeleteOnDropCounter<'a, P, L> where
P: Atomic,
L: PromLabelsExt<'a>,
Auto Trait Implementations
impl<'a, P, L> !RefUnwindSafe for DeleteOnDropCounter<'a, P, L>
impl<'a, P, L> Send for DeleteOnDropCounter<'a, P, L> where
L: Send,
impl<'a, P, L> Sync for DeleteOnDropCounter<'a, P, L> where
L: Sync,
impl<'a, P, L> Unpin for DeleteOnDropCounter<'a, P, L> where
L: Unpin,
impl<'a, P, L> !UnwindSafe for DeleteOnDropCounter<'a, P, L>
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
sourceimpl<T> FutureExt for T
impl<T> FutureExt for T
sourcefn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
sourcefn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message T
in a tonic::Request
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn 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>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more