Skip to main content

GraphStore

Trait GraphStore 

Source
pub trait GraphStore: Send + Sync {
Show 18 methods // Required methods fn upsert_file(&self, file: &FileNode) -> Result<()>; fn upsert_symbol(&self, symbol: &SymbolNode) -> Result<()>; fn upsert_edge(&self, edge: &Edge) -> Result<()>; fn get_file(&self, path: &Path) -> Result<Option<FileNode>>; fn get_symbol(&self, qualified_name: &str) -> Result<Option<SymbolNode>>; fn get_edges_from(&self, source: &str) -> Result<Vec<Edge>>; fn get_edges_to(&self, target: &str) -> Result<Vec<Edge>>; fn all_files(&self) -> Result<Vec<FileNode>>; fn all_symbols(&self) -> Result<Vec<SymbolNode>>; fn all_edges(&self) -> Result<Vec<Edge>>; fn remove_file(&self, path: &Path) -> Result<()>; fn remove_symbols_in_file(&self, path: &Path) -> Result<()>; fn stats(&self) -> Result<GraphStats>; fn find_by_name(&self, pattern: &str) -> Result<Vec<SymbolNode>>; fn store_file_data( &self, file: &FileNode, symbols: &[SymbolNode], edges: &[Edge], ) -> Result<()>; fn remove_file_data(&self, path: &Path) -> Result<()>; // Provided methods fn symbols_for_files(&self, paths: &[&Path]) -> Result<Vec<SymbolNode>> { ... } fn edges_streaming( &self, callback: &mut dyn FnMut(Edge) -> Result<()>, ) -> Result<()> { ... }
}
Expand description

Primary storage for the code graph — files, symbols, edges.

Required Methods§

Source

fn upsert_file(&self, file: &FileNode) -> Result<()>

Source

fn upsert_symbol(&self, symbol: &SymbolNode) -> Result<()>

Source

fn upsert_edge(&self, edge: &Edge) -> Result<()>

Source

fn get_file(&self, path: &Path) -> Result<Option<FileNode>>

Source

fn get_symbol(&self, qualified_name: &str) -> Result<Option<SymbolNode>>

Source

fn get_edges_from(&self, source: &str) -> Result<Vec<Edge>>

Source

fn get_edges_to(&self, target: &str) -> Result<Vec<Edge>>

Source

fn all_files(&self) -> Result<Vec<FileNode>>

Source

fn all_symbols(&self) -> Result<Vec<SymbolNode>>

Source

fn all_edges(&self) -> Result<Vec<Edge>>

Source

fn remove_file(&self, path: &Path) -> Result<()>

Source

fn remove_symbols_in_file(&self, path: &Path) -> Result<()>

Source

fn stats(&self) -> Result<GraphStats>

Source

fn find_by_name(&self, pattern: &str) -> Result<Vec<SymbolNode>>

Source

fn store_file_data( &self, file: &FileNode, symbols: &[SymbolNode], edges: &[Edge], ) -> Result<()>

Store a file and all its symbols and edges atomically.

Source

fn remove_file_data(&self, path: &Path) -> Result<()>

Remove all data associated with a file: file row, symbols, and related edges.

Provided Methods§

Source

fn symbols_for_files(&self, paths: &[&Path]) -> Result<Vec<SymbolNode>>

Returns symbols only for the specified file paths.

Source

fn edges_streaming( &self, callback: &mut dyn FnMut(Edge) -> Result<()>, ) -> Result<()>

Processes edges row-by-row via callback.

Implementors§