pub struct CronExpression { /* private fields */ }Expand description
A structure representing a cron expression with advanced features like timezones, exclusion rules, and jitter.
Use CronExpression::builder() to create a new instance fluently.
Implementations§
Source§impl CronExpression
impl CronExpression
Sourcepub fn with_timezone(self, tz: Tz) -> Self
pub fn with_timezone(self, tz: Tz) -> Self
Set a fixed timezone for this schedule.
Sourcepub fn with_jitter(self, max_jitter: Duration) -> Self
pub fn with_jitter(self, max_jitter: Duration) -> Self
Adds a random jitter to the execution time.
The job will run at the scheduled time plus a random duration
between 0 and max_jitter.
Sourcepub fn exclude_date(self, date: NaiveDate) -> Self
pub fn exclude_date(self, date: NaiveDate) -> Self
Exclude specific dates from the schedule.
Sourcepub fn exclude_dates(self, dates: Vec<NaiveDate>) -> Self
pub fn exclude_dates(self, dates: Vec<NaiveDate>) -> Self
Exclude a list of dates.
pub fn hourly(self) -> Self
pub fn daily(self) -> Self
pub fn weekly(self) -> Self
pub fn monthly(self) -> Self
pub fn second(self, second: u32) -> Self
pub fn every_second(self) -> Self
pub fn seconds_interval(self, interval: u32) -> Self
pub fn minute(self, minute: u32) -> Self
pub fn every_minute(self) -> Self
pub fn minutes_interval(self, interval: u32) -> Self
pub fn hour(self, hour: u32) -> Self
pub fn hours_list(self, hours: &[u32]) -> Self
pub fn every_hour(self) -> Self
pub fn hours_range(self, start: u32, end: u32) -> Self
pub fn day_of_month(self, day: u32) -> Self
pub fn month(self, month: Month) -> Self
pub fn day_of_week(self, day: Weekday) -> Self
pub fn weekdays_only(self) -> Self
pub fn weekends_only(self) -> Self
pub fn sundays_only(self) -> Self
pub fn mondays_only(self) -> Self
pub fn tuesdays_only(self) -> Self
pub fn wednesdays_only(self) -> Self
pub fn thursdays_only(self) -> Self
pub fn fridays_only(self) -> Self
pub fn saturdays_only(self) -> Self
pub fn quarterly(self) -> Self
pub fn year(self, year: u32) -> Self
pub fn build(&self) -> String
pub fn to_validated(&self) -> CronResult<ValidatedSchedule>
Trait Implementations§
Source§impl Clone for CronExpression
impl Clone for CronExpression
Source§fn clone(&self) -> CronExpression
fn clone(&self) -> CronExpression
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 CronExpression
impl Debug for CronExpression
Source§impl Default for CronExpression
impl Default for CronExpression
Source§impl<'de> Deserialize<'de> for CronExpression
impl<'de> Deserialize<'de> for CronExpression
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for CronExpression
impl Display for CronExpression
Source§impl Schedule for CronExpression
impl Schedule for CronExpression
Auto Trait Implementations§
impl Freeze for CronExpression
impl RefUnwindSafe for CronExpression
impl Send for CronExpression
impl Sync for CronExpression
impl Unpin for CronExpression
impl UnsafeUnpin for CronExpression
impl UnwindSafe for CronExpression
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