pub struct CodeGraph { /* private fields */ }Implementations§
Source§impl CodeGraph
impl CodeGraph
pub fn open(project_root: &str) -> Result<Self>
pub fn open_in_memory() -> Result<Self>
pub fn db_path(&self) -> &Path
pub fn connection(&self) -> &Connection
pub fn upsert_node(&self, node: &Node) -> Result<i64>
pub fn upsert_edge(&self, edge: &Edge) -> Result<()>
pub fn get_node_by_path(&self, file_path: &str) -> Result<Option<Node>>
pub fn get_node_by_symbol( &self, name: &str, file_path: &str, ) -> Result<Option<Node>>
pub fn remove_file_nodes(&self, file_path: &str) -> Result<()>
pub fn edges_from(&self, node_id: i64) -> Result<Vec<Edge>>
pub fn edges_to(&self, node_id: i64) -> Result<Vec<Edge>>
pub fn dependents(&self, file_path: &str) -> Result<Vec<String>>
pub fn dependencies(&self, file_path: &str) -> Result<Vec<String>>
pub fn impact_analysis( &self, file_path: &str, max_depth: usize, ) -> Result<ImpactResult>
pub fn dependency_chain( &self, from: &str, to: &str, ) -> Result<Option<DependencyChain>>
pub fn file_connectivity( &self, file_path: &str, ) -> Result<HashMap<String, (usize, usize)>>
pub fn node_count(&self) -> Result<usize>
pub fn edge_count(&self) -> Result<usize>
Sourcepub fn upsert_cross_source_edge(
&self,
from: &str,
to: &str,
kind: &str,
weight: f32,
) -> Result<()>
pub fn upsert_cross_source_edge( &self, from: &str, to: &str, kind: &str, weight: f32, ) -> Result<()>
Persist a cross-source edge (code file ↔ external source URI) into the
dedicated cross_source_edges table. Keeps the higher weight on conflict
so repeated provider ingests don’t downgrade an established link (#682).
Sourcepub fn all_cross_source_edges(&self) -> Vec<IndexEdge>
pub fn all_cross_source_edges(&self) -> Vec<IndexEdge>
All cross-source edges as IndexEdges, ready for cross_source_hints.
pub fn cross_source_edge_count(&self) -> Result<usize>
pub fn clear(&self) -> Result<()>
Sourcepub fn clear_code_graph(&self) -> Result<()>
pub fn clear_code_graph(&self) -> Result<()>
Clear only the code graph (nodes, edges, file catalog), preserving
provider cross_source_edges. Used by the graph_index→PG mirror (#682.1)
so rebuilding the code graph never drops lateral provider hints, which
live in their own table and are repopulated on a separate ingest cycle.
pub fn upsert_file_catalog(&self, entry: &FileCatalogEntry) -> Result<()>
pub fn get_file_catalog(&self, path: &str) -> Result<Option<FileCatalogEntry>>
pub fn file_catalog_count(&self) -> Result<usize>
pub fn file_catalog_paths(&self) -> Result<Vec<String>>
pub fn find_symbols( &self, name: &str, file_filter: Option<&str>, kind_filter: Option<&str>, ) -> Result<Vec<Node>>
Sourcepub fn resolve_symbol_def_files(&self, name: &str) -> Result<Vec<String>>
pub fn resolve_symbol_def_files(&self, name: &str) -> Result<Vec<String>>
Files that define a symbol named exactly name (GH #398 symbol-name
ctx_impact analyze fallback). Backed by node::resolve_symbol_def_files.
pub fn symbol_count(&self) -> Result<usize>
Sourcepub fn file_node_count(&self) -> Result<usize>
pub fn file_node_count(&self) -> Result<usize>
Count of file nodes (accurate on both builder paths). Backed by
node::file_count.
Sourcepub fn all_symbols(&self) -> Result<Vec<Node>>
pub fn all_symbols(&self) -> Result<Vec<Node>>
Every symbol node with its line span (unfiltered). Backend for the
call-graph symbol table after the graph_index teardown (#696).
pub fn all_edges_flat(&self) -> Result<Vec<(String, String, String, f64)>>
Auto Trait Implementations§
impl !Freeze for CodeGraph
impl !RefUnwindSafe for CodeGraph
impl !Sync for CodeGraph
impl !UnwindSafe for CodeGraph
impl Send for CodeGraph
impl Unpin for CodeGraph
impl UnsafeUnpin for CodeGraph
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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