pub struct TestClock { /* private fields */ }Expand description
Manually controllable time source for deterministic tests.
Advance time with set or advance_secs.
Implementations§
Source§impl TestClock
impl TestClock
Sourcepub fn advance_secs(&mut self, secs: i64)
pub fn advance_secs(&mut self, secs: i64)
Advance the clock by the given number of seconds.
Sourcepub fn advance_micros(&mut self, us: i64)
pub fn advance_micros(&mut self, us: i64)
Advance the clock by the given number of microseconds.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TestClock
impl RefUnwindSafe for TestClock
impl Send for TestClock
impl Sync for TestClock
impl Unpin for TestClock
impl UnsafeUnpin for TestClock
impl UnwindSafe for TestClock
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