[][src]Trait witchcraft_metrics::Gauge

pub trait Gauge: 'static + Sync + Send {
    pub fn value(&self) -> Value;
}

A generalized metric which computes an arbitrary value.

It is implemented for all closures returning serializable types.

Required methods

pub fn value(&self) -> Value[src]

Returns the serialized value.

Loading content...

Implementations

impl dyn Gauge[src]

pub fn is<T>(&self) -> bool where
    T: Gauge
[src]

Returns true if the gauge value's type is T.

pub fn downcast_ref<T>(&self) -> Option<&T> where
    T: Gauge
[src]

Attempts to downcast the gauge's value to the type T if it has that type.

pub fn downcast_arc<T>(self: Arc<Self>) -> Result<Arc<T>, Arc<Self>> where
    T: Gauge
[src]

Attempts to downcast the gauge's value to the type T if it has that type.

Implementors

impl<F, R> Gauge for F where
    F: Fn() -> R + 'static + Sync + Send,
    R: Serialize
[src]

Loading content...