pub struct SccAnalysis {
pub components: Vec<Scc>,
pub node_to_component: HashMap<NodeIndex, usize>,
}Expand description
Complete SCC analysis results for a dependency graph.
Fields§
§components: Vec<Scc>SCCs in reverse topological order (dependencies before dependents)
node_to_component: HashMap<NodeIndex, usize>Map from node index to its component index
Implementations§
Source§impl SccAnalysis
impl SccAnalysis
Sourcepub fn analyze(graph: &DiGraph<NodeData, EdgeData>) -> Self
pub fn analyze(graph: &DiGraph<NodeData, EdgeData>) -> Self
Analyze a graph and compute SCCs on the dependency subgraph.
Ownership edges are excluded from SCC computation per graph-model.md. The dependency subgraph includes Import and Reference edge kinds.
Uses an EdgeFiltered view instead of cloning the graph - zero-cost,
no allocation for the subgraph.
Sourcepub fn component_of(&self, node: NodeIndex) -> Option<usize>
pub fn component_of(&self, node: NodeIndex) -> Option<usize>
Get the component index for a specific node.
Sourcepub fn mutually_dependent(&self, a: NodeIndex, b: NodeIndex) -> bool
pub fn mutually_dependent(&self, a: NodeIndex, b: NodeIndex) -> bool
Check if two nodes are in the same SCC (mutually dependent).
Sourcepub fn has_cycles(&self) -> bool
pub fn has_cycles(&self) -> bool
Returns true if any cycles exist in the graph.
Sourcepub fn cyclic_components(&self) -> impl Iterator<Item = &Scc>
pub fn cyclic_components(&self) -> impl Iterator<Item = &Scc>
Get all cyclic components.
Sourcepub fn acyclic_components(&self) -> impl Iterator<Item = &Scc>
pub fn acyclic_components(&self) -> impl Iterator<Item = &Scc>
Get all acyclic (independent/dependency) components.
Sourcepub fn hint_counts(&self) -> HashMap<DeployabilityHint, usize>
pub fn hint_counts(&self) -> HashMap<DeployabilityHint, usize>
Count of components by hint type.
Trait Implementations§
Source§impl Clone for SccAnalysis
impl Clone for SccAnalysis
Source§fn clone(&self) -> SccAnalysis
fn clone(&self) -> SccAnalysis
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SccAnalysis
impl RefUnwindSafe for SccAnalysis
impl Send for SccAnalysis
impl Sync for SccAnalysis
impl Unpin for SccAnalysis
impl UnsafeUnpin for SccAnalysis
impl UnwindSafe for SccAnalysis
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more