pub struct ModuleGraph { /* private fields */ }Expand description
Slotted, incrementally maintained repository module graph.
Implementations§
Source§impl ModuleGraph
impl ModuleGraph
Sourcepub fn set_universe_complete(&mut self, complete: bool)
pub fn set_universe_complete(&mut self, complete: bool)
Records whether the caller has supplied a complete source universe.
Sourcepub fn generation(&self) -> u64
pub fn generation(&self) -> u64
Returns the graph mutation generation.
Sourcepub fn resolver_generation(&self) -> u64
pub fn resolver_generation(&self) -> u64
Returns the resolver configuration generation.
Sourcepub fn contains(&self, path: &str, hash: u64) -> bool
pub fn contains(&self, path: &str, hash: u64) -> bool
Returns whether an analyzed node has the supplied content hash.
Sourcepub fn node(&self, path: &str) -> Option<&ModuleNode>
pub fn node(&self, path: &str) -> Option<&ModuleNode>
Returns an occupied node by path.
Sourcepub fn rdeps_paths(&self, path: &str) -> Option<Vec<CompactString>>
pub fn rdeps_paths(&self, path: &str) -> Option<Vec<CompactString>>
Sorted importer paths of path — a slot-history-independent view of
the reverse-dependency set.
Sourcepub fn upsert_file(
&mut self,
analysis: &FileAnalysis,
resolvers: &ResolverSet,
imports_supported: bool,
) -> UpsertOutcome
pub fn upsert_file( &mut self, analysis: &FileAnalysis, resolvers: &ResolverSet, imports_supported: bool, ) -> UpsertOutcome
Inserts or refreshes one file analysis.
imports_supported should be computed from the same language registry
that produced analysis.
Sourcepub fn remove_file(&mut self, path: &str) -> bool
pub fn remove_file(&mut self, path: &str) -> bool
Removes an analyzed file.
A referenced node is demoted to a stub in the same slot. Unreferenced nodes are freed, and outgoing reverse-dependency memberships are removed incrementally.
Sourcepub fn reresolve_all(&mut self, resolvers: &ResolverSet)
pub fn reresolve_all(&mut self, resolvers: &ResolverSet)
Re-resolves every analyzed node against a new resolver generation.
Reverse dependencies are adjusted by target-set diffs for each node; they are never rebuilt globally.
Sourcepub fn bump_resolver_generation(&mut self)
pub fn bump_resolver_generation(&mut self)
Advances only the resolver generation, leaving current edges stale.
Sourcepub fn config_dependencies(&self) -> Vec<CompactString>
pub fn config_dependencies(&self) -> Vec<CompactString>
Returns the deduplicated union of resolver configuration dependencies.
Sourcepub fn paths(&self) -> impl Iterator<Item = &str>
pub fn paths(&self) -> impl Iterator<Item = &str>
Iterates over occupied node paths in slot order.
Sourcepub fn edges(&self) -> impl Iterator<Item = DepEdge> + '_
pub fn edges(&self) -> impl Iterator<Item = DepEdge> + '_
Iterates over every stored edge with graph slots materialized as paths.
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Returns the total number of resolved, external, and unresolved edges.
Sourcepub fn deps(&self, path: &str) -> Option<DepsResult>
pub fn deps(&self, path: &str) -> Option<DepsResult>
Returns direct outgoing dependencies for path.
Sourcepub fn rdeps_guarantee_for(&self, path: &str) -> Option<Guarantee>
pub fn rdeps_guarantee_for(&self, path: &str) -> Option<Guarantee>
Reverse-dependency guarantee without materializing importer edges.
Sourcepub fn rdeps_bounded(&self, path: &str, limit: usize) -> Option<DepsResult>
pub fn rdeps_bounded(&self, path: &str, limit: usize) -> Option<DepsResult>
Returns at most limit stored edges that directly target path.
Sourcepub fn rdeps(&self, path: &str) -> Option<DepsResult>
pub fn rdeps(&self, path: &str) -> Option<DepsResult>
Returns all stored edges that directly target path.
Sourcepub fn neighborhood(&self, path: &str, depth: u32) -> Option<NeighborhoodResult>
pub fn neighborhood(&self, path: &str, depth: u32) -> Option<NeighborhoodResult>
Traverses both dependency directions to depth edges from path.