pub struct ScheduledEvent { /* private fields */ }Expand description
One entry in a schedule.
Implementations§
Source§impl ScheduledEvent
impl ScheduledEvent
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
What this event is called in logs and in a TickReport.
Sourcepub fn expression(&self) -> String
pub fn expression(&self) -> String
The cron expression this event has been narrowed to so far.
Sourcepub fn every_minute(&mut self) -> &mut Self
pub fn every_minute(&mut self) -> &mut Self
Every minute. The default, spelled out.
Sourcepub fn every_minutes(&mut self, n: u32) -> &mut Self
pub fn every_minutes(&mut self, n: u32) -> &mut Self
Every n minutes, from the top of the hour.
Sourcepub fn daily(&mut self) -> &mut Self
pub fn daily(&mut self) -> &mut Self
Once a day at midnight. Narrow it with ScheduledEvent::at.
Sourcepub fn weekly_on(&mut self, day: Weekday, time: &str) -> &mut Self
pub fn weekly_on(&mut self, day: Weekday, time: &str) -> &mut Self
Once a week, on a day and at a time. Times are UTC.
Sourcepub fn at(&mut self, time: &str) -> &mut Self
pub fn at(&mut self, time: &str) -> &mut Self
The time of day, as HH:MM.
Sets the hour and minute fields, so daily().at("13:00") means one run a
day at one in the afternoon, UTC.
Sourcepub fn without_overlapping(&mut self) -> &mut Self
pub fn without_overlapping(&mut self) -> &mut Self
Skip a run when the previous one is still going.
A task that takes six minutes on a five-minute schedule would otherwise pile up until the process falls over. The lock is a flag in this process — good enough for the scheduler, which is meant to be run once, not once per node.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
True while a run of this event is in flight.