Trait Scheduler

Source
pub trait Scheduler {
    // Required methods
    fn is_ready(&self) -> bool;
    fn time_till_next_job(&self) -> Option<Duration>;
    fn tick(&mut self);
}
Expand description

An interface for scheduling sync jobs.

Required Methods§

Source

fn is_ready(&self) -> bool

Returns true if the scheduler is ready to run.

Source

fn time_till_next_job(&self) -> Option<Duration>

Returns the duration till the next job is supposed to run.

Source

fn tick(&mut self)

Increments time for the scheduler and executes any pending jobs.

Implementors§