Module ttl

Source
Expand description

Time-related primitives: Clock trait, Timestamp type, and Duration parsing.

Structs§

MockClock
Test clock — advanceable by the test.
SystemClock
Production clock backed by the OS.
TtlParseError
Error from parse_duration.

Traits§

Clock
A pluggable time source.

Functions§

format_duration
Format a Duration as a humantime string (e.g. 5m, 2h).
parse_duration
Parse a humantime string into a Duration.

Type Aliases§

Timestamp
Unix-epoch seconds. Newtype to avoid mixing with other integers.