Struct metrics_prometheus::metric::Describable
source · pub struct Describable<Metric> { /* private fields */ }
Expand description
prometheus
metric with an ability to substitute its help
description
after registration in a prometheus::Registry
.
Implementations§
source§impl<M> Describable<M>
impl<M> Describable<M>
sourcepub fn wrap(metric: M) -> Self
pub fn wrap(metric: M) -> Self
Wraps the provided prometheus
metric
into a Describable
one.
sourcepub fn only_description(help: impl Into<String>) -> Selfwhere
M: Default,
pub fn only_description(help: impl Into<String>) -> Selfwhere
M: Default,
Generates a Default
prometheus
metric with the provided
help
description.
sourcepub fn map<Into>(self, into: impl FnOnce(M) -> Into) -> Describable<Into>
pub fn map<Into>(self, into: impl FnOnce(M) -> Into) -> Describable<Into>
Maps the wrapped prometheus
metric into
another one, preserving
the current overwritten help
description (if any).
source§impl<M> Describable<Option<M>>
impl<M> Describable<Option<M>>
sourcepub fn transpose(self) -> Option<Describable<M>>
pub fn transpose(self) -> Option<Describable<M>>
Transposes this Describable
Option
al metric into an Option
of a Describable
metric.
Trait Implementations§
source§impl<Metric: Clone> Clone for Describable<Metric>
impl<Metric: Clone> Clone for Describable<Metric>
source§fn clone(&self) -> Describable<Metric>
fn clone(&self) -> Describable<Metric>
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 for Describable<M>where
M: Collector,
impl<M> Collector for Describable<M>where
M: Collector,
source§impl<Metric: Debug> Debug for Describable<Metric>
impl<Metric: Debug> Debug for Describable<Metric>
source§impl<Metric: Default> Default for Describable<Metric>
impl<Metric: Default> Default for Describable<Metric>
source§fn default() -> Describable<Metric>
fn default() -> Describable<Metric>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<Metric> RefUnwindSafe for Describable<Metric>where
Metric: RefUnwindSafe,
impl<Metric> Send for Describable<Metric>where
Metric: Send,
impl<Metric> Sync for Describable<Metric>where
Metric: Sync,
impl<Metric> Unpin for Describable<Metric>where
Metric: Unpin,
impl<Metric> UnwindSafe for Describable<Metric>where
Metric: 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