pub struct GraphStore { /* private fields */ }Implementations§
Source§impl GraphStore
impl GraphStore
Sourcepub fn open<P: AsRef<Path>>(path: P) -> Result<Self, StoreError>
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, StoreError>
Opens or creates a graph store at the specified path. Returns an error if the cache version doesn’t match.
Sourcepub fn open_or_reset<P: AsRef<Path>>(path: P) -> Result<Self, StoreError>
pub fn open_or_reset<P: AsRef<Path>>(path: P) -> Result<Self, StoreError>
Opens a store, clearing it if version mismatches.
Sourcepub fn get_mtime(&self, file_path: &str) -> Result<Option<u64>, StoreError>
pub fn get_mtime(&self, file_path: &str) -> Result<Option<u64>, StoreError>
Gets the stored mtime for a file.
Sourcepub fn get_file_nodes(
&self,
file_path: &str,
) -> Result<Option<Vec<CodeNode>>, StoreError>
pub fn get_file_nodes( &self, file_path: &str, ) -> Result<Option<Vec<CodeNode>>, StoreError>
Gets the stored nodes for a file.
Sourcepub fn update_file(
&self,
file_path: &str,
nodes: &[CodeNode],
mtime: u64,
) -> Result<(), StoreError>
pub fn update_file( &self, file_path: &str, nodes: &[CodeNode], mtime: u64, ) -> Result<(), StoreError>
Updates the nodes and mtime for a specific file.
This operation is atomic: it removes old nodes associated with the file and inserts the new ones.
Sourcepub fn remove_file(&self, file_path: &str) -> Result<(), StoreError>
pub fn remove_file(&self, file_path: &str) -> Result<(), StoreError>
Removes a file from the cache (for deleted files).
Sourcepub fn list_cached_files(&self) -> Result<Vec<String>, StoreError>
pub fn list_cached_files(&self) -> Result<Vec<String>, StoreError>
Lists all cached file paths.
Sourcepub fn load_graph(&self) -> Result<ArborGraph, StoreError>
pub fn load_graph(&self) -> Result<ArborGraph, StoreError>
Loads the entire graph from the store.
This iterates over all stored nodes and reconstructs the ArborGraph using the GraphBuilder (which re-links edges).
Sourcepub fn clear(&self) -> Result<(), StoreError>
pub fn clear(&self) -> Result<(), StoreError>
Clears the stored graph.
Auto Trait Implementations§
impl Freeze for GraphStore
impl !RefUnwindSafe for GraphStore
impl Send for GraphStore
impl Sync for GraphStore
impl Unpin for GraphStore
impl !UnwindSafe for GraphStore
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