pub struct InMemoryMemoryStore { /* private fields */ }Expand description
In-memory MemoryStore (dev and test): one map keyed by content
address. No persistence, no tenant concept — the honest reference for
the contract’s semantics.
Implementations§
Trait Implementations§
Source§impl Debug for InMemoryMemoryStore
impl Debug for InMemoryMemoryStore
Source§impl Default for InMemoryMemoryStore
impl Default for InMemoryMemoryStore
Source§impl MemoryStore for InMemoryMemoryStore
impl MemoryStore for InMemoryMemoryStore
Source§fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 MemoryRecord,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 MemoryRecord,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store
record under its content address. Idempotent: storing the
same record twice yields false (already present) and at most one
stored record — the Effect::Idempotent write converges by
construction, since the address is derived from content plus
provenance.Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
memory_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<MemoryRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
memory_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<MemoryRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch one record by content address (
None when absent).Source§fn all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The query universe: every record in the namespace. Retrieval
semantics live in
apply_query; dev-scale stores scan, and larger
backends pre-filter on columns before applying the same function.Source§fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
memory_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
memory_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove
memory_id from the store (false when absent). Forgetting
(R0.8 wave 2) is real deletion of derived state — journals are
hash-chained evidence and are never touched (open question 4’s
boundary).Source§fn query<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 MemoryQuery,
now: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 MemoryQuery,
now: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
The records matching
query, expiry evaluated at now. The default
implementation scans via MemoryStore::all and applies
apply_query; backends with column-mapped storage override the
scan, never the semantics.Auto Trait Implementations§
impl !Freeze for InMemoryMemoryStore
impl RefUnwindSafe for InMemoryMemoryStore
impl Send for InMemoryMemoryStore
impl Sync for InMemoryMemoryStore
impl Unpin for InMemoryMemoryStore
impl UnsafeUnpin for InMemoryMemoryStore
impl UnwindSafe for InMemoryMemoryStore
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