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§
Sourcefn next_call_at(&self, last_run_at: Option<SystemTime>) -> Option<SystemTime>
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§
Sourcefn describe(&self) -> Option<ScheduleDescriptor>
fn describe(&self) -> Option<ScheduleDescriptor>
Describe this schedule so it can be serialized for persistence.