Crate lru_time_cache [−] [src]
lru cache limited via size or time
This container allows time or size to be the limiting factor for any key/value types.
Use
To use as size based LruCache
let mut lru_cache = LruCache::<usize, usize>::with_capacity(size);
Or as time based LruCache
let time_to_live = chrono::duration::Duration::milliseconds(100);
let mut lru_cache = LruCache::<usize, usize>::with_expiry_duration(time_to_live);
Or as time or size limited cache
let size = 10usize; let time_to_live = chrono::duration::Duration::milliseconds(100); let mut lru_cache = LruCache::<usize, usize>::with_expiry_duration_and_capacity(time_to_live, size);
Structs
LruCache |
Provides a Last Recently Used caching algorithm in a container which may be limited by size or time, reordered to most recently seen. |
OccupiedEntry |
An occupied Entry. |
VacantEntry |
A vacant Entry. |
Enums
Entry |
A view into a single entry in a lru_cache, which may either be vacant or occupied. |