pub struct ScheduleTrigger {
pub cron_expr: String,
pub timezone: String,
pub max_runs: Option<u32>,
}Expand description
Schedule trigger using cron expressions.
Fields§
§cron_expr: StringCron expression (e.g. “0 9 * * 1-5” for weekdays at 9am).
timezone: StringTimezone identifier (e.g. “UTC”, “America/New_York”).
max_runs: Option<u32>Maximum number of runs (None = unlimited).
Implementations§
Source§impl ScheduleTrigger
impl ScheduleTrigger
Sourcepub fn new(cron_expr: impl Into<String>, timezone: impl Into<String>) -> Self
pub fn new(cron_expr: impl Into<String>, timezone: impl Into<String>) -> Self
Create a new schedule trigger.
Sourcepub fn with_max_runs(self, max_runs: u32) -> Self
pub fn with_max_runs(self, max_runs: u32) -> Self
Set maximum runs.
Sourcepub fn next_fire_ms(&self, now_ms: u64) -> u64
pub fn next_fire_ms(&self, now_ms: u64) -> u64
Calculate next fire time in milliseconds.
Simplified implementation: parses HH:MM from cron expression
(fields: second minute hour day month weekday).
Returns the next fire time in ms from now_ms.
Trait Implementations§
Source§impl Clone for ScheduleTrigger
impl Clone for ScheduleTrigger
Source§fn clone(&self) -> ScheduleTrigger
fn clone(&self) -> ScheduleTrigger
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 ScheduleTrigger
impl RefUnwindSafe for ScheduleTrigger
impl Send for ScheduleTrigger
impl Sync for ScheduleTrigger
impl Unpin for ScheduleTrigger
impl UnsafeUnpin for ScheduleTrigger
impl UnwindSafe for ScheduleTrigger
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