pub struct Records<'a> { /* private fields */ }
Expand description
Allows adding all values for an individual metric.
Values can either be simple, in which case they only consist of a value
and are appended via value
, or they can be labelled, in
which case there are multiple values for a metric that are distinguished
via a set of labels. Such values are appended via
label_value
.
Implementations
sourceimpl<'a> Records<'a>
impl<'a> Records<'a>
sourcepub fn value(&mut self, value: impl Display)
pub fn value(&mut self, value: impl Display)
Appends a simple value to the metrics target.
The value is simply output via the Display
trait.
sourcepub fn label_value(&mut self, labels: &[(&str, &str)], value: impl Display)
pub fn label_value(&mut self, labels: &[(&str, &str)], value: impl Display)
Appends a single labelled value to the metrics target.
The labels are a slice of pairs of strings with the first element the
name of the label and the second the label value. The metrics value
is simply printed via the Display
trait.
Auto Trait Implementations
impl<'a> RefUnwindSafe for Records<'a>
impl<'a> Send for Records<'a>
impl<'a> Sync for Records<'a>
impl<'a> Unpin for Records<'a>
impl<'a> !UnwindSafe for Records<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more