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;
}
Expand description
Schedule a recurring task
Required Associated Types§
sourcetype Inner
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§
sourcefn observe<F>(
&self,
metric: impl Deref<Target = InputMetric>,
operation: F
) -> ObserveWhen<'_, Self::Inner, F>where
F: Fn(Instant) -> MetricValue + Send + Sync + 'static,
Self: Sized,
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.