pub struct CachePlan {
pub tool_policies: HashMap<String, ResolvedCachePolicy>,
pub caches: HashMap<String, IRCache>,
pub invalidation_channels: HashMap<String, Vec<String>>,
}Expand description
v2.89.0 — everything a deployment memoises, resolved once from the
IRProgram.
§Why one struct and not three parameters
The three maps are not independent knobs; they are one answer to “what does this program memoise?”. A caller that supplied two of them would get a runtime that caches but never invalidates, or one that flushes a namespace nothing writes to — silent wrong answers, both, and the shape that makes them reachable is a builder with three setters.
Bundled, the only way to half-wire the cache is not to wire it at all, which
is the honest None default. This is the v2.87.0 lesson expressed as an API:
make the second door impossible rather than remembering to walk through it.
Travels the same route as scopes, observables and credentials — built
where the IR is, passed down as a resolved catalog, so the hot path looks
nothing up that could have been looked up once.
Fields§
§tool_policies: HashMap<String, ResolvedCachePolicy>Tool name → the policy memoising it.
caches: HashMap<String, IRCache>Cache name → declaration, for retrieve … cache: and namespace flushes.
invalidation_channels: HashMap<String, Vec<String>>Channel name → the namespaces an emit on it flushes.