pub struct CronSchedule { /* private fields */ }Expand description
A parsed 6-field cron expression: second minute hour day-of-month month day-of-week.
Field ranges:
- second: 0–59
- minute: 0–59
- hour: 0–23
- day: 1–31
- month: 1–12
- weekday: 0–6 (0 = Sunday)
Implementations§
Source§impl CronSchedule
impl CronSchedule
Sourcepub fn parse(expr: &str) -> Result<Self, String>
pub fn parse(expr: &str) -> Result<Self, String>
Parse a 6-field cron expression.
Each field supports *, exact values, */step, N-M ranges, and
comma-separated combinations, e.g. 0,15,30,45 * * * * *.
Sourcepub fn matches_now(&self) -> bool
pub fn matches_now(&self) -> bool
Returns true if the current wall-clock time (UTC) matches this schedule.
Sourcepub fn matches_epoch(&self, epoch_secs: u64) -> bool
pub fn matches_epoch(&self, epoch_secs: u64) -> bool
Returns true if the given Unix timestamp (seconds since epoch, UTC) matches.
Trait Implementations§
Source§impl Clone for CronSchedule
impl Clone for CronSchedule
Source§fn clone(&self) -> CronSchedule
fn clone(&self) -> CronSchedule
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CronSchedule
impl RefUnwindSafe for CronSchedule
impl Send for CronSchedule
impl Sync for CronSchedule
impl Unpin for CronSchedule
impl UnsafeUnpin for CronSchedule
impl UnwindSafe for CronSchedule
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