pub enum ScheduleRule {
Minutely {
every: u32,
},
Hourly {
every: u32,
},
Daily {
every: u32,
},
Weekly {
every: u32,
weekdays: Vec<Weekday>,
},
Monthly {
every: u32,
day: u32,
},
Yearly {
every: u32,
month: u32,
day: u32,
},
}Expand description
A recurrence rule evaluated in a schedule’s local timezone.
§Rule families
The rule variants fall into two broad groups:
- clock-based rules:
- calendar-based rules:
§Anchoring semantics
Recurrence rules must have stable phase semantics so that querying at different times does not redefine the schedule.
This implementation uses the following anchors:
Minutely { every }: occurrences happen at local times whose minute satisfiesminute % every == 0, with seconds and subseconds taken fromat.Hourly { every }: occurrences happen at local times whose hour satisfieshour % every == 0, with minute/second/subsecond taken fromat.Daily { every }: anchored to the fixed local date1970-01-01.Weekly { every, ... }: anchored to the Monday of the week containing1970-01-01.Monthly { every, day }: anchored to January 1970.Yearly { every, month, day }: anchored to the calendar year 1970.
These anchors provide stable recurrence phase across calls to
WindowSource::next_window and WindowSource::active_windows.
Variants§
Minutely
Recur every every minutes within each hour.
For example, Minutely { every: 15 } with at = 00:00:30 produces
local times such as:
00:00:3000:15:3000:30:3000:45:3001:00:30
and so on.
Hourly
Recur every every hours within each day.
For example, Hourly { every: 6 } with at = 00:10:00 produces local
times such as:
00:10:0006:10:0012:10:0018:10:00- next day
00:10:00
and so on.
Daily
Recur every every days, anchored to 1970-01-01.
Weekly
Recur every every weeks on the specified weekdays, anchored to the
Monday of the week containing 1970-01-01.
Monthly
Recur every every months on a specific day-of-month.
Months that do not contain day are skipped.
Yearly
Recur every every years on a specific month/day.
Impossible dates such as February 30 are rejected during construction.
Trait Implementations§
Source§impl Clone for ScheduleRule
impl Clone for ScheduleRule
Source§fn clone(&self) -> ScheduleRule
fn clone(&self) -> ScheduleRule
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more