Trait Scheduler

Source
pub trait Scheduler: 'static {
    // Required method
    fn schedule<T>(
        &self,
        future_factory: impl FnOnce() -> T + Send + 'static,
    ) -> Result<(), ScheduleError>
       where T: Future<Output = ()> + 'static;
}
Expand description

Async/await scheduler. Can schedule a task from a future factory and a shared state.

Required Methods§

Source

fn schedule<T>( &self, future_factory: impl FnOnce() -> T + Send + 'static, ) -> Result<(), ScheduleError>
where T: Future<Output = ()> + 'static,

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§