cache
Caches and stores: entries that expire with a passed-in clock (ExpiringMap), and a
capacity-bounded map that evicts by recency instead (LruCache). Neither ever reads a
clock or the system allocator’s notion of “recent” behind the caller’s back.
Install
Section titled “Install”Cargo feature cache (enabled by default). To compile only this module:
or in Cargo.toml:
Import path: helpers4::cache.
| Item | What it does |
|---|---|
ExpiringMap | A map whose entries expire, with the clock passed in by the caller. |
ExpiringSet | A set whose members expire: an ExpiringMap without values. |
LruCache | A map bounded to at most capacity entries: once full, inserting a new key evicts the least recently used one. |
