pub struct Timer {
pub offset: Duration,
pub period: Duration,
/* private fields */
}Expand description
A timer is conceptually a logical action that may re-schedule itself periodically.
For periodic timers, a reaction is synthesized which reschedules the timer.
Fields§
§offset: DurationMinimal duration after the start of the program after which the timer starts to trigger.
period: DurationPeriod between events emitted by this timer. A period of zero means that the timer will trigger exactly once after the specified offset.
Implementations§
Trait Implementations§
Source§impl ReactionTrigger<()> for Timer
impl ReactionTrigger<()> for Timer
Source§fn is_present(&self, now: &EventTag, _start: &Instant) -> bool
fn is_present(&self, now: &EventTag, _start: &Instant) -> bool
Returns whether the trigger is present, given that
the current logical time is the parameter.
Source§fn get_value(&self, now: &EventTag, start: &Instant) -> Option<()>
fn get_value(&self, now: &EventTag, start: &Instant) -> Option<()>
Copies the value out, if it is present. Whether a value
is present is not in general the same thing as whether this trigger
Self::is_present. See crate::ReactionCtx::get.
Auto Trait Implementations§
impl Freeze for Timer
impl RefUnwindSafe for Timer
impl Send for Timer
impl Sync for Timer
impl Unpin for Timer
impl UnwindSafe for Timer
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