Expand description
Time sources for rate limiters.
The time sources contained in this module allow the rate limiter to be (optionally) independent of std, and additionally allow mocking the passage of time.
You can supply a custom time source by implementing both Reference
and Clock
for your own types, and by implementing Add<Nanos>
for
your Reference
type:
Structs§
- Fake
Relative Clock - 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.
- Monotonic
Clock - The monotonic clock implemented by
Instant
.