Trait dipstick::Observe

source ·
pub trait Observe {
    type Inner;

    // Required method
    fn observe<F>(
        &self,
        metric: impl Deref<Target = InputMetric>,
        operation: F,
    ) -> ObserveWhen<'_, Self::Inner, F>
       where F: Fn(Instant) -> MetricValue + Send + Sync + 'static,
             Self: Sized;
}
Expand description

Schedule a recurring task

Required Associated Types§

source

type Inner

The inner type for the ObserveWhen.

The observe can be delegated to a different type then Self, however the latter is more common.

Required Methods§

source

fn observe<F>( &self, metric: impl Deref<Target = InputMetric>, operation: F, ) -> ObserveWhen<'_, Self::Inner, F>
where F: Fn(Instant) -> MetricValue + Send + Sync + 'static, Self: Sized,

Provide a source for a metric’s values.

Implementors§