Schedule

Trait Schedule 

Source
pub trait Schedule: Any {
    // Required method
    fn next_call_at(
        &self,
        last_run_at: Option<SystemTime>,
    ) -> Option<SystemTime>;

    // Provided method
    fn describe(&self) -> Option<ScheduleDescriptor> { ... }
}
Expand description

The trait that all schedules implement.

Required Methods§

Source

fn next_call_at(&self, last_run_at: Option<SystemTime>) -> Option<SystemTime>

Compute when a task should be executed again. If this method returns None then the task should never run again and it is safe to remove it from the list of scheduled tasks.

Provided Methods§

Source

fn describe(&self) -> Option<ScheduleDescriptor>

Describe this schedule so it can be serialized for persistence.

Implementors§

Source§

impl Schedule for DeltaSchedule

Source§

impl<Z> Schedule for CronSchedule<Z>
where Z: TimeZone + 'static,