pub struct DelayTrigger { /* private fields */ }
Expand description
One-time delay trigger
Implementations§
Source§impl DelayTrigger
impl DelayTrigger
pub fn new(delay: Duration) -> Self
pub fn after_seconds(seconds: u64) -> Self
pub fn after_minutes(minutes: u64) -> Self
pub fn after_hours(hours: u64) -> Self
pub fn at_time(execution_time: SystemTime) -> Self
Sourcepub fn mark_executed(&mut self)
pub fn mark_executed(&mut self)
Mark as executed (used internally by scheduler)
Sourcepub fn is_executed(&self) -> bool
pub fn is_executed(&self) -> bool
Check if already executed
Trait Implementations§
Source§impl Clone for DelayTrigger
impl Clone for DelayTrigger
Source§fn clone(&self) -> DelayTrigger
fn clone(&self) -> DelayTrigger
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 DelayTrigger
impl Debug for DelayTrigger
Source§impl Trigger for DelayTrigger
impl Trigger for DelayTrigger
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 DelayTrigger
impl RefUnwindSafe for DelayTrigger
impl Send for DelayTrigger
impl Sync for DelayTrigger
impl Unpin for DelayTrigger
impl UnwindSafe for DelayTrigger
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