pub trait Store {
// Required methods
fn index(
&mut self,
project_id: &str,
content: &str,
meta: &SessionMeta,
) -> Result<String, Error>;
fn search(
&mut self,
project_id: &str,
query: &str,
limit: usize,
) -> Result<Vec<SearchResult>, Error>;
fn delete_project(&mut self, project_id: &str) -> Result<usize, Error>;
fn cleanup_stale(
&mut self,
project_id: &str,
max_age_secs: i64,
) -> Result<usize, Error>;
}Expand description
Backend for storing and searching indexed command output.
Implementations can use different storage mechanisms (SQLite, Vipune, etc.) to persist and retrieve command output for later recall.
Required Methods§
Sourcefn index(
&mut self,
project_id: &str,
content: &str,
meta: &SessionMeta,
) -> Result<String, Error>
fn index( &mut self, project_id: &str, content: &str, meta: &SessionMeta, ) -> Result<String, Error>
Index a command output entry for later retrieval.
Returns the unique identifier of the indexed entry.
Sourcefn search(
&mut self,
project_id: &str,
query: &str,
limit: usize,
) -> Result<Vec<SearchResult>, Error>
fn search( &mut self, project_id: &str, query: &str, limit: usize, ) -> Result<Vec<SearchResult>, Error>
Search for indexed entries matching a query.
Returns up to limit results ordered by relevance.
Sourcefn delete_project(&mut self, project_id: &str) -> Result<usize, Error>
fn delete_project(&mut self, project_id: &str) -> Result<usize, Error>
Delete all entries for a project.
Removes every entry stored for project_id, regardless of the session
that indexed it, and including entries with NULL or unparseable
metadata — exactly the set search can return.
Returns the number of entries deleted.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".