pub struct Interval { /* private fields */ }Expand description
A stream representing notifications at fixed interval
Intervals are created through the Interval::new or
Interval::new_at methods indicating when a first notification
should be triggered and when it will be repeated.
Note that intervals are not intended for high resolution timers, but rather they will likely fire some granularity after the exact instant that they’re otherwise indicated to fire at.
Implementations§
Source§impl Interval
impl Interval
pub async fn tick(&mut self) -> Instant
pub fn poll_tick(&mut self, cx: &mut Context<'_>) -> Poll<Instant>
pub fn reset(&mut self)
Sourcepub fn missed_tick_behavior(&self) -> MissedTickBehavior
pub fn missed_tick_behavior(&self) -> MissedTickBehavior
Returns the MissedTickBehavior strategy currently being used.
Sourcepub fn set_missed_tick_behavior(&mut self, behavior: MissedTickBehavior)
pub fn set_missed_tick_behavior(&mut self, behavior: MissedTickBehavior)
Sets the MissedTickBehavior strategy that should be used.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Interval
impl !RefUnwindSafe for Interval
impl Send for Interval
impl Sync for Interval
impl Unpin 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