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
Implementations§
source§impl<M: MetricVecExt> DeleteOnDropWrapper<M>
impl<M: MetricVecExt> DeleteOnDropWrapper<M>
sourcepub fn get_delete_on_drop_metric<'a, L: PromLabelsExt<'a>>(
&self,
labels: L,
) -> DeleteOnDropMetric<'a, M, L>
pub fn get_delete_on_drop_metric<'a, L: PromLabelsExt<'a>>( &self, labels: L, ) -> DeleteOnDropMetric<'a, M, L>
Returns a metric that deletes its labels from this metrics vector when dropped.
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: MakeCollector + Debug> Debug for DeleteOnDropWrapper<M>
impl<M: MakeCollector + Debug> Debug for DeleteOnDropWrapper<M>
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> Freeze for DeleteOnDropWrapper<M>where
M: Freeze,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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