pub struct Interval { /* private fields */ }Expand description
A stream of ticks a period apart; built by interval.
It is built on the runtime’s sleep_until and now, so a runtime’s paused
clock drives it.
Implementations§
Source§impl Interval
impl Interval
Sourcepub async fn tick(&mut self) -> Instant
pub async fn tick(&mut self) -> Instant
Wait for the next tick and return the deadline it was due at. Dropping the future before it completes loses nothing: the next call waits for the same tick.
Sourcepub fn set_missed_tick(&mut self, behaviour: MissedTick)
pub fn set_missed_tick(&mut self, behaviour: MissedTick)
Choose what to do about ticks that were missed.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Interval
impl !UnwindSafe for Interval
impl Freeze for Interval
impl Send for Interval
impl Sync for Interval
impl Unpin for Interval
impl UnsafeUnpin 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