pub struct Cron { /* private fields */ }Expand description
A parsed cron expression.
Implementations§
Source§impl Cron
impl Cron
Sourcepub fn expression(&self) -> &str
pub fn expression(&self) -> &str
The normalised expression this was parsed from.
Sourcepub fn matches(&self, at: &DateTime) -> bool
pub fn matches(&self, at: &DateTime) -> bool
Whether a given moment is one this expression selects.
Seconds are ignored: cron’s resolution is a minute.
Sourcepub fn next_after(&self, after: i64) -> Option<i64>
pub fn next_after(&self, after: i64) -> Option<i64>
The first matching moment strictly after after, in epoch seconds.
None when the expression describes a date that never occurs — 0 0 30 2 *, the thirtieth of February. Answering rather than looping forever
is the whole reason this returns an Option.
Trait Implementations§
impl Eq for Cron
impl StructuralPartialEq for Cron
Auto Trait Implementations§
impl Freeze for Cron
impl RefUnwindSafe for Cron
impl Send for Cron
impl Sync for Cron
impl Unpin for Cron
impl UnsafeUnpin for Cron
impl UnwindSafe for Cron
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