Struct prometheus_utils::DeferredAddWithLabels
source · [−]pub struct DeferredAddWithLabels<'a, L: Labels> { /* private fields */ }
Expand description
A guard that will automatically increment a labeled metric when dropped.
Created by calling IntCounterWithLabels::deferred_inc
.
Implementations
sourceimpl<'a, L: Labels> DeferredAddWithLabels<'a, L>
impl<'a, L: Labels> DeferredAddWithLabels<'a, L>
sourcepub fn with_labels(self, new_labels: L) -> DeferredAddWithLabels<'a, L>
pub fn with_labels(self, new_labels: L) -> DeferredAddWithLabels<'a, L>
Update the labels to use when incrementing the metric.
sourcepub fn complete_add(self)
pub fn complete_add(self)
Eagerly perform the increment, consuming the guard.
Trait Implementations
sourceimpl<'a, L: Labels> Drop for DeferredAddWithLabels<'a, L>
impl<'a, L: Labels> Drop for DeferredAddWithLabels<'a, L>
When dropped, a DeferredAddWithLabels
guard will increment its counter.
Auto Trait Implementations
impl<'a, L> !RefUnwindSafe for DeferredAddWithLabels<'a, L>
impl<'a, L> Send for DeferredAddWithLabels<'a, L> where
L: Send + Sync,
impl<'a, L> Sync for DeferredAddWithLabels<'a, L> where
L: Sync,
impl<'a, L> Unpin for DeferredAddWithLabels<'a, L> where
L: Unpin,
impl<'a, L> !UnwindSafe for DeferredAddWithLabels<'a, 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