pub struct ManualClock { /* private fields */ }Expand description
A clock that moves only when told to; clones share it.
Implementations§
Source§impl ManualClock
impl ManualClock
Sourcepub fn timer(&self) -> ManualTimer
pub fn timer(&self) -> ManualTimer
The timer that fires as this clock moves.
Sourcepub fn set_monotonic(&self, at: MonoNs)
pub fn set_monotonic(&self, at: MonoNs)
Set time to at (never backwards: an earlier at leaves the clock where it is), waking
every due timer, earliest first.
Sourcepub fn pending_timers(&self) -> usize
pub fn pending_timers(&self) -> usize
Sleeps that have been polled and are not yet due.
Sourcepub fn next_deadline(&self) -> Option<MonoNs>
pub fn next_deadline(&self) -> Option<MonoNs>
The earliest pending sleep’s deadline, always later than now.
Trait Implementations§
Source§impl Clock for ManualClock
impl Clock for ManualClock
Source§fn monotonic_ns(&self) -> MonoNs
fn monotonic_ns(&self) -> MonoNs
Monotonic nanoseconds from the host’s origin.
Source§impl Clone for ManualClock
impl Clone for ManualClock
Auto Trait Implementations§
impl !RefUnwindSafe for ManualClock
impl !Send for ManualClock
impl !Sync for ManualClock
impl !UnwindSafe for ManualClock
impl Forget for ManualClock
impl Freeze for ManualClock
impl Move for ManualClock
impl Unpin for ManualClock
impl UnsafeUnpin for ManualClock
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