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
// Copyright (c) 2026, Salesforce, Inc.,
// All rights reserved.
// For full license text, see the LICENSE.txt file
//! Cache Library
//!
//! A caching library that provides a simple [`Cache`] trait with multiple eviction strategies.
//! It is designed to be injected and configured during the policy
//! configuration phase and supports both policy-isolated and shared caches across policies.
//!
//! This library provides data storage functionality with support for:
//!
//! - FIFO eviction strategy (First-In-First-Out)
//! - LRU eviction strategy (Least Recently Used)
//! - Builder pattern via [`builder::CacheBuilder`] and [`builder::CacheBuilderInstance`]
//! - Policy-isolated caches by default; opt-in shared caches via [`builder::CacheBuilderInstance::shared()`]
//! - Configurable maximum entries per cache
//!
// The user is agnostic to the implementation of the cache since the builder returns a trait object.
// this crate should have been pub(crate), too late to change it now, we just hide it from the doc.
use CacheError;
// Re-export the eviction strategy types for easy access
pub use ;
/// Represents a cache. It stores each element as a new entry.