Skip to main content

Module mock

Module mock 

Source

Structs§

AdvanceableTimer
A timer whose sleeps resolve only when MockClock::advance_and_fire is called. Pair with MockClock for deterministic time-travel tests.
FrozenClock
A clock that always returns the same instant. ~80% of test scenarios.
MockClock
A settable, advanceable clock for time-travel tests.

Functions§

frozen_at
Returns an Arc<dyn Clock> frozen at the given RFC 3339 string.
mock_pair
Returns a (Arc<MockClock>, Arc<AdvanceableTimer>) pair wired together.