[][src]Struct dipstick::InputMetric

pub struct InputMetric { /* fields omitted */ }

A metric is actually a function that knows to write a metric value to a metric output.

Methods

impl InputMetric[src]

pub fn new<F: Fn(MetricValue, Labels) + Send + Sync + 'static>(
    identifier: MetricId,
    metric: F
) -> InputMetric
[src]

Utility constructor

pub fn write(&self, value: MetricValue, labels: Labels)[src]

Collect a new value for this metric.

pub fn metric_id(&self) -> &MetricId[src]

Returns the unique identifier of this metric.

Trait Implementations

impl From<InputMetric> for Gauge[src]

impl From<InputMetric> for Timer[src]

impl From<InputMetric> for Counter[src]

impl From<InputMetric> for Marker[src]

impl From<InputMetric> for Level[src]

impl Clone for InputMetric[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for InputMetric[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T