pub trait CommandMemoryContext {
Show 13 methods
// Required methods
fn memory_path(&self) -> PathBuf;
fn memory_enabled(&self) -> bool;
fn status(&self) -> Result<MemoryStatus, String>;
fn path(&self) -> Result<PathBuf, String>;
fn workspace_id(&self, workspace: &Path) -> Result<String, String>;
fn search(
&self,
workspace: &Path,
query: &str,
limit: usize,
) -> Result<Vec<MemoryHit>, String>;
fn remember(
&self,
target: MemoryRememberTarget,
note: &str,
) -> Result<MemoryRemembered, String>;
fn import(&self) -> Result<MemoryImportOutcome, String>;
fn get(&self, workspace: &Path, id: i64) -> Result<MemoryGetOutcome, String>;
fn export(&self) -> Result<MemoryExport, String>;
fn reindex(&self) -> Result<MemoryReindex, String>;
fn delete(&self, scope: MemoryDeleteScope) -> Result<MemoryDelete, String>;
fn delete_workspace(&self, workspace: &Path) -> Result<MemoryDelete, String>;
}Expand description
Host memory data for the memory command group (FEAT-019 D1).
Exposes the resolved user-memory file path, the enablement flag, and one typed method per exposed native-memory operation. All results are contract-owned portable values; implementation errors cross as safe text. Workspace-scoped operations take the borrowed workspace path as their first argument (D8); non-workspace operations never receive workspace authority and the facet never captures or retains workspace state internally.
Required Methods§
Sourcefn memory_path(&self) -> PathBuf
fn memory_path(&self) -> PathBuf
The resolved user-memory file path.
Sourcefn memory_enabled(&self) -> bool
fn memory_enabled(&self) -> bool
Whether the [memory] enabled / DEEPSEEK_MEMORY=on flag is set.
Sourcefn status(&self) -> Result<MemoryStatus, String>
fn status(&self) -> Result<MemoryStatus, String>
Native-memory root, global source, and index paths.
Sourcefn workspace_id(&self, workspace: &Path) -> Result<String, String>
fn workspace_id(&self, workspace: &Path) -> Result<String, String>
Workspace identity for the given workspace path.
Sourcefn search(
&self,
workspace: &Path,
query: &str,
limit: usize,
) -> Result<Vec<MemoryHit>, String>
fn search( &self, workspace: &Path, query: &str, limit: usize, ) -> Result<Vec<MemoryHit>, String>
Workspace-scoped search over the native-memory store.
Sourcefn remember(
&self,
target: MemoryRememberTarget,
note: &str,
) -> Result<MemoryRemembered, String>
fn remember( &self, target: MemoryRememberTarget, note: &str, ) -> Result<MemoryRemembered, String>
Append a reviewed note to the typed global or workspace target.
Sourcefn import(&self) -> Result<MemoryImportOutcome, String>
fn import(&self) -> Result<MemoryImportOutcome, String>
Import legacy memory; distinguishes imported from skipped.
Sourcefn get(&self, workspace: &Path, id: i64) -> Result<MemoryGetOutcome, String>
fn get(&self, workspace: &Path, id: i64) -> Result<MemoryGetOutcome, String>
Workspace-scoped get by entry id; not-found is a typed outcome.
Sourcefn export(&self) -> Result<MemoryExport, String>
fn export(&self) -> Result<MemoryExport, String>
Export the native-memory document content.
Sourcefn reindex(&self) -> Result<MemoryReindex, String>
fn reindex(&self) -> Result<MemoryReindex, String>
Reindex the native-memory store; returns the indexed entry count.
Sourcefn delete(&self, scope: MemoryDeleteScope) -> Result<MemoryDelete, String>
fn delete(&self, scope: MemoryDeleteScope) -> Result<MemoryDelete, String>
Delete all or global scope; never receives workspace authority.
Sourcefn delete_workspace(&self, workspace: &Path) -> Result<MemoryDelete, String>
fn delete_workspace(&self, workspace: &Path) -> Result<MemoryDelete, String>
Delete the given workspace scope; workspace path is the first argument.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".