Skip to main content

CacheDb

Struct CacheDb 

Source
pub struct CacheDb { /* private fields */ }

Implementations§

Source§

impl CacheDb

Source

pub fn open(path: &Path) -> Result<Self>

Source

pub fn open_in_memory() -> Result<Self>

Source

pub fn get_file_by_path(&self, path: &str) -> Result<Option<CachedFile>>

Source

pub fn upsert_file( &self, path: &str, language: &str, hash: &str, size_bytes: i64, loc: i64, ) -> Result<i64>

Source

pub fn delete_file(&self, path: &str) -> Result<()>

Source

pub fn insert_symbols(&self, file_id: i64, symbols: &[Symbol]) -> Result<()>

Source

pub fn insert_imports(&self, file_id: i64, imports: &[Import]) -> Result<()>

Source

pub fn insert_call_sites( &self, file_id: i64, call_sites: &[CallSite], ) -> Result<()>

Source

pub fn get_symbols_by_file(&self, file_id: i64) -> Result<Vec<Symbol>>

Source

pub fn get_imports_by_file(&self, file_id: i64) -> Result<Vec<CachedImport>>

Source

pub fn get_all_imports(&self) -> Result<Vec<CachedImport>>

Source

pub fn get_call_sites_by_file( &self, file_id: i64, ) -> Result<Vec<CachedCallSite>>

Source

pub fn get_all_call_sites(&self) -> Result<Vec<CachedCallSite>>

Source

pub fn clear_edges_by_kind(&self, kind: EdgeKind) -> Result<()>

Source

pub fn clear_symbol_edges_by_kind(&self, kind: &str) -> Result<()>

Source

pub fn clear_search_index(&self) -> Result<()>

Source

pub fn clear_search_vectors(&self, backend: Option<&str>) -> Result<()>

Source

pub fn has_search_vector(&self, node_id: i64, backend: &str) -> Result<bool>

Source

pub fn prune_search_vectors_to_index(&self, backend: &str) -> Result<()>

Source

pub fn insert_edge( &self, source_file_id: i64, target_file_id: Option<i64>, target_path: Option<&str>, kind: EdgeKind, confidence: f64, ) -> Result<()>

Source

pub fn get_edges_by_kind(&self, kind: EdgeKind) -> Result<Vec<CachedEdge>>

Source

pub fn insert_symbol_edges(&self, edges: &[CachedSymbolEdge]) -> Result<()>

Source

pub fn get_symbol_edges_by_kind( &self, kind: &str, ) -> Result<Vec<CachedSymbolEdge>>

Source

pub fn insert_search_document( &self, node_id: i64, file_path: &str, kind: &str, name: &str, signature: Option<&str>, doc_comment: Option<&str>, imports: &str, content: &str, ) -> Result<()>

Source

pub fn insert_search_vector( &self, node_id: i64, file_path: &str, kind: &str, name: &str, signature: Option<&str>, backend: &str, vector: &[f32], ) -> Result<()>

Source

pub fn search_nodes_fts( &self, query: &str, kind: Option<&str>, limit: usize, ) -> Result<Vec<CachedSearchHit>>

Source

pub fn get_search_vectors( &self, backend: &str, kind: Option<&str>, ) -> Result<Vec<CachedSearchVector>>

Source

pub fn set_config(&self, key: &str, value: &str) -> Result<()>

Source

pub fn get_config(&self, key: &str) -> Result<Option<String>>

Source

pub fn file_count(&self) -> Result<i64>

Source

pub fn symbol_count(&self) -> Result<i64>

Source

pub fn import_count(&self) -> Result<i64>

Source

pub fn call_site_count(&self) -> Result<i64>

Source

pub fn symbol_edge_count(&self) -> Result<i64>

Source

pub fn edge_count(&self) -> Result<i64>

Source

pub fn get_all_files(&self) -> Result<Vec<CachedFile>>

Source

pub fn language_stats(&self) -> Result<Vec<(String, i64)>>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.