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 set_node_metadata(
&mut self,
node_id: NodeId,
key: impl Into<String>,
value: impl Into<String>,
)
pub fn set_node_metadata( &mut self, node_id: NodeId, key: impl Into<String>, value: impl Into<String>, )
Set a metadata key on an existing node.
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
Auto Trait Implementations§
impl Freeze for SourceCodeGraphBuilder
impl RefUnwindSafe for SourceCodeGraphBuilder
impl Send for SourceCodeGraphBuilder
impl Sync for SourceCodeGraphBuilder
impl Unpin for SourceCodeGraphBuilder
impl UnsafeUnpin for SourceCodeGraphBuilder
impl UnwindSafe for SourceCodeGraphBuilder
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