Skip to main content

Module clock

Module clock 

Source
Expand description

Time sources for rate limiters.

Custom time sources implement Reference, Clock, and Add<Nanos>. This supports deterministic tests without coupling rate-limiting decisions to wall-clock time.

Structs§

FakeRelativeClock
A mock implementation of a clock. All it does is keep track of what “now” is (relative to some point meaningful to the program), and returns that.
MonotonicClock
The monotonic clock implemented by Instant.

Traits§

Clock
A time source used by rate limiters.
Reference
A measurement from a clock.