pub struct Interval<CLOCK: Timer> { /* private fields */ }
Expand description
A repeating delay with a fixed start and fixed segment duration.
Implementations§
Source§impl<CLOCK: Timer> Interval<CLOCK>
impl<CLOCK: Timer> Interval<CLOCK>
Sourcepub fn new(duration: CLOCK::Duration, timer: &AsyncTimer<CLOCK>) -> Self
pub fn new(duration: CLOCK::Duration, timer: &AsyncTimer<CLOCK>) -> Self
Create a new interval starting now.
Awaiting this new Interval will yield for the first time after now + duration
.
Sourcepub fn wait<'a>(&mut self, timer: &'a AsyncTimer<CLOCK>) -> impl Future + 'a
pub fn wait<'a>(&mut self, timer: &'a AsyncTimer<CLOCK>) -> impl Future + 'a
Await until some time after the end of the next interval segment.
Note: if an interval segment has already completely passed it will return immediately without yielding.
Auto Trait Implementations§
impl<CLOCK> Freeze for Interval<CLOCK>
impl<CLOCK> RefUnwindSafe for Interval<CLOCK>
impl<CLOCK> Send for Interval<CLOCK>
impl<CLOCK> Sync for Interval<CLOCK>
impl<CLOCK> Unpin for Interval<CLOCK>
impl<CLOCK> UnwindSafe for Interval<CLOCK>
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