pub struct Mock { /* private fields */ }
Expand description
Controllable time source for use in tests.
A mocked clock allows the caller to adjust the given time backwards and forwards by whatever
amount they choose. While Clock
promises monotonic values for normal readings,
when running in mocked mode, these guarantees do not apply: the given Clock
/Mock
pair are
directly coupled.
This can be useful for not only testing code that depends on the passage of time, but also for testing that code can handle large shifts in time.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mock
impl RefUnwindSafe for Mock
impl Send for Mock
impl Sync for Mock
impl Unpin for Mock
impl UnwindSafe for Mock
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)