pub trait Trigger: Send + Sync {
// Required methods
fn next_execution_time(&self, after: SystemTime) -> Option<SystemTime>;
fn has_next(&self, after: SystemTime) -> bool;
fn description(&self) -> String;
// Provided method
fn should_trigger_now(&self, now: SystemTime) -> bool { ... }
}
Expand description
Trigger trait for determining when tasks should run
Required Methods§
Sourcefn 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
Sourcefn has_next(&self, after: SystemTime) -> bool
fn has_next(&self, after: SystemTime) -> bool
Check if this trigger will fire again
Sourcefn description(&self) -> String
fn description(&self) -> String
Get trigger description
Provided Methods§
Sourcefn 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)