Crates.io | fbr_cache |
lib.rs | fbr_cache |
version | 0.1.1 |
source | src |
created_at | 2022-07-03 20:20:31.975487 |
updated_at | 2022-07-04 05:57:57.21116 |
description | A cache with frequency-based replacement strategy |
homepage | |
repository | https://github.com/rkuhn/fbr_cache |
max_upload_size | |
id | 618542 |
size | 20,931 |
This crate implements a cache with frequency-based replacement strategy as described in the paper “Data Cache Management Using Frequency-Based Replacement” by John T. Robinson and Murthy V. Devarakonda, published in ACM SIGMETRICS 1990.
The configuration parameters of such a cache are:
Example:
use fbr_cache::FbrCache;
let mut cache = FbrCache::new(1000);
cache.put(1, "hello");
cache.put(2, "world");
assert_eq!(cache.get(&1), Some(&"hello"));
assert_eq!(cache.len(), 2);