1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! # cache-mod
//!
//! HIGH-PERFORMANCE IN-PROCESS CACHING
//!
//! Multiple eviction policies (LRU, LFU, TinyLFU, TTL, size-bounded). Async-safe,
//! lock-minimized internals. Typed key-value API. No external store dependency.
//!
//! # Status
//!
//! The public API surface is defined: the [`Cache`] trait, the [`CacheError`]
//! error type, and two reference cache implementations — [`LruCache`]
//! (Least-Recently-Used, 0.2.0) and [`LfuCache`] (Least-Frequently-Used,
//! 0.3.0). TinyLFU, TTL, and size-bounded eviction policies land in
//! subsequent minors. The API is not yet frozen — pin exact versions until 1.0.
//!
//! # Quick start
//!
//! ```
//! use cache_mod::{Cache, LruCache};
//!
//! let cache: LruCache<&'static str, u32> = LruCache::new(64).expect("capacity > 0");
//!
//! cache.insert("requests", 1);
//! cache.insert("errors", 0);
//!
//! assert_eq!(cache.get(&"requests"), Some(1));
//! assert_eq!(cache.len(), 2);
//! ```
//!
//! # License
//!
//! Dual-licensed under Apache-2.0 OR MIT.
pub use Cache;
pub use CacheError;
pub use LfuCache;
pub use LruCache;
/// Crate version string, populated by Cargo at build time.
pub const VERSION: &str = env!;