pub struct GraphModule { /* private fields */ }Expand description
Graph module for symbol and reference queries.
§Examples
See crate-level documentation for usage examples.
Implementations§
Source§impl GraphModule
impl GraphModule
Sourcepub fn store(&self) -> &UnifiedGraphStore
pub fn store(&self) -> &UnifiedGraphStore
Get the underlying store for advanced operations
Sourcepub async fn find_symbol_by_id(&self, id: SymbolId) -> Result<Symbol>
pub async fn find_symbol_by_id(&self, id: SymbolId) -> Result<Symbol>
Sourcepub async fn cycles(&self) -> Result<Vec<Cycle>>
pub async fn cycles(&self) -> Result<Vec<Cycle>>
Detects cycles in the call graph.
Uses DFS-based cycle detection to find all strongly connected components (cycles) in the call graph.
§Returns
A vector of detected cycles
Sourcepub async fn symbol_count(&self) -> Result<usize>
pub async fn symbol_count(&self) -> Result<usize>
Returns the number of symbols in the graph.
Sourcepub async fn impact_analysis(
&self,
symbol_name: &str,
max_hops: Option<u32>,
) -> Result<Vec<ImpactedSymbol>>
pub async fn impact_analysis( &self, symbol_name: &str, max_hops: Option<u32>, ) -> Result<Vec<ImpactedSymbol>>
Analyze the impact of changing a symbol.
Performs k-hop traversal to find all symbols that would be affected by modifying the given symbol.
§Arguments
symbol_name- The name of the symbol to analyzemax_hops- Maximum traversal depth (default: 2)
§Returns
A vector of impacted symbols with their hop distance from the target
Sourcepub async fn index(&self) -> Result<()>
pub async fn index(&self) -> Result<()>
Indexes the codebase using magellan.
This runs the magellan indexer to extract symbols and references from the codebase and populate the graph database.
For Native V3 backend, also indexes cross-file references using sqlitegraph directly (a capability SQLite doesn’t support).
§Returns
Ok(()) on success, or an error if indexing fails.
Trait Implementations§
Source§impl Clone for GraphModule
impl Clone for GraphModule
Source§fn clone(&self) -> GraphModule
fn clone(&self) -> GraphModule
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for GraphModule
impl RefUnwindSafe for GraphModule
impl Send for GraphModule
impl Sync for GraphModule
impl Unpin for GraphModule
impl UnsafeUnpin for GraphModule
impl UnwindSafe for GraphModule
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,
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