pub trait OutputCache {
// Required methods
fn get(&self, id: &NodeId) -> Result<Option<Vec<u8>>>;
fn put(&mut self, id: &NodeId, bytes: &[u8]) -> Result<()>;
// Provided method
fn note(&mut self, _note: CacheNote<'_>) { ... }
}Expand description
A node-output cache keyed by NodeId. Because a node’s id binds its full
dependency closure, an unchanged closure hits and a changed dependency misses;
there is no invalidation pass (ADR-0025).
Implementations are disposable: materialize_node_cached treats any get
error as a miss and never trusts bytes it cannot validate, so a corrupt cache
causes recomputation rather than wrong output.
Required Methods§
Provided Methods§
Sourcefn note(&mut self, _note: CacheNote<'_>)
fn note(&mut self, _note: CacheNote<'_>)
Phase 15.6. Advisory, best-effort reuse/store event, reported for every
cache hit and store. The default is a no-op, so NoCache and
DerivedCache are byte-identical to a build without this method; it is
never on the exactness path and can never change an output.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".