Skip to content

mattusifer/lfu_rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lfu_rs

An LFU cache for Rust. This is an implementation of the algorithm described in this paper.

Build Status

Usage

The LFUCache struct is similar to a typical HashMap.

// Initialize cache with size 10
let mut cache: LFUCache<K, V> = LFUCache::new(10);

// Insertion
// Returns the old value if this key already existed
cache.insert(K, V) // -> Option<V>

// Retrieval
myValue = c.get(&K) // -> Option<&V>

// Removal
c.remove(&K) // Option<V>

Running tests

$ cargo test --all

About

An LFU cache for Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages