pub struct StructuralGraph {
pub graph: DiGraph<Node, Edge>,
/* private fields */
}Fields§
§graph: DiGraph<Node, Edge>Implementations§
Source§impl StructuralGraph
impl StructuralGraph
pub fn from_graph(graph: DiGraph<Node, Edge>) -> Self
pub fn build_from_analysis(entries: &[FileAnalysisOutput]) -> Self
Sourcepub fn from_call_graph(
entries: &[FileAnalysisOutput],
call_graph: &CallGraph,
) -> Self
pub fn from_call_graph( entries: &[FileAnalysisOutput], call_graph: &CallGraph, ) -> Self
Build a StructuralGraph from an already-built CallGraph plus the same entries used to build it. Reuses CallGraph::callees (already-resolved caller/callee names, including scope-prefix stripping) instead of re-deriving Calls edges from entry.semantic.calls, so the expensive edge-resolution pass runs exactly once across both graphs. Node/symbol_index construction (Pass 1) is unavoidable since CallGraph does not track SymbolKind or imports. Note: unlike build_from_analysis, this does not have per-call arg_count available (CallEdge does not carry it), so candidate disambiguation falls back to same-file preference and line proximity only, without the arg-count tie-break stage.
pub fn bfs_blast_radius(&self, symbol: &str, depth: usize) -> Vec<NodeIndex>
Sourcepub fn blast_radius_subgraph(
&self,
symbol: &str,
depth: usize,
) -> (Vec<NodeIndex>, Vec<(NodeIndex, NodeIndex, Edge)>)
pub fn blast_radius_subgraph( &self, symbol: &str, depth: usize, ) -> (Vec<NodeIndex>, Vec<(NodeIndex, NodeIndex, Edge)>)
Blast-radius subgraph including both nodes and edges.
Returns a tuple of (nodes, edges) where:
- nodes: Vec
with the start symbol first, followed by all discovered nodes in BFS order - edges: Vec<(NodeIndex, NodeIndex, Edge)> containing every edge whose source and target are both in the visited set (not just edges walked by the BFS tree), allowing clients to fully reconstruct the subgraph’s connectivity
If the symbol is not found, returns (vec![], vec![]).
Trait Implementations§
Source§impl Clone for StructuralGraph
impl Clone for StructuralGraph
Source§fn clone(&self) -> StructuralGraph
fn clone(&self) -> StructuralGraph
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StructuralGraph
impl Debug for StructuralGraph
Source§impl<'de> Deserialize<'de> for StructuralGraph
impl<'de> Deserialize<'de> for StructuralGraph
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for StructuralGraph
impl RefUnwindSafe for StructuralGraph
impl Send for StructuralGraph
impl Sync for StructuralGraph
impl Unpin for StructuralGraph
impl UnsafeUnpin for StructuralGraph
impl UnwindSafe for StructuralGraph
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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