pub struct CronSchedule { /* private fields */ }Expand description
Defines cron expression used by schedule.
It uses seven items expression: seconds, minutes, hours, days (month), months, days (week), years. Seconds and years can be omitted: if an expression has five items, it runs at second 0 every year; if it has six items - the first item defines seconds.
For more information about valid cron expressions, please refer to cron-lite crate documentation.
It’s possible to use cron expression with timezone if tz feature is enabled.
§Examples
use sacs::task::CronSchedule;
let every_minute_1: CronSchedule = "* * * * *".try_into().unwrap();
let every_minute_2: CronSchedule = "0 * * * * *".try_into().unwrap();
assert_eq!(every_minute_1, every_minute_2);
let every_5th_second: CronSchedule = "*/5 * * * * *".try_into().unwrap();
let every_business_hour: CronSchedule = "0 9-18 * * Mon-Fri".try_into().unwrap();
// Every even year every 10 seconds at 9:00-9:01am on January 1st.
let something_senseless: CronSchedule = "*/10 0 9 1 1 ? */2".try_into().unwrap();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 moreSource§impl Debug for CronSchedule
impl Debug for CronSchedule
Source§impl Display for CronSchedule
impl Display for CronSchedule
impl Eq for CronSchedule
Source§impl PartialEq for CronSchedule
impl PartialEq for CronSchedule
Source§fn eq(&self, other: &CronSchedule) -> bool
fn eq(&self, other: &CronSchedule) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CronSchedule
Source§impl TryFrom<&String> for CronSchedule
impl TryFrom<&String> for CronSchedule
Source§impl TryFrom<&str> for CronSchedule
impl TryFrom<&str> for CronSchedule
Auto 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