evictor 0.7.2

A library for generic caching with configurable eviction policies.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::num::NonZeroUsize;

use evictor::Lfu;

fn main() {
    let mut cache = Lfu::<i32, i32>::new(NonZeroUsize::new(300000).unwrap());
    for _ in 0..3000 {
        for i in 0..100000 {
            cache.insert(i, i);
        }
        for i in 0..100000 {
            std::hint::black_box(cache.remove(std::hint::black_box(&i)));
        }
    }
    std::hint::black_box(cache);
}