pub struct InMemoryGraphStore {
pub files: Vec<FileNode>,
pub symbols: Vec<SymbolNode>,
pub edges: Vec<Edge>,
pub symbols_for_files_calls: AtomicUsize,
pub edges_streaming_calls: AtomicUsize,
}Expand description
In-memory implementation of GraphStore + SearchIndex for testing.
Fields§
§files: Vec<FileNode>§symbols: Vec<SymbolNode>§edges: Vec<Edge>§symbols_for_files_calls: AtomicUsize§edges_streaming_calls: AtomicUsizeImplementations§
Source§impl InMemoryGraphStore
impl InMemoryGraphStore
pub fn new() -> Self
pub fn insert_file(&mut self, file: FileNode)
pub fn insert_symbol(&mut self, symbol: SymbolNode)
pub fn insert_edge(&mut self, edge: Edge)
Trait Implementations§
Source§impl Clone for InMemoryGraphStore
impl Clone for InMemoryGraphStore
Source§impl Default for InMemoryGraphStore
impl Default for InMemoryGraphStore
Source§impl GraphStore for InMemoryGraphStore
impl GraphStore for InMemoryGraphStore
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>>
Source§fn symbols_for_files(&self, paths: &[&Path]) -> Result<Vec<SymbolNode>>
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<()>
fn edges_streaming( &self, callback: &mut dyn FnMut(Edge) -> Result<()>, ) -> Result<()>
Processes edges row-by-row via callback.
Source§fn store_file_data(
&self,
_file: &FileNode,
_symbols: &[SymbolNode],
_edges: &[Edge],
) -> Result<()>
fn store_file_data( &self, _file: &FileNode, _symbols: &[SymbolNode], _edges: &[Edge], ) -> Result<()>
Store a file and all its symbols and edges atomically.
Source§impl SearchIndex for InMemoryGraphStore
impl SearchIndex for InMemoryGraphStore
Auto Trait Implementations§
impl !Freeze for InMemoryGraphStore
impl RefUnwindSafe for InMemoryGraphStore
impl Send for InMemoryGraphStore
impl Sync for InMemoryGraphStore
impl Unpin for InMemoryGraphStore
impl UnsafeUnpin for InMemoryGraphStore
impl UnwindSafe for InMemoryGraphStore
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