cuckoo-clock
Cuckoo probabilistic filter with TTL, LRU, and counter features.
Implementation of cuckoo filter per "Cuckoo Filter: Better Than Bloom" by Bin Fan, Dave Andersen and Michael Kaminsky, with the addition of TTL, LRU and generic counter associated with stored buckets.
Example usage
use ;
let filter = new_random;
// In this case, we use `insert_if_not_present` to ensure no duplicates, because we care about
// the counter
// None returned from insertion means no entry was evicted
assert!;
assert!;
// Insertion must have been successful
assert!;
// Counter should be 4 now.
// We have accessed this item 3 times, but `get_associated_data` also counts as an access.
assert_eq!;