pub struct SqliteRuntimeStore { /* private fields */ }Expand description
SQLite-backed RuntimeStore implementation used by default.
Implementations§
Source§impl SqliteRuntimeStore
impl SqliteRuntimeStore
Sourcepub fn default_path() -> PathBuf
pub fn default_path() -> PathBuf
Returns the default SQLite path used when no explicit store path is provided.
Sourcepub fn default_directory() -> PathBuf
pub fn default_directory() -> PathBuf
Returns the default directory used for Mentra runtime stores.
Sourcepub fn for_runtime_identifier(runtime_identifier: &str) -> Self
pub fn for_runtime_identifier(runtime_identifier: &str) -> Self
Creates a SQLite runtime store in the default directory using a runtime-scoped filename.
Sourcepub fn path_for_runtime_identifier(runtime_identifier: &str) -> PathBuf
pub fn path_for_runtime_identifier(runtime_identifier: &str) -> PathBuf
Returns the default SQLite path for a specific runtime identifier.
Sourcepub fn list_persisted_runtime_identifiers() -> Result<Vec<String>, RuntimeError>
pub fn list_persisted_runtime_identifiers() -> Result<Vec<String>, RuntimeError>
Lists runtime identifiers that have persisted SQLite stores in the default directory.
Trait Implementations§
Source§impl AgentStore for SqliteRuntimeStore
impl AgentStore for SqliteRuntimeStore
fn prepare_recovery(&self) -> Result<(), RuntimeError>
fn create_agent( &self, record: &PersistedAgentRecord, memory: &AgentMemoryState, ) -> Result<(), RuntimeError>
fn save_agent_record( &self, record: &PersistedAgentRecord, ) -> Result<(), RuntimeError>
fn save_agent_memory( &self, agent_id: &str, memory: &AgentMemoryState, ) -> Result<(), RuntimeError>
fn load_agent( &self, agent_id: &str, ) -> Result<Option<LoadedAgentState>, RuntimeError>
fn list_agents(&self) -> Result<Vec<LoadedAgentState>, RuntimeError>
fn list_agents_by_runtime( &self, runtime_identifier: &str, ) -> Result<Vec<LoadedAgentState>, RuntimeError>
Source§impl AuditStore for SqliteRuntimeStore
impl AuditStore for SqliteRuntimeStore
fn record_audit_event( &self, scope: &str, event_type: &str, payload: Value, ) -> Result<(), RuntimeError>
Source§impl BackgroundStore for SqliteRuntimeStore
impl BackgroundStore for SqliteRuntimeStore
fn load_background_tasks( &self, agent_id: &str, ) -> Result<Vec<BackgroundTaskSummary>, RuntimeError>
fn upsert_background_task( &self, agent_id: &str, task: &BackgroundTaskSummary, notification_state: i64, ) -> Result<(), RuntimeError>
fn drain_background_notifications( &self, agent_id: &str, ) -> Result<Vec<BackgroundNotification>, RuntimeError>
fn has_pending_background_notifications( &self, agent_id: &str, ) -> Result<bool, RuntimeError>
fn has_deliverable_background_notifications( &self, agent_id: &str, ) -> Result<bool, RuntimeError>
fn ack_background_notifications( &self, agent_id: &str, ) -> Result<(), RuntimeError>
fn requeue_background_notifications( &self, agent_id: &str, ) -> Result<(), RuntimeError>
Source§impl Clone for SqliteRuntimeStore
impl Clone for SqliteRuntimeStore
Source§fn clone(&self) -> SqliteRuntimeStore
fn clone(&self) -> SqliteRuntimeStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for SqliteRuntimeStore
impl Default for SqliteRuntimeStore
Source§impl LeaseStore for SqliteRuntimeStore
impl LeaseStore for SqliteRuntimeStore
fn acquire_lease( &self, key: &str, owner: &str, ttl: Duration, ) -> Result<bool, RuntimeError>
fn release_lease(&self, key: &str, owner: &str) -> Result<(), RuntimeError>
Source§impl MemoryStore for SqliteRuntimeStore
impl MemoryStore for SqliteRuntimeStore
fn upsert_records(&self, records: &[MemoryRecord]) -> Result<(), RuntimeError>
fn search_records_with_options( &self, request: &MemorySearchRequest, ) -> Result<Vec<MemoryRecord>, RuntimeError>
fn delete_records(&self, record_ids: &[String]) -> Result<(), RuntimeError>
fn tombstone_records( &self, agent_id: &str, record_ids: &[String], ) -> Result<usize, RuntimeError>
fn load_agent_memory_cursor( &self, agent_id: &str, ) -> Result<Option<MemoryCursor>, RuntimeError>
fn save_agent_memory_cursor( &self, agent_id: &str, cursor: &MemoryCursor, ) -> Result<(), RuntimeError>
fn search_records( &self, agent_id: &str, query: &str, limit: usize, ) -> Result<Vec<MemoryRecord>, RuntimeError>
Source§impl PermissionRuleStore for SqliteRuntimeStore
impl PermissionRuleStore for SqliteRuntimeStore
Source§fn save_rules(
&self,
session_id: &str,
project_id: Option<&str>,
rules: &[RememberedRule],
) -> Result<(), RuntimeError>
fn save_rules( &self, session_id: &str, project_id: Option<&str>, rules: &[RememberedRule], ) -> Result<(), RuntimeError>
Persists the provided permission rules for a session, replacing any
existing session-scoped rules.
project_id is stored alongside each
rule so that project-scoped rules can later be retrieved by other
sessions that share the same project.Source§fn load_rules(
&self,
session_id: &str,
project_id: Option<&str>,
) -> Result<Vec<RememberedRule>, RuntimeError>
fn load_rules( &self, session_id: &str, project_id: Option<&str>, ) -> Result<Vec<RememberedRule>, RuntimeError>
Loads all persisted permission rules that apply to the given session. Read more
Source§fn clear_rules(&self, session_id: &str) -> Result<(), RuntimeError>
fn clear_rules(&self, session_id: &str) -> Result<(), RuntimeError>
Removes all persisted permission rules for a session.
Source§impl RunStore for SqliteRuntimeStore
impl RunStore for SqliteRuntimeStore
fn start_run(&self, agent_id: &str) -> Result<String, RuntimeError>
fn update_run_state( &self, run_id: &str, state: &str, error: Option<&str>, ) -> Result<(), RuntimeError>
fn finish_run(&self, run_id: &str) -> Result<(), RuntimeError>
fn fail_run(&self, run_id: &str, error: &str) -> Result<(), RuntimeError>
Source§impl TaskStore for SqliteRuntimeStore
impl TaskStore for SqliteRuntimeStore
fn load_tasks(&self, namespace: &Path) -> Result<Vec<TaskItem>, RuntimeError>
fn capture_tasks( &self, namespace: &Path, ) -> Result<TaskStateSnapshot, RuntimeError>
fn restore_tasks( &self, namespace: &Path, snapshot: &TaskStateSnapshot, ) -> Result<(), RuntimeError>
fn replace_tasks( &self, namespace: &Path, tasks: &[TaskItem], ) -> Result<(), RuntimeError>
Auto Trait Implementations§
impl Freeze for SqliteRuntimeStore
impl RefUnwindSafe for SqliteRuntimeStore
impl Send for SqliteRuntimeStore
impl Sync for SqliteRuntimeStore
impl Unpin for SqliteRuntimeStore
impl UnsafeUnpin for SqliteRuntimeStore
impl UnwindSafe for SqliteRuntimeStore
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