pub enum Schedule {
Every(u64),
Daily {
hour: u32,
minute: u32,
},
Weekly {
weekday: u32,
hour: u32,
minute: u32,
},
}Expand description
When a job fires.
Deliberately small: four shapes a person can hold in their head, and no cron syntax to
mis-remember. every 30m is an interval; the rest name a moment in local time.
Variants§
Every(u64)
Every N seconds, counted from the last start.
Daily
Weekly
weekday is 0 = Sunday, matching localtime’s tm_wday.
Implementations§
Source§impl Schedule
impl Schedule
pub fn parse(text: &str) -> Result<Schedule>
Sourcepub fn next_due(&self, after_ms: i64) -> i64
pub fn next_due(&self, after_ms: i64) -> i64
The first moment this schedule fires strictly after after_ms, in epoch milliseconds.
For an interval this is arithmetic. For a named moment it is a search in local time, which is why it can take up to eight days: a weekly job whose moment passed a minute ago is due next week, not now.
Trait Implementations§
impl Copy for Schedule
impl Eq for Schedule
impl StructuralPartialEq for Schedule
Auto Trait Implementations§
impl Forget for Schedule
impl Freeze for Schedule
impl Move for Schedule
impl RefUnwindSafe for Schedule
impl Send for Schedule
impl Sync for Schedule
impl Unpin for Schedule
impl UnsafeUnpin for Schedule
impl UnwindSafe for Schedule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.