Skip to main content

CachedGraphAnalysis

Struct CachedGraphAnalysis 

Source
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

Source

pub fn graph(&self) -> &CodeGraph

The graph this analysis reads. Every identity it answers with indexes back into this value.

Source

pub fn selection(&self) -> GraphEdgeSelection

The selection every index was built from.

Source

pub fn limits(&self) -> GraphAnalysisLimits

The ceilings this analysis was admitted under.

Source

pub fn declared_partition(&self) -> &DeclaredModulePartition

The declared module partition, derived once with the indexes.

Source

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.

Source

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.

Source

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.

Source

pub fn degree_centrality(&self) -> Arc<[DegreeCentrality]> ⓘ

How many selected edges arrive at and leave each node, in raw node-id order.

Source

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.

Source

pub fn strongly_connected_components(&self) -> Arc<GraphComponents> ⓘ

Which nodes reach each other over selected edges.

Source

pub fn condensation(&self) -> Arc<CondensationGraph> ⓘ

The same selected topology with every component contracted, ordered, and still carrying every raw edge it coalesced.

Source

pub fn divergence(&self) -> Arc<GraphDivergence> ⓘ

What the selected topology says about the module partition this graph declares.

Source

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.

Trait Implementations§

Source§

impl Clone for CachedGraphAnalysis

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.