#lfu #cache #custom #eviction

freqache

A thread-safe LFU cache with iterator

7 unstable releases (3 breaking)

0.4.1 Sep 21, 2021
0.4.0 Sep 18, 2021
0.3.0 Sep 15, 2021
0.2.5 Sep 15, 2021
0.1.0 Apr 20, 2021

#32 in Caching

46 downloads per month
Used in 2 crates (via freqfs)

Apache-2.0

12KB
253 lines

freqache

A thread-safe Rust LFU cache which supports iteration.

Example:

use freqache::LFUCache;

let mut cache = LFUCache::new();
cache.insert("key1");
cache.insert("key2");
cache.insert("key3");
cache.insert("key2");

for key in cache.iter() {
    println!("key: {}", key);
}

lib.rs:

A thread-safe least-frequently-used cache which provides an Iterator.

Example:

use freqache::LFUCache;

let mut cache = LFUCache::new();
cache.insert("key1");
cache.insert("key2");
cache.insert("key3");
cache.insert("key2");

for key in cache.iter() {
    println!("key: {}", key);
}

No runtime deps