Struct mock_instant::MockClock
source · pub struct MockClock;Expand description
A Mock clock
This uses thread local state to have a deterministic clock.
Implementations§
source§impl MockClock
impl MockClock
sourcepub fn set_system_time(time: Duration)
pub fn set_system_time(time: Duration)
Set the internal SystemTime clock to this ‘Duration’
sourcepub fn advance_system_time(time: Duration)
pub fn advance_system_time(time: Duration)
Advance the internal SystemTime clock by this ‘Duration’
sourcepub fn system_time() -> Duration
pub fn system_time() -> Duration
Get the current SystemTime duration
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for MockClock
impl Send for MockClock
impl Sync for MockClock
impl Unpin 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