pub enum CachePolicy {
Disabled,
Process {
ttl: Duration,
capacity: u64,
},
}Expand description
Per-invocation in-process cache policy.
Disabled is the safe default and skips every cache code path.
Process enables in-process memoization with the given TTL and
capacity ceiling; capacity-eviction is LRU within moka’s segmented
design.
Persistent (gated on the cache-persistent Cargo feature) is
reserved for a future cross-invocation encrypted-file path.
Constructing it via ProcessCache::new currently downgrades to
the in-process Process policy with the persistent’s TTL and
capacity — the on-disk encrypted-file implementation is not yet
in tree.
Variants§
Implementations§
Source§impl CachePolicy
impl CachePolicy
Sourcepub fn process_default() -> Self
pub fn process_default() -> Self
Process policy with the canonical AWS-Secrets-Manager-Agent
envelope: 5-minute TTL, 1024-entry capacity ceiling. Capacity
is intentionally generous — moka’s overhead per entry is well
under 1 KiB and the per-invocation Store will never approach
the ceiling in practice.
Trait Implementations§
Source§impl Clone for CachePolicy
impl Clone for CachePolicy
Source§fn clone(&self) -> CachePolicy
fn clone(&self) -> CachePolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more