pub struct CachedGraphAnalysis { /* private fields */ }Expand description
One shared analysis over one cached graph.
Distinct from the borrowed crate::GraphAnalysis: this handle owns shared
state, so it can be cloned, sent between threads, and outlive the cache that
produced it. Cloning shares the admitted indexes rather than rebuilding
them.
Implementations§
Source§impl CachedGraphAnalysis
impl CachedGraphAnalysis
Sourcepub fn graph(&self) -> &CodeGraph
pub fn graph(&self) -> &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 with the indexes.
Sourcepub fn neighbors(
&self,
node: GraphNodeId,
depth: u32,
direction: GraphDirection,
) -> Result<Arc<[GraphNeighbor]>, GraphAnalysisError>
pub fn neighbors( &self, node: GraphNodeId, depth: u32, direction: GraphDirection, ) -> Result<Arc<[GraphNeighbor]>, GraphAnalysisError>
Every node connected to node within depth selected steps in
direction, at its minimum distance, in distance then node order.
§Errors
The same refusals crate::GraphAnalysis::neighbors returns, in the
same order. The seed and the depth ceiling are proved before any
retained neighborhood is examined.
Sourcepub fn path(
&self,
source: GraphNodeId,
target: GraphNodeId,
) -> Result<Option<Arc<GraphPath>>, GraphAnalysisError>
pub fn path( &self, source: GraphNodeId, target: GraphNodeId, ) -> Result<Option<Arc<GraphPath>>, GraphAnalysisError>
The shortest route from source to target over selected outgoing
edges, or None when no route exists.
The proven absence of a route is retained too, so a repeated unreachable pair is answered rather than walked again.
§Errors
The same refusals crate::GraphAnalysis::path returns, in the same
order. Both endpoints are proved before any retained route is examined,
so a pair this graph holds no record for costs no store lookup and is
never counted as a product nothing derived and nothing retained.
Sourcepub fn subgraph(
&self,
seed: GraphNodeId,
depth: u32,
direction: GraphDirection,
) -> Result<Arc<GraphSubgraph>, GraphAnalysisError>
pub fn subgraph( &self, seed: GraphNodeId, depth: u32, direction: GraphDirection, ) -> Result<Arc<GraphSubgraph>, GraphAnalysisError>
The selection into this graph induced by the nodes seed reaches
within depth selected steps.
§Errors
The same refusals crate::GraphAnalysis::subgraph returns, in the
same order. The seed and the depth ceiling are proved before any
retained selection is examined.
Sourcepub fn degree_centrality(&self) -> Arc<[DegreeCentrality]> ⓘ
pub fn degree_centrality(&self) -> Arc<[DegreeCentrality]> ⓘ
How many selected edges arrive at and leave each node, in raw node-id order.
Sourcepub fn betweenness_centrality(
&self,
) -> Result<Arc<[BetweennessCentrality]>, GraphAnalysisError>
pub fn betweenness_centrality( &self, ) -> Result<Arc<[BetweennessCentrality]>, GraphAnalysisError>
How much of the selected topology’s shortest routing passes through each node, in raw node-id order.
§Errors
The same refusals crate::GraphAnalysis::betweenness_centrality
returns. The work bound is proved before any retained score is examined.
Sourcepub fn strongly_connected_components(&self) -> Arc<GraphComponents> ⓘ
pub fn strongly_connected_components(&self) -> Arc<GraphComponents> ⓘ
Which nodes reach each other over selected edges.
Sourcepub fn condensation(&self) -> Arc<CondensationGraph> ⓘ
pub fn condensation(&self) -> Arc<CondensationGraph> ⓘ
The same selected topology with every component contracted, ordered, and still carrying every raw edge it coalesced.
Sourcepub fn divergence(&self) -> Arc<GraphDivergence> ⓘ
pub fn divergence(&self) -> Arc<GraphDivergence> ⓘ
What the selected topology says about the module partition this graph declares.
Sourcepub fn layout_assist(
&self,
) -> Result<Arc<LayoutAssistMetadata>, GraphAnalysisError>
pub fn layout_assist( &self, ) -> Result<Arc<LayoutAssistMetadata>, GraphAnalysisError>
Every admitted node and selected edge, described for a consumer that ranks or draws them.
§Errors
The same refusals crate::GraphAnalysis::layout_assist returns. The
bounded pass behind it is admitted before any retained metadata is
examined.