Struct futures_intrusive::timer::MockClock
source · 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 RefUnwindSafe for MockClock
impl Send for MockClock
impl Sync for MockClock
impl Unpin for MockClock
impl UnwindSafe for MockClock
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more