pub struct MockClock { /* private fields */ }Expand description
Test clock: a manually-advanced nanosecond counter.
MockClock is a cloneable handle over a shared counter — clone it, hand one
clone to ExecutorBuilder::clock and keep
the other to drive time from the test (or from inside a task body). Both
clones observe the same counter.
Advancing the clock from inside a cyclic task body is the idiomatic pattern:
the body “spends” a precise number of nanoseconds, which the telemetry fold
then reads back as the cycle’s took (and, across cycles, as the measured
period feeding jitter and lateness).
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MockClock
impl RefUnwindSafe for MockClock
impl Send for MockClock
impl Sync for MockClock
impl Unpin for MockClock
impl UnsafeUnpin for MockClock
impl UnwindSafe for MockClock
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