pub struct DependencyAnalyzer { /* private fields */ }Expand description
Analyzes project dependencies and builds dependency graphs
Implementations§
Source§impl DependencyAnalyzer
impl DependencyAnalyzer
Sourcepub fn add_project(&mut self, project: Project)
pub fn add_project(&mut self, project: Project)
Adds a project to the analyzer
Sourcepub fn add_dependency(&mut self, dependency: ProjectDependency)
pub fn add_dependency(&mut self, dependency: ProjectDependency)
Adds a dependency between two projects
Sourcepub fn parse_cargo_toml(
&mut self,
content: &str,
project_name: &str,
) -> Result<()>
pub fn parse_cargo_toml( &mut self, content: &str, project_name: &str, ) -> Result<()>
Parses dependencies from a Cargo.toml-like structure This is a simplified parser that extracts workspace members and dependencies
Sourcepub fn get_direct_dependencies(
&self,
project_name: &str,
) -> Vec<ProjectDependency>
pub fn get_direct_dependencies( &self, project_name: &str, ) -> Vec<ProjectDependency>
Gets all direct dependencies of a project
Sourcepub fn get_transitive_dependencies(
&self,
project_name: &str,
) -> Result<Vec<ProjectDependency>>
pub fn get_transitive_dependencies( &self, project_name: &str, ) -> Result<Vec<ProjectDependency>>
Gets all transitive dependencies of a project
Sourcepub fn detect_circular_dependencies(&self) -> Result<Vec<Vec<String>>>
pub fn detect_circular_dependencies(&self) -> Result<Vec<Vec<String>>>
Detects circular dependencies in the dependency graph
Sourcepub fn get_upstream_dependents(&self, project_name: &str) -> Vec<String>
pub fn get_upstream_dependents(&self, project_name: &str) -> Vec<String>
Gets all projects that depend on a given project (upstream)
Sourcepub fn get_downstream_dependencies(&self, project_name: &str) -> Vec<String>
pub fn get_downstream_dependencies(&self, project_name: &str) -> Vec<String>
Gets all projects that a given project depends on (downstream)
Sourcepub fn validate_dependencies(&self) -> Result<()>
pub fn validate_dependencies(&self) -> Result<()>
Validates that all dependencies reference existing projects
Sourcepub fn get_adjacency_list(&self) -> HashMap<String, Vec<String>>
pub fn get_adjacency_list(&self) -> HashMap<String, Vec<String>>
Gets the dependency graph as an adjacency list
Sourcepub fn topological_sort(&self) -> Result<Vec<String>>
pub fn topological_sort(&self) -> Result<Vec<String>>
Performs a topological sort of projects based on dependencies
Sourcepub fn get_projects(&self) -> Vec<Project>
pub fn get_projects(&self) -> Vec<Project>
Gets all projects
Sourcepub fn get_all_dependencies(&self) -> Vec<ProjectDependency>
pub fn get_all_dependencies(&self) -> Vec<ProjectDependency>
Gets all dependencies
Trait Implementations§
Source§impl Clone for DependencyAnalyzer
impl Clone for DependencyAnalyzer
Source§fn clone(&self) -> DependencyAnalyzer
fn clone(&self) -> DependencyAnalyzer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DependencyAnalyzer
impl Debug for DependencyAnalyzer
Auto Trait Implementations§
impl Freeze for DependencyAnalyzer
impl RefUnwindSafe for DependencyAnalyzer
impl Send for DependencyAnalyzer
impl Sync for DependencyAnalyzer
impl Unpin for DependencyAnalyzer
impl UnwindSafe for DependencyAnalyzer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more