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
//! Policy traits and implementations for controlling composition backend behavior.
//!
//! This module defines the strategy patterns for read, write, refill, and delete operations
//! across multiple cache layers. Policies encapsulate the execution logic, allowing
//! different strategies to be implemented and composed.
//!
//! # Available Policies
//!
//! ## Read Policies
//! - [`SequentialReadPolicy`] - Try L1 first, then L2 on miss (default)
//! - [`RaceReadPolicy`] - Race L1 and L2, return first hit
//! - [`ParallelReadPolicy`] - Query both in parallel, prefer fresher by TTL
//!
//! ## Write Policies
//! - [`SequentialWritePolicy`] - Write to L1, then L2 (write-through)
//! - [`OptimisticParallelWritePolicy`] - Write to both in parallel (join), succeed if ≥1 succeeds
//! - [`RaceWritePolicy`] - Race both writes, return on first success, background the other
//!
//! ## Refill Policies
//! - [`RefillPolicy::Always`] - Always populate L1 after L2 hit
//! - [`RefillPolicy::Never`] - Never populate L1 after L2 hit (default)
//!
//! ## Delete Policies (Future)
//! - `SequentialDeletePolicy` - Delete from L1, then L2
//! - `ParallelDeletePolicy` - Delete from both in parallel
// Re-export policy builder
pub use CompositionPolicy;
// Re-export read policies
pub use ;
// Re-export refill policy
pub use RefillPolicy;
// Re-export write policies
pub use ;