[][src]Module governor::clock

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.

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.

QuantaClock

A clock using the default quanta::Clock structure.

QuantaInstant

A nanosecond-scale opaque instant (already scaled to reference time) returned from a QuantaClock.

QuantaUpkeepClock

A clock using the default quanta::Clock structure and an upkeep thread.

SystemClock

The non-monotonic clock implemented by SystemTime.

Traits

Clock

A time source used by rate limiters.

ReasonablyRealtime

Identifies clocks that run similarly to the monotonic realtime clock.

Reference

A measurement from a clock.

Type Definitions

DefaultClock

The default clock using quanta for extremely fast timekeeping (at a 100ns resolution).