Skip to main content

RateConfig

Trait RateConfig 

Source
pub trait RateConfig {
    // Required method
    fn rate_hz(&self) -> f32;

    // Provided methods
    fn create_interval(&self) -> Interval { ... }
    fn period(&self) -> Duration { ... }
}

Required Methods§

Source

fn rate_hz(&self) -> f32

Get the update rate in Hertz (cycles per second)

Provided Methods§

Source

fn create_interval(&self) -> Interval

Create a tokio interval from the configured rate

This is a convenience method that converts the rate to a Duration and creates a tokio::time::Interval.

Source

fn period(&self) -> Duration

Get the period (time between updates) as a Duration

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§