Packages / rupm

rs-collections-lru 0.1.0

A least-recently-used cache with O(1) get and put

Install

cargo add rs-collections-lru --registry rupm

In Ruststudio: Packages, search for rs-collections-lru, Install.

Owner: Rust Studio. Licence: MIT OR Apache-2.0. Total downloads: 0. Published 2026-11-23.

Versions

README

# rs-collections-lru

A least-recently-used cache with O(1) get and put

Add it with `rupm add rs-collections-lru` (or `cargo add rs-collections-lru --registry rupm`).

```rust
let mut c = rs_collections_lru::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());
```