pub struct Interval { /* private fields */ }Expand description
Periodic timer that ticks at a fixed interval.
Created via crate::context::interval. Call .tick().await to
wait for the next tick.
Implementations§
Source§impl Interval
impl Interval
Sourcepub fn reset_at(&mut self, deadline: Instant)
pub fn reset_at(&mut self, deadline: Instant)
Reset the interval to fire at a specific instant.
Sourcepub fn missed_tick_behavior(&self) -> MissedTickBehavior
pub fn missed_tick_behavior(&self) -> MissedTickBehavior
Get the current missed tick behavior.
Sourcepub fn set_missed_tick_behavior(&mut self, behavior: MissedTickBehavior)
pub fn set_missed_tick_behavior(&mut self, behavior: MissedTickBehavior)
Set the missed tick behavior.
Auto Trait Implementations§
impl Freeze for Interval
impl !RefUnwindSafe for Interval
impl !Send for Interval
impl !Sync for Interval
impl Unpin for Interval
impl UnsafeUnpin for Interval
impl !UnwindSafe for Interval
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