pub struct ManualClock { /* private fields */ }Expand description
A manually advanced clock, Send + Sync and cheaply cloneable.
All clones share one offset. now() returns base + elapsed, where
base is fixed at construction and elapsed only changes through
advance. Tests move virtual time forward; no
wall-clock waiting is ever involved.
Note: advancing the clock does NOT run any scheduler work by itself. Virtual time only moves the timestamp provider; tests must still drain their scheduler explicitly after each advance before asserting.
Implementations§
Trait Implementations§
Source§impl Clone for ManualClock
impl Clone for ManualClock
Source§impl Debug for ManualClock
impl Debug for ManualClock
Auto Trait Implementations§
impl Forget for ManualClock
impl Freeze for ManualClock
impl RefUnwindSafe for ManualClock
impl Send for ManualClock
impl Sync for ManualClock
impl Unpin for ManualClock
impl UnsafeUnpin for ManualClock
impl UnwindSafe 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