pub struct SourceCodeGraphBuilder { /* private fields */ }Expand description
Builder for constructing a SourceCodeGraph from project data.
Implementations§
Source§impl SourceCodeGraphBuilder
impl SourceCodeGraphBuilder
Sourcepub fn with_metadata(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_metadata( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Set metadata for the graph.
Sourcepub fn add_directory(&mut self, path: &Path) -> NodeId
pub fn add_directory(&mut self, path: &Path) -> NodeId
Add a directory node.
Sourcepub fn add_file(&mut self, path: &Path, relative_path: &str) -> NodeId
pub fn add_file(&mut self, path: &Path, relative_path: &str) -> NodeId
Add a file node with optional language detection.
Sourcepub fn add_hierarchy_edge(&mut self, parent_path: &Path, child_path: &Path)
pub fn add_hierarchy_edge(&mut self, parent_path: &Path, child_path: &Path)
Add a hierarchy edge (parent contains child).
Sourcepub fn add_edge(&mut self, from: NodeId, to: NodeId, kind: ReferenceKind)
pub fn add_edge(&mut self, from: NodeId, to: NodeId, kind: ReferenceKind)
Add an edge between two nodes.
Sourcepub fn get_node_id(&self, path: &Path) -> Option<NodeId>
pub fn get_node_id(&self, path: &Path) -> Option<NodeId>
Get NodeId for a path if it exists.
Sourcepub fn find_node_by_path_suffix(&self, route: &Path) -> Option<NodeId>
pub fn find_node_by_path_suffix(&self, route: &Path) -> Option<NodeId>
Find a node by matching path suffix (for reference resolution).
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Get the current node count.
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Get the current edge count.
Sourcepub fn build(self) -> SourceCodeGraph
pub fn build(self) -> SourceCodeGraph
Build the final SourceCodeGraph.
Trait Implementations§
Source§impl Debug for SourceCodeGraphBuilder
impl Debug for SourceCodeGraphBuilder
Source§impl Default for SourceCodeGraphBuilder
impl Default for SourceCodeGraphBuilder
Source§fn default() -> SourceCodeGraphBuilder
fn default() -> SourceCodeGraphBuilder
Returns the “default value” for a type. Read more