Struct quanta::Mock [−][src]
pub struct Mock { /* fields omitted */ }
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
Increments the time by the given amount.
Decrements the time by the given amount.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Mock
impl UnwindSafe for Mock
Blanket Implementations
Mutably borrows from an owned value. Read more