pub struct CronTrigger { /* private fields */ }
Expand description
Cron-based trigger
Implementations§
Source§impl CronTrigger
impl CronTrigger
pub fn new(expression: impl Into<String>) -> Result<Self, SchedulerError>
Sourcepub fn every_minute() -> Result<Self, SchedulerError>
pub fn every_minute() -> Result<Self, SchedulerError>
Create a trigger that fires every minute
Sourcepub fn hourly() -> Result<Self, SchedulerError>
pub fn hourly() -> Result<Self, SchedulerError>
Create a trigger that fires every hour at minute 0
Sourcepub fn daily() -> Result<Self, SchedulerError>
pub fn daily() -> Result<Self, SchedulerError>
Create a trigger that fires daily at midnight
Sourcepub fn weekly() -> Result<Self, SchedulerError>
pub fn weekly() -> Result<Self, SchedulerError>
Create a trigger that fires weekly on Sunday at midnight
Sourcepub fn monthly() -> Result<Self, SchedulerError>
pub fn monthly() -> Result<Self, SchedulerError>
Create a trigger that fires monthly on the 1st at midnight
Trait Implementations§
Source§impl Clone for CronTrigger
impl Clone for CronTrigger
Source§fn clone(&self) -> CronTrigger
fn clone(&self) -> CronTrigger
Returns a duplicate of the value. Read more
1.0.0 · 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 CronTrigger
impl Debug for CronTrigger
Source§impl Trigger for CronTrigger
impl Trigger for CronTrigger
Source§fn next_execution_time(&self, after: SystemTime) -> Option<SystemTime>
fn next_execution_time(&self, after: SystemTime) -> Option<SystemTime>
Get the next execution time after the given time
Source§fn has_next(&self, after: SystemTime) -> bool
fn has_next(&self, after: SystemTime) -> bool
Check if this trigger will fire again
Source§fn description(&self) -> String
fn description(&self) -> String
Get trigger description
Source§fn should_trigger_now(&self, now: SystemTime) -> bool
fn should_trigger_now(&self, now: SystemTime) -> bool
Check if this trigger should fire now (new method for delay support)
Auto Trait Implementations§
impl Freeze for CronTrigger
impl RefUnwindSafe for CronTrigger
impl Send for CronTrigger
impl Sync for CronTrigger
impl Unpin for CronTrigger
impl UnwindSafe for CronTrigger
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