Expand description
Authoritative SWR cache — types and configuration.
§Layers
mod.rs—CacheKey,CacheEntry<T>,CacheConfig,Freshness.store.rs—CacheStore: in-memory LRU +redbdisk 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
CacheKeyvariant + one arm inserialize_key. Nothing else changes. - Add a new validation gate: add one
Optionarg tostore::getand one check at the top of the function. Existing call sites are unaffected. - Swap the KV backend: replace the
redb-specific code insideCacheStorewithout 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 +redbdisk-backed cache.
Structs§
- Cache
Config - Runtime-configurable cache parameters.
- Cache
Entry - A cached value together with its validity metadata.
- Cache
Read - Return type of
CacheStore::get: value + freshness classification.