lru-tools 0.1.0
A least-recently-used cache with O(1) get and put
Install
cargo add lru-tools --registry rupm
In Ruststudio: Packages, search for lru-tools, Install.
Owner: Rust Studio. Licence: MIT OR Apache-2.0. Total downloads: 0. Published 2026-11-22.
Versions
- 0.1.0 2026-11-22
README
# lru-tools
A least-recently-used cache with O(1) get and put
Add it with `rupm add lru-tools` (or `cargo add lru-tools --registry rupm`).
```rust
let mut c = lru_tools::LruCache::new(2);
c.put("a", 1);
c.put("b", 2);
c.get(&"a");
c.put("c", 3); // evicts "b"
assert!(c.get(&"b").is_none());
```