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
//! Micro Moka is a predictable, safe-Rust cache library. Micro Moka is a fork
//! of [Mini Moka][mini-moka-git], stripped down to the bare essentials.
//!
//! Micro Moka provides an in-memory, non-thread-safe cache implementation for
//! single thread applications.
//!
//! A cache can be entry-bounded using SIEVE eviction or left unbounded through
//! the builder. Exact insertion always admits at nonzero capacity, while
//! scan-budgeted insertion may return a candidate to bound one admission attempt.
//!
//! [moka-git]: https://github.com/moka-rs/moka
//! [mini-moka-git]: https://github.com/moka-rs/mini-moka
//! [caffeine-git]: https://github.com/ben-manes/caffeine
//!
//! # Features
//!
//! - A cache can be bounded by the maximum number of entries.
//! - Maintains good hit rate by using the SIEVE eviction algorithm (NSDI 2024),
//! a lazy promotion, quick demotion algorithm.
//! - Offers both exact, always-admit insertion and scan-budgeted admission that
//! bounds per-attempt eviction-policy work and returns rejected candidates.
//! - Packs SIEVE's visited bit into the intrusive predecessor link to reduce
//! per-entry metadata without unsafe code.
//!
//! # Examples
//!
//! See the following document:
//!
//! - A not thread-safe, blocking cache for single threaded applications:
//! - [`unsync::Cache`][unsync-cache-struct]
//!
//! [unsync-cache-struct]: ./unsync/struct.Cache.html
//!
//! # Minimum Supported Rust Versions
//!
//! This crate's minimum supported Rust version (MSRV) is Rust 1.76.0.
//! MSRV will be updated conservatively, and increasing it is not considered a
//! semver-breaking change.
pub
pub use Policy;