pub trait RateConfig {
// Required method
fn rate_hz(&self) -> f32;
// Provided methods
fn create_interval(&self) -> Interval { ... }
fn period(&self) -> Duration { ... }
}Required Methods§
Provided Methods§
Sourcefn create_interval(&self) -> Interval
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".