pub struct DependencyGraph {
pub root: String,
pub root_version: String,
pub edges: Vec<DependencyEdge>,
pub nodes: HashMap<String, String>,
}Expand description
Dependency graph representation
Fields§
§root: String§root_version: String§edges: Vec<DependencyEdge>§nodes: HashMap<String, String>Implementations§
Source§impl DependencyGraph
impl DependencyGraph
Sourcepub fn new(root_name: &str, root_version: &str) -> Self
pub fn new(root_name: &str, root_version: &str) -> Self
Create a new dependency graph with a root plugin
Sourcepub fn add_dependency(&mut self, edge: DependencyEdge)
pub fn add_dependency(&mut self, edge: DependencyEdge)
Add a dependency edge
Sourcepub fn detect_circular_dependencies(&self) -> Vec<CircularDependency>
pub fn detect_circular_dependencies(&self) -> Vec<CircularDependency>
Detect circular dependencies using DFS
Sourcepub fn build_tree(&self) -> DependencyNode
pub fn build_tree(&self) -> DependencyNode
Build a dependency tree from the graph
Sourcepub fn calculate_metrics(&self) -> DependencyMetrics
pub fn calculate_metrics(&self) -> DependencyMetrics
Calculate dependency metrics
Sourcepub fn direct_dependencies(&self, node_name: &str) -> Vec<String>
pub fn direct_dependencies(&self, node_name: &str) -> Vec<String>
Get all direct dependencies of a node
Sourcepub fn transitive_dependencies(&self, node_name: &str) -> Vec<String>
pub fn transitive_dependencies(&self, node_name: &str) -> Vec<String>
Get all transitive dependencies
Sourcepub fn shortest_path(&self, from: &str, to: &str) -> Option<Vec<String>>
pub fn shortest_path(&self, from: &str, to: &str) -> Option<Vec<String>>
Find the shortest path between two nodes
Sourcepub fn node_depth(&self, node_name: &str) -> Option<u32>
pub fn node_depth(&self, node_name: &str) -> Option<u32>
Get depth of a node from root
Auto Trait Implementations§
impl Freeze for DependencyGraph
impl RefUnwindSafe for DependencyGraph
impl Send for DependencyGraph
impl Sync for DependencyGraph
impl Unpin for DependencyGraph
impl UnsafeUnpin for DependencyGraph
impl UnwindSafe for DependencyGraph
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