pub enum Offset {
After(Duration),
Asap,
}Expand description
An offset from the current event.
This is to be used with ReactionCtx::schedule.
Variants§
After(Duration)
Specify that the trigger will fire at least after the provided duration.
If the duration is zero (eg Asap), it does not mean that the trigger will fire right away. For actions, the action’s inherent minimum delay must be taken into account, and even with a zero minimal delay, a delay of one microstep is applied.
You can use the after!() macro, instead of using this directly. For instance:
assert_eq!(after!(15 ms), After(Duration::from_millis(15)));Asap
Specify that the trigger will fire as soon as possible. This does not mean that the action will trigger right away. The action’s inherent minimum delay must be taken into account, and even with a zero minimal delay, a delay of one microstep is applied. This is equivalent to
assert_eq!(Asap, After(Duration::ZERO));Trait Implementations§
impl Copy for Offset
impl Eq for Offset
Auto Trait Implementations§
impl Freeze for Offset
impl RefUnwindSafe for Offset
impl Send for Offset
impl Sync for Offset
impl Unpin for Offset
impl UnwindSafe for Offset
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.