pub struct MockClock { /* private fields */ }Expand description
Mock clock for use with tokio-timer futures.
A mock timer that is able to advance and wake after a certain duration.
Implementations§
Source§impl MockClock
impl MockClock
Sourcepub fn with_duration(duration: Duration) -> Self
pub fn with_duration(duration: Duration) -> Self
Create a MockClock with its current time at a duration from now
This will create a clock with Instant::now() + duration as the current time.
Sourcepub fn with_instant(instant: Instant) -> Self
pub fn with_instant(instant: Instant) -> Self
Create a MockClock that sets its current time as the Instant provided.
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