pub struct DependencyGraph { /* private fields */ }Expand description
Dependency graph for code analysis
Implementations§
Source§impl DependencyGraph
impl DependencyGraph
Sourcepub fn add_symbol(&mut self, symbol: Symbol)
pub fn add_symbol(&mut self, symbol: Symbol)
Add a symbol to the graph
Sourcepub fn add_dependency(&mut self, dependency: Dependency)
pub fn add_dependency(&mut self, dependency: Dependency)
Add a dependency between two symbols
Sourcepub fn get_direct_dependents(&self, symbol_key: &str) -> Vec<String>
pub fn get_direct_dependents(&self, symbol_key: &str) -> Vec<String>
Get all symbols that depend on a given symbol (direct dependents) Returns just the symbol names (without file paths)
Sourcepub fn get_direct_dependencies(&self, symbol_key: &str) -> Vec<String>
pub fn get_direct_dependencies(&self, symbol_key: &str) -> Vec<String>
Get all symbols that a given symbol depends on (direct dependencies) Returns just the symbol names (without file paths)
Sourcepub fn get_transitive_dependents(&self, symbol_key: &str) -> HashSet<String>
pub fn get_transitive_dependents(&self, symbol_key: &str) -> HashSet<String>
Get all symbols transitively affected by a change to a given symbol This includes all symbols that depend on the changed symbol, directly or indirectly Returns just the symbol names (without file paths)
Sourcepub fn get_transitive_dependencies(&self, symbol_name: &str) -> HashSet<String>
pub fn get_transitive_dependencies(&self, symbol_name: &str) -> HashSet<String>
Get all symbols that a given symbol transitively depends on
Sourcepub fn find_circular_dependencies(&self) -> Vec<Vec<String>>
pub fn find_circular_dependencies(&self) -> Vec<Vec<String>>
Detect circular dependencies
Sourcepub fn get_symbols(&self) -> Vec<Symbol>
pub fn get_symbols(&self) -> Vec<Symbol>
Get all symbols in the graph
Sourcepub fn get_dependencies(&self) -> &[Dependency]
pub fn get_dependencies(&self) -> &[Dependency]
Get all dependencies in the graph
Sourcepub fn symbol_count(&self) -> usize
pub fn symbol_count(&self) -> usize
Get the number of symbols in the graph
Sourcepub fn dependency_count(&self) -> usize
pub fn dependency_count(&self) -> usize
Get the number of dependencies in the graph
Trait Implementations§
Source§impl Clone for DependencyGraph
impl Clone for DependencyGraph
Source§fn clone(&self) -> DependencyGraph
fn clone(&self) -> DependencyGraph
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more