pub struct MetricItem<'a> { /* private fields */ }
Expand description
A metric item with its current value.
Returned from MetricsGroup::iter
and MetricsGroupSet::iter
.
Implementations§
Source§impl<'a> MetricItem<'a>
impl<'a> MetricItem<'a>
Sourcepub fn new(
name: &'static str,
help: &'static str,
metric: &'a dyn Metric,
) -> Self
pub fn new( name: &'static str, help: &'static str, metric: &'a dyn Metric, ) -> Self
Returns a new metric item.
Sourcepub fn type(&self) -> MetricType
pub fn type(&self) -> MetricType
Returns the MetricType
for this item.
Sourcepub fn value(&self) -> MetricValue
pub fn value(&self) -> MetricValue
Returns the current value of this item.
Trait Implementations§
Source§impl<'a> Clone for MetricItem<'a>
impl<'a> Clone for MetricItem<'a>
Source§fn clone(&self) -> MetricItem<'a>
fn clone(&self) -> MetricItem<'a>
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<'a> Debug for MetricItem<'a>
impl<'a> Debug for MetricItem<'a>
impl<'a> Copy for MetricItem<'a>
Auto Trait Implementations§
impl<'a> Freeze for MetricItem<'a>
impl<'a> !RefUnwindSafe for MetricItem<'a>
impl<'a> !Send for MetricItem<'a>
impl<'a> !Sync for MetricItem<'a>
impl<'a> Unpin for MetricItem<'a>
impl<'a> !UnwindSafe for MetricItem<'a>
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