pub struct CachedCodeGraph { /* private fields */ }Expand description
One immutable graph, shared with the cache that produced it.
Cloning a handle shares the graph rather than copying its records, and a handle stays valid after its cache entry is evicted, after the cache is cleared, and after the cache itself is dropped: the memory is the caller’s for as long as the caller holds it.
Implementations§
Source§impl CachedCodeGraph
impl CachedCodeGraph
Sourcepub fn stats(&self) -> GraphCacheStats
pub fn stats(&self) -> GraphCacheStats
What the cache that produced this handle has done so far.
Sourcepub fn analyze(
&self,
selection: GraphEdgeSelection,
limits: GraphAnalysisLimits,
) -> Result<CachedGraphAnalysis, GraphAnalysisError>
pub fn analyze( &self, selection: GraphEdgeSelection, limits: GraphAnalysisLimits, ) -> Result<CachedGraphAnalysis, GraphAnalysisError>
One shared analysis of this graph under selection, reusing the indexes
this graph already produced for it.
The returned handle answers exactly as crate::GraphAnalysis answers
for the same graph, selection, and ceilings, whatever this graph
retained first.
§Errors
The same refusals crate::GraphAnalysis::new returns. The node and
selected-edge counts are proved against the caller’s current ceilings
before any retained index set is examined, so a lowered ceiling refuses
exactly as it would have refused a fresh analysis.
Sourcepub fn clear_analysis_cache(&self)
pub fn clear_analysis_cache(&self)
Drop the selected indexes and derived products retained for this graph.
Cumulative statistics are not reset, no analysis or product a caller holds is invalidated, and the graph itself is untouched: the cache drops its own strong references and nothing else.