Skip to main content

Module cache

Module cache 

Source
Expand description

TTL cache with LRU eviction for external guard verdicts.

TtlCache is a thread-safe bounded cache that stores values with a per-entry monotonic deadline. Entries evict either when their TTL expires (on access or on prune) or when the cache reaches its capacity (least recently used eviction).

The cache uses a Clock abstraction for the “now” timestamp so that tests can drive time via [tokio::time::pause] + advance without any wall-clock sleep.

Structs§

TokioClock
Default Clock implementation backed by Tokio’s pausable timer.
TtlCache
Thread-safe TTL cache with LRU eviction.

Traits§

Clock
Clock abstraction used by the cache and other resilience primitives.