statime::filters

Trait Filter

Source
pub trait Filter {
    type Config: Clone;

    // Required methods
    fn new(config: Self::Config) -> Self;
    fn measurement<C: Clock>(
        &mut self,
        m: Measurement,
        clock: &mut C,
    ) -> FilterUpdate;
    fn update<C: Clock>(&mut self, clock: &mut C) -> FilterUpdate;
    fn demobilize<C: Clock>(self, clock: &mut C);
}
Expand description

A filter for post-processing time measurements.

Filters are responsible for dealing with the network noise, and should average out the input a bit so minor network variations are not immediately reflected in the synchronization of the clock.

This crate provides a simple BasicFilter which is suitable for most needs, but users can implement their own if desired.

Required Associated Types§

Source

type Config: Clone

Configuration for this Filter

This is used to construct a new Filter instance using new.

Required Methods§

Source

fn new(config: Self::Config) -> Self

Create a new instance of the filter.

Source

fn measurement<C: Clock>( &mut self, m: Measurement, clock: &mut C, ) -> FilterUpdate

Put a new measurement in the filter. The filter can then use this to adjust the clock

Source

fn update<C: Clock>(&mut self, clock: &mut C) -> FilterUpdate

Update initiated through FilterUpdate::next_update timeout.

Source

fn demobilize<C: Clock>(self, clock: &mut C)

Handle ending of time synchronization from the source associated with this filter.

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§