[][src]Trait dipstick::Observe

pub trait Observe {
    type Inner;
    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
; }

Schedule a recurring task

Associated Types

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.

Loading content...

Required methods

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.

Loading content...

Implementors

impl<T: InputScope + WithAttributes> Observe for T[src]

type Inner = Self

Loading content...