Skip to main content

Module cache

Module cache 

Source
Expand description

Authoritative SWR cache — types and configuration.

§Layers

  • mod.rsCacheKey, CacheEntry<T>, CacheConfig, Freshness.
  • store.rsCacheStore: in-memory LRU + redb disk backend.
  • invalidation.rs — mutation-triggered invalidation helpers.
  • capability.rs — stub placeholder for the capability cache (task 20).

§OCP

  • Add a new cached resource: add a CacheKey variant + one arm in serialize_key. Nothing else changes.
  • Add a new validation gate: add one Option arg to store::get and one check at the top of the function. Existing call sites are unaffected.
  • Swap the KV backend: replace the redb-specific code inside CacheStore without touching any caller.

Re-exports§

pub use capability::CapabilityCache;
pub use capability::CapabilityClass;
pub use capability::CapabilityHandle;
pub use capability::CapabilityMap;
pub use capability::CapabilityRecord;
pub use capability::ClearScope;

Modules§

capability
Capability classification cache.
invalidation
Mutation-triggered invalidation helpers.
store
CacheStore — in-memory LRU + redb disk-backed cache.

Structs§

CacheConfig
Runtime-configurable cache parameters.
CacheEntry
A cached value together with its validity metadata.
CacheRead
Return type of CacheStore::get: value + freshness classification.

Enums§

CacheKey
Discriminated key for every entity the cache can hold.
Freshness
Freshness classification returned by CacheStore::get.