Skip to main content

Trigger

Trait Trigger 

Source
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§

Source

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

Check if this trigger will fire again

Source

fn description(&self) -> String

Get trigger description

Provided Methods§

Source

fn should_trigger_now(&self, now: SystemTime) -> bool

Check if this trigger should fire now (new method for delay support)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§