Struct mz_ore::metrics::delete_on_drop::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.
NOTE: This type implements Borrow
, which imposes some constraints on implementers. To
ensure these constraints, do not implement any of the Eq
, Ord
, or Hash
traits on this.
type.
Fields§
§inner: GenericCounter<P>
§labels: L
§vec: GenericCounterVec<P>
§_phantom: &'a PhantomData<()>
Implementations§
source§impl<'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§
source§impl<'a, P, L> Borrow<GenericCounter<P>> for DeleteOnDropCounter<'a, P, L>where
P: Atomic,
L: PromLabelsExt<'a>,
impl<'a, P, L> Borrow<GenericCounter<P>> for DeleteOnDropCounter<'a, P, L>where
P: Atomic,
L: PromLabelsExt<'a>,
source§fn borrow(&self) -> &GenericCounter<P>
fn borrow(&self) -> &GenericCounter<P>
Immutably borrows from an owned value. Read more
source§impl<'a, P, L> Debug for DeleteOnDropCounter<'a, P, L>
impl<'a, P, L> Debug for DeleteOnDropCounter<'a, P, L>
source§impl<'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.
source§fn deref(&self) -> &GenericCounter<P>
fn deref(&self) -> &GenericCounter<P>
Dereferences the value.
source§impl<'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>,
source§impl<'a, P, L> InstrumentedChannelMetric for DeleteOnDropCounter<'a, P, L>where
P: Atomic,
L: PromLabelsExt<'a>,
Available on crate feature async
only.
impl<'a, P, L> InstrumentedChannelMetric for DeleteOnDropCounter<'a, P, L>where
P: Atomic,
L: PromLabelsExt<'a>,
Available on crate feature
async
only.Auto Trait Implementations§
impl<'a, P, L> Freeze for DeleteOnDropCounter<'a, P, L>where
L: Freeze,
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§
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
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request