pub struct Interval { /* private fields */ }Expand description
Ticks at a fixed period. Made by interval and interval_at.
Implementations§
Source§impl Interval
impl Interval
Sourcepub async fn tick(&mut self) -> Instant
pub async fn tick(&mut self) -> Instant
Waits for the next tick and returns the instant it was due at.
Sourcepub fn poll_tick(&mut self, cx: &mut Context<'_>) -> Poll<Instant>
pub fn poll_tick(&mut self, cx: &mut Context<'_>) -> Poll<Instant>
Polls for the next tick; see tick.
Sourcepub fn missed_tick_behavior(&self) -> MissedTickBehavior
pub fn missed_tick_behavior(&self) -> MissedTickBehavior
What happens to missed ticks.
Sourcepub fn set_missed_tick_behavior(&mut self, behavior: MissedTickBehavior)
pub fn set_missed_tick_behavior(&mut self, behavior: MissedTickBehavior)
Sets what happens to missed ticks.
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