pub struct ClockDriver { /* private fields */ }Expand description
Drives timer advancement for the clock.
The ClockDriver is responsible for advancing and firing timers associated with
the clock. The runtime must call ClockDriver::advance_timers periodically to
ensure timers fire at the correct time.
In thread-per-core architectures, each thread owns its own ClockDriver that advances
only the timers registered on that thread’s Clock. See the
runtime module for the setup pattern.
Implementations§
Source§impl ClockDriver
impl ClockDriver
Sourcepub fn advance_timers(
&mut self,
now: Instant,
) -> Result<Option<Instant>, ClockGone>
pub fn advance_timers( &mut self, now: Instant, ) -> Result<Option<Instant>, ClockGone>
Advances and fires all timers scheduled to execute by the given time.
This method processes all timers scheduled to fire at or before the
specified now time, waking their associated tasks.
§Errors
Returns Err(ClockGone) if the all clocks are gone, all timers are fired and
advancing the clock is no longer necessary.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClockDriver
impl !RefUnwindSafe for ClockDriver
impl Send for ClockDriver
impl Sync for ClockDriver
impl Unpin for ClockDriver
impl UnsafeUnpin for ClockDriver
impl !UnwindSafe for ClockDriver
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