Struct mz_ore::metrics::DeleteOnDropWrapper
source · pub struct DeleteOnDropWrapper<M> {
inner: M,
}
Available on crate feature
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 of 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§
source§impl<M: Clone> Clone for DeleteOnDropWrapper<M>
impl<M: Clone> Clone for DeleteOnDropWrapper<M>
source§fn clone(&self) -> DeleteOnDropWrapper<M>
fn clone(&self) -> DeleteOnDropWrapper<M>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<M: Collector> Collector for DeleteOnDropWrapper<M>
impl<M: Collector> Collector for DeleteOnDropWrapper<M>
source§impl<M: CounterVecExt> CounterVecExt for DeleteOnDropWrapper<M>
impl<M: CounterVecExt> CounterVecExt for DeleteOnDropWrapper<M>
§type CounterType = <M as CounterVecExt>::CounterType
type CounterType = <M as CounterVecExt>::CounterType
The type of value that the counter should count.
source§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.source§impl<M: MakeCollector + Debug> Debug for DeleteOnDropWrapper<M>
impl<M: MakeCollector + Debug> Debug for DeleteOnDropWrapper<M>
source§impl<M: GaugeVecExt> GaugeVecExt for DeleteOnDropWrapper<M>
impl<M: GaugeVecExt> GaugeVecExt for DeleteOnDropWrapper<M>
§type GaugeType = <M as GaugeVecExt>::GaugeType
type GaugeType = <M as GaugeVecExt>::GaugeType
The type of value that the gauge should count.
source§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.source§impl<M: HistogramVecExt> HistogramVecExt for DeleteOnDropWrapper<M>
impl<M: HistogramVecExt> HistogramVecExt for DeleteOnDropWrapper<M>
source§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.source§impl<M: MakeCollector> MakeCollector for DeleteOnDropWrapper<M>
impl<M: MakeCollector> MakeCollector for DeleteOnDropWrapper<M>
source§fn make_collector(opts: MakeCollectorOpts) -> Self
fn make_collector(opts: MakeCollectorOpts) -> Self
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§
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