pub struct GraphBuilder { /* private fields */ }Expand description
Builds an ArborGraph from parsed code nodes.
Implementations§
Source§impl GraphBuilder
impl GraphBuilder
pub fn new() -> Self
Sourcepub fn add_nodes(&mut self, nodes: Vec<CodeNode>)
pub fn add_nodes(&mut self, nodes: Vec<CodeNode>)
Adds nodes from a parsed file to the graph.
This pass does two things:
- Adds real code entities (functions, classes, etc.) to the graph and symbol table
- Processes Import nodes to build the per-file import map
Call this for all files before calling build().
Sourcepub fn resolve_edges(&mut self)
pub fn resolve_edges(&mut self)
Resolves references into actual graph edges.
Resolution order for each reference R from file F:
- Exact FQN match in symbol table
- Context-aware suffix match (prefers same directory, avoids ambiguity)
- Import-validated match — if R is in F’s import map AND a match was found in step 2 for a different file, we skip it to avoid wrong-module edges
References that cannot be resolved are silently dropped (they are external/stdlib symbols with no definition in this repository).
Sourcepub fn build(self) -> ArborGraph
pub fn build(self) -> ArborGraph
Finishes building and returns the graph.
Sourcepub fn build_without_resolve(self) -> ArborGraph
pub fn build_without_resolve(self) -> ArborGraph
Builds without resolving edges (for incremental updates).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphBuilder
impl RefUnwindSafe for GraphBuilder
impl Send for GraphBuilder
impl Sync for GraphBuilder
impl Unpin for GraphBuilder
impl UnsafeUnpin for GraphBuilder
impl UnwindSafe for GraphBuilder
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
Mutably borrows from an owned value. Read more