pub trait CacheStore {
// Required methods
fn init(&self) -> Result<()>;
fn upsert_file(&self, path: &str, hash: &str, content: &[u8]) -> Result<i64>;
fn get_file_hash(&self, path: &str) -> Result<Option<String>>;
fn insert_symbol(&self, symbol: &Symbol) -> Result<()>;
fn get_symbol_content(&self, symbol_id: &str) -> Result<Option<Vec<u8>>>;
fn delete_file(&self, path: &str) -> Result<()>;
}Required Methods§
Sourcefn upsert_file(&self, path: &str, hash: &str, content: &[u8]) -> Result<i64>
fn upsert_file(&self, path: &str, hash: &str, content: &[u8]) -> Result<i64>
Insert or update a file and its content. Returns the file_id.
Sourcefn get_file_hash(&self, path: &str) -> Result<Option<String>>
fn get_file_hash(&self, path: &str) -> Result<Option<String>>
Get a file’s hash to check if it has changed
Sourcefn insert_symbol(&self, symbol: &Symbol) -> Result<()>
fn insert_symbol(&self, symbol: &Symbol) -> Result<()>
Insert a symbol
Sourcefn get_symbol_content(&self, symbol_id: &str) -> Result<Option<Vec<u8>>>
fn get_symbol_content(&self, symbol_id: &str) -> Result<Option<Vec<u8>>>
Retrieve the raw bytes of a symbol using SQLite substr()
Sourcefn delete_file(&self, path: &str) -> Result<()>
fn delete_file(&self, path: &str) -> Result<()>
Delete a file and cascade delete its symbols