pub struct GraphAnalysis<'graph> { /* private fields */ }Expand description
One borrowed graph, the selection applied to it, and the indexes that selection produced.
Implementations§
Source§impl<'graph> GraphAnalysis<'graph>
impl<'graph> GraphAnalysis<'graph>
Sourcepub fn new(
graph: &'graph CodeGraph,
selection: GraphEdgeSelection,
limits: GraphAnalysisLimits,
) -> Result<GraphAnalysis<'graph>, GraphAnalysisError>
pub fn new( graph: &'graph CodeGraph, selection: GraphEdgeSelection, limits: GraphAnalysisLimits, ) -> Result<GraphAnalysis<'graph>, GraphAnalysisError>
Index one graph under one stated selection and one stated set of ceilings.
The node count is proved before any node-indexed table exists and the selected-edge count is proved before any adjacency storage does, so a refusal costs the counts alone.
Sourcepub fn graph(&self) -> &'graph CodeGraph
pub fn graph(&self) -> &'graph CodeGraph
The graph this analysis reads. Every identity it answers with indexes back into this value.
Sourcepub fn selection(&self) -> GraphEdgeSelection
pub fn selection(&self) -> GraphEdgeSelection
The selection every index was built from.
Sourcepub fn limits(&self) -> GraphAnalysisLimits
pub fn limits(&self) -> GraphAnalysisLimits
The ceilings this analysis was admitted under.
Sourcepub fn declared_partition(&self) -> &DeclaredModulePartition
pub fn declared_partition(&self) -> &DeclaredModulePartition
The declared module partition, derived once from logical containment.
Sourcepub fn neighbors(
&self,
node: GraphNodeId,
depth: u32,
direction: GraphDirection,
) -> Result<Box<[GraphNeighbor]>, GraphAnalysisError>
pub fn neighbors( &self, node: GraphNodeId, depth: u32, direction: GraphDirection, ) -> Result<Box<[GraphNeighbor]>, GraphAnalysisError>
Every node connected to node within depth selected steps in
direction, at its minimum distance, in distance then node order.
Sourcepub fn path(
&self,
source: GraphNodeId,
target: GraphNodeId,
) -> Result<Option<GraphPath>, GraphAnalysisError>
pub fn path( &self, source: GraphNodeId, target: GraphNodeId, ) -> Result<Option<GraphPath>, GraphAnalysisError>
The shortest route from source to target over selected outgoing
edges, or None when no route exists.
Sourcepub fn subgraph(
&self,
seed: GraphNodeId,
depth: u32,
direction: GraphDirection,
) -> Result<GraphSubgraph, GraphAnalysisError>
pub fn subgraph( &self, seed: GraphNodeId, depth: u32, direction: GraphDirection, ) -> Result<GraphSubgraph, GraphAnalysisError>
The selection into this graph induced by the nodes seed reaches
within depth selected steps.
Sourcepub fn degree_centrality(&self) -> Box<[DegreeCentrality]>
pub fn degree_centrality(&self) -> Box<[DegreeCentrality]>
How many selected edges arrive at and leave each node, in raw node-id order.
Sourcepub fn betweenness_centrality(
&self,
) -> Result<Box<[BetweennessCentrality]>, GraphAnalysisError>
pub fn betweenness_centrality( &self, ) -> Result<Box<[BetweennessCentrality]>, GraphAnalysisError>
How much of the selected topology’s shortest routing passes through each node, in raw node-id order.
Sourcepub fn strongly_connected_components(&self) -> GraphComponents
pub fn strongly_connected_components(&self) -> GraphComponents
Which nodes reach each other over selected edges.
Sourcepub fn condensation(&self) -> CondensationGraph
pub fn condensation(&self) -> CondensationGraph
The same selected topology with every component contracted, ordered, and still carrying every raw edge it coalesced.
Sourcepub fn divergence(&self) -> GraphDivergence
pub fn divergence(&self) -> GraphDivergence
What the selected topology says about the module partition this graph declares.
Sourcepub fn layout_assist(&self) -> Result<LayoutAssistMetadata, GraphAnalysisError>
pub fn layout_assist(&self) -> Result<LayoutAssistMetadata, GraphAnalysisError>
Every admitted node and selected edge, described for a consumer that ranks or draws them.