Expand description
Time abstractions.
Cache logic must never read the wall clock directly (it would be untestable
and non-deterministic). Instead, every timestamp flows from an injected
Clock. This mirrors FusionCache’s use of DateTimeOffset.UtcNow.UtcTicks
while keeping the domain pure: see the “Time” rule in the project guidelines.
Two distinct notions of time exist in a hybrid cache:
Structs§
- Manual
Clock - A manually-controlled clock for tests.
- System
Clock - The real system clock, backed by
SystemTime. - Timestamp
- A point in time, measured in 100-nanosecond ticks since the Unix epoch.
Enums§
Constants§
- TICKS_
PER_ SECOND - Number of 100-nanosecond ticks in one second.
Traits§
- Clock
- Source of the current time.
Functions§
- duration_
to_ ticks - Converts a
Durationto 100ns ticks, saturating on overflow. - ticks_
to_ duration - Converts a non-negative tick count to a
Duration.