pub struct NativeMemoryStore { /* private fields */ }Implementations§
Source§impl NativeMemoryStore
impl NativeMemoryStore
pub fn new(root: impl Into<PathBuf>) -> Self
pub fn root(&self) -> &Path
pub fn global_path(&self) -> PathBuf
pub fn index_path(&self) -> PathBuf
pub fn from_global_path(path: &Path) -> Option<Self>
pub fn from_memory_anchor(path: &Path) -> Self
pub fn owner_scope() -> Scope
pub fn workspace_scope(id: &str) -> Result<Scope>
pub fn workspace_id(workspace: &Path) -> Result<Option<String>>
pub fn open_structured(&self) -> Result<Store>
pub fn remember( &self, scope: MemoryScope, workspace_id: Option<&str>, note: &str, ) -> Result<MemoryHit>
Sourcepub fn remember_reviewed(
&self,
scope: MemoryScope,
workspace_id: Option<&str>,
note: &str,
) -> Result<MemoryHit>
pub fn remember_reviewed( &self, scope: MemoryScope, workspace_id: Option<&str>, note: &str, ) -> Result<MemoryHit>
Authenticated operator surfaces (POST /v1/memory, the Lens remember
action): the explicit request IS the review, so the capture is promoted
in the same call, exactly as Action::Remember does. Model-reachable
paths must keep using remember, which can only propose a candidate.
pub fn revise( &self, scope: MemoryScope, workspace_id: Option<&str>, from: &str, to: &str, evidence: &str, ) -> Result<MemoryHit>
pub fn prompt_block( &self, workspace: &Path, max_entries: usize, max_chars: usize, ) -> Result<Option<String>>
Sourcepub fn prompt_block_traced(
&self,
workspace: &Path,
session_id: &str,
max_entries: usize,
max_chars: usize,
) -> Result<Option<String>>
pub fn prompt_block_traced( &self, workspace: &Path, session_id: &str, max_entries: usize, max_chars: usize, ) -> Result<Option<String>>
Like prompt_block, but the packet is prepared through the engine’s
durable receipt path: memory_contexts records which bytes and memory
revisions were assembled, under this session’s trace. The request key is
bound to the recall inputs, so an identical rebuild is idempotent while
changed inputs mint a new receipt. A receipt records preparation only —
append/dispatch acknowledgements remain the engine’s to make.
Receipt failure falls back to the same packet bytes without one: the receipt is observability, never a precondition for shipping context.
Sourcepub fn session_start(&self, workspace: &Path, session_id: &str) -> Result<usize>
pub fn session_start(&self, workspace: &Path, session_id: &str) -> Result<usize>
Run the session-start boundary for session_id. The hook plan maps it
to ReconcilePendingOperations, realized here as detection — contexts
this session prepared but never saw dispatch-acknowledged — because the
store owns the receipts and only a host can replay them. Completion is
recorded durably, so a restarted session reconciles once.
Returns the number of interrupted contexts found.
pub fn search(&self, query: &str, limit: usize) -> Result<Vec<MemoryHit>>
pub fn search_for_workspace( &self, workspace: &Path, query: &str, limit: usize, ) -> Result<Vec<MemoryHit>>
Sourcepub fn search_in_workspace(
&self,
workspace_id: Option<&str>,
workspace: &Path,
query: &str,
limit: usize,
) -> Result<Vec<MemoryHit>>
pub fn search_in_workspace( &self, workspace_id: Option<&str>, workspace: &Path, query: &str, limit: usize, ) -> Result<Vec<MemoryHit>>
Self::search_for_workspace for a caller that already resolved the
workspace’s memory identity.
pub fn get_for_workspace( &self, workspace: &Path, id: i64, ) -> Result<Option<MemoryHit>>
pub fn list_all( &self, scope: Option<MemoryScope>, workspace_id: Option<&str>, limit: usize, ) -> Result<Vec<MemoryHit>>
pub fn list_in_workspace( &self, scope: Option<MemoryScope>, workspace_id: Option<&str>, workspace: Option<&Path>, limit: usize, ) -> Result<Vec<MemoryHit>>
pub fn import_legacy(&self, path: &Path) -> Result<bool>
pub fn export(&self) -> Result<String>
pub fn reindex(&self) -> Result<usize>
pub fn delete_all( &self, scope: Option<MemoryScope>, workspace_id: Option<&str>, ) -> Result<()>
Trait Implementations§
Source§impl Clone for NativeMemoryStore
impl Clone for NativeMemoryStore
Auto Trait Implementations§
impl Forget for NativeMemoryStore
impl Freeze for NativeMemoryStore
impl Move for NativeMemoryStore
impl RefUnwindSafe for NativeMemoryStore
impl Send for NativeMemoryStore
impl Sync for NativeMemoryStore
impl Unpin for NativeMemoryStore
impl UnsafeUnpin for NativeMemoryStore
impl UnwindSafe for NativeMemoryStore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.