Interpolation

Trait Interpolation 

Source
pub trait Interpolation<T>: Clone {
    // Required method
    fn interpolate<F>(
        &self,
        statistic: &mut F,
        n: NonZeroUsize,
    ) -> Result<(), FoldError>
       where F: Statistic<Sample = T>;

    // Provided method
    fn observe(&mut self, _sample: T) { ... }
}
Expand description

A type that observes data in order to synthesize and fold interpolated samples into a Statistic.

Interpolations mediate the aggregation of a Statistic by folding synthetic samples for sampling periods in which no data has been observed.

Required Methods§

Source

fn interpolate<F>( &self, statistic: &mut F, n: NonZeroUsize, ) -> Result<(), FoldError>
where F: Statistic<Sample = T>,

Folds an interpolated sample n times into the given Statistic.

Provided Methods§

Source

fn observe(&mut self, _sample: T)

Observes a (real) sample and potentially updates the state of the interpolation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> Interpolation<T> for ConstantSampleOutput<T>
where T: Clone,

Source§

impl<T> Interpolation<T> for LastSampleOutput<T>
where T: Clone,

Source§

impl<T> Interpolation<T> for NoSampleOutput<T>
where T: Clone,