pub struct Store { /* private fields */ }Implementations§
Source§impl Store
impl Store
pub fn save(&self, params: SaveParams) -> Result<SaveAction>
pub fn get(&self, id: i64) -> Result<Memory>
pub fn search(&self, params: SearchParams) -> Result<Vec<SearchResult>>
pub fn delete_scope(&self, scope: &str, hard: bool) -> Result<usize>
pub fn delete(&self, key: &str, scope: Option<&str>, hard: bool) -> Result<bool>
pub fn delete_by_id(&self, id: i64, hard: bool) -> Result<bool>
pub fn update( &self, id: i64, key: Option<&str>, value: Option<&str>, tags: Option<Vec<String>>, ) -> Result<Memory>
pub fn list( &self, scope: Option<&str>, source_type: Option<&SourceType>, limit: Option<i32>, ) -> Result<Vec<Memory>>
pub fn list_all( &self, scope: Option<&str>, source_type: Option<&SourceType>, ) -> Result<Vec<Memory>>
pub fn context( &self, scope: Option<&str>, limit: Option<i32>, ) -> Result<Vec<Memory>>
pub fn apply_confidence_decay(&self) -> Result<u32>
pub fn list_by_source_commit(&self) -> Result<Vec<Memory>>
Source§impl Store
impl Store
pub fn log_access( &self, action: &str, query: Option<&str>, memory_ids: &[i64], ) -> Result<()>
pub fn record_injection(&self, memory_ids: &[i64]) -> Result<()>
pub fn record_hit(&self, memory_id: i64) -> Result<()>
pub fn record_hit_batch(&self, memory_ids: &[i64]) -> Result<()>
Sourcepub fn cumulative_stats(&self) -> Result<TokenStats>
pub fn cumulative_stats(&self) -> Result<TokenStats>
Cumulative token stats across all time.
Sourcepub fn session_token_stats(&self, session_id: &str) -> Result<TokenStats>
pub fn session_token_stats(&self, session_id: &str) -> Result<TokenStats>
Token stats for a specific session (by time range from session start).
pub fn access_log_stats(&self) -> Result<Vec<(String, i64)>>
pub fn access_log_total(&self) -> Result<i64>
pub fn dedup_total(&self) -> Result<i64>
pub fn revision_total(&self) -> Result<i64>
pub fn low_roi_count(&self) -> Result<i64>
pub fn top_searches(&self, limit: i32) -> Result<Vec<(String, i64)>>
pub fn get_metrics(&self) -> Result<Vec<MemoryMetric>>
Source§impl Store
impl Store
Source§impl Store
impl Store
pub fn add_relation( &self, source_id: i64, target_id: i64, rel_type: RelationType, ) -> Result<i64>
pub fn get_relations(&self, memory_id: i64) -> Result<Vec<Relation>>
pub fn superseded_ids(&self) -> Result<HashSet<i64>>
Source§impl Store
impl Store
pub fn open( path: &str, config: Config, passphrase: Option<&str>, ) -> Result<Self>
pub fn open_in_memory() -> Result<Self>
pub fn open_in_memory_with_config(config: Config) -> Result<Self>
pub fn config(&self) -> &Config
pub fn get_metadata(&self, key: &str) -> Result<Option<String>>
pub fn set_metadata(&self, key: &str, value: &str) -> Result<()>
pub fn schema_version(&self) -> Result<i64>
Sourcepub fn is_encrypted(path: &str) -> bool
pub fn is_encrypted(path: &str) -> bool
Check if a database file is encrypted (requires encryption feature to detect).
Auto Trait Implementations§
impl !Freeze for Store
impl !RefUnwindSafe for Store
impl Send for Store
impl !Sync for Store
impl Unpin for Store
impl UnsafeUnpin for Store
impl UnwindSafe for Store
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