Struct ore::metrics::DeleteOnDropWrapper [−][src]
pub struct DeleteOnDropWrapper<M> {
inner: M,
}
metrics
only.Expand description
A wrapper for metrics to require delete on drop semantics
The wrapper behaves like regular metrics but only provides functions to create delete-on-drop variants. This way, no metrics if this type can be leaked.
In situations where the delete-on-drop behavior is not desired or in legacy code, use the raw variants of the metrics, as defined in self::raw.
Fields
inner: M
Trait Implementations
type CounterType = M::CounterType
type CounterType = M::CounterType
The type of value that the counter should count.
fn get_delete_on_drop_counter<'a, L: PromLabelsExt<'a>>(
&self,
labels: L
) -> DeleteOnDropCounter<'a, Self::CounterType, L>
fn get_delete_on_drop_counter<'a, L: PromLabelsExt<'a>>(
&self,
labels: L
) -> DeleteOnDropCounter<'a, Self::CounterType, L>
Returns a counter that deletes its labels from this metrics vector when dropped.
See DeleteOnDropCounter
for a detailed description. Read more
fn get_delete_on_drop_gauge<'a, L: PromLabelsExt<'a>>(
&self,
labels: L
) -> DeleteOnDropGauge<'a, Self::GaugeType, L>
fn get_delete_on_drop_gauge<'a, L: PromLabelsExt<'a>>(
&self,
labels: L
) -> DeleteOnDropGauge<'a, Self::GaugeType, L>
Returns a gauge that deletes its labels from this metrics vector when dropped.
See DeleteOnDropGauge
for a detailed description. Read more
fn get_delete_on_drop_histogram<'a, L: PromLabelsExt<'a>>(
&self,
labels: L
) -> DeleteOnDropHistogram<'a, L>
fn get_delete_on_drop_histogram<'a, L: PromLabelsExt<'a>>(
&self,
labels: L
) -> DeleteOnDropHistogram<'a, L>
Returns a counter that deletes its labels from this metrics vector when dropped.
See DeleteOnDropCounter
for a detailed description. Read more
Creates a new collector.
Auto Trait Implementations
impl<M> RefUnwindSafe for DeleteOnDropWrapper<M> where
M: RefUnwindSafe,
impl<M> Send for DeleteOnDropWrapper<M> where
M: Send,
impl<M> Sync for DeleteOnDropWrapper<M> where
M: Sync,
impl<M> Unpin for DeleteOnDropWrapper<M> where
M: Unpin,
impl<M> UnwindSafe for DeleteOnDropWrapper<M> where
M: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more