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 Optional 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 duplicate 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> Freeze for Describable<Metric>where
Metric: Freeze,
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