pub struct MockClock { /* private fields */ }
Expand description
A Clock
which can be set to arbitrary timestamps for testing purposes.
It can be used in a test case as demonstrated in the following example:
use futures_intrusive::timer::MockClock;
static TEST_CLOCK: MockClock = MockClock::new();
TEST_CLOCK.set_time(2300); // Set the current time
let timer = TimerService::new(&TEST_CLOCK);
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 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