Status
Active development. Foundation milestone (0.2.0) shipped. On the path to 1.0.
The public API is not yet frozen. Pin specific versions; expect additive (and occasionally breaking) changes pre-1.0.
What it does
High-performance in-process caching with multiple eviction policies (LRU, LFU, TinyLFU, TTL, size-bounded). Async-safe, lock-minimized internals. Typed key-value API. No dependency on any external store.
Quick start
[]
= "0.3"
use ;
// LRU — evicts the least-recently-accessed entry on overflow.
let lru: = new.expect;
lru.insert;
assert_eq!;
// LFU — evicts the lowest-counter entry on overflow.
let lfu: = new.expect;
lfu.insert;
assert_eq!;
What's shipped
Cache<K, V>trait — the common read / write / evict contract.LruCache<K, V>— bounded, thread-safe Least-Recently-Used cache.LfuCache<K, V>— bounded, thread-safe Least-Frequently-Used cache.CacheError— error type returned by constructors.
TinyLFU, TTL, and size-bounded variants land in subsequent minors. The
lock-free, arena-backed rewrites of LruCache and LfuCache land in 0.5.0
without changing the public surface.
Standards
- REPS governs every decision. See REPS.md.
- MSRV: Rust 1.75.
- Edition: 2024.
- Cross-platform: Linux, macOS, Windows.
License
Dual-licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.