pub struct InMemoryRepository { /* private fields */ }Expand description
In-memory executable reference implementation of MemoryRepository.
Implementations§
Source§impl InMemoryRepository
impl InMemoryRepository
pub fn new() -> Self
Sourcepub async fn snapshot(&self) -> MemoryRepositorySnapshot
pub async fn snapshot(&self) -> MemoryRepositorySnapshot
Capture deterministic visible state for conformance and diagnostics.
Trait Implementations§
Source§impl Debug for InMemoryRepository
impl Debug for InMemoryRepository
Source§impl Default for InMemoryRepository
impl Default for InMemoryRepository
Source§fn default() -> InMemoryRepository
fn default() -> InMemoryRepository
Returns the “default value” for a type. Read more
Source§impl MemoryRepository for InMemoryRepository
impl MemoryRepository for InMemoryRepository
Source§fn apply<'life0, 'async_trait>(
&'life0 self,
change_set: MemoryChangeSet,
) -> Pin<Box<dyn Future<Output = Result<MemoryChangeResult, MemoryRepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn apply<'life0, 'async_trait>(
&'life0 self,
change_set: MemoryChangeSet,
) -> Pin<Box<dyn Future<Output = Result<MemoryChangeResult, MemoryRepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Atomically apply a bounded, revision-checked change set.
Source§fn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 MemoryNamespace,
node_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<MemoryNode>, MemoryRepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 MemoryNamespace,
node_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<MemoryNode>, MemoryRepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Read one node from an exact namespace without recording access.
Source§fn query<'life0, 'async_trait>(
&'life0 self,
query: MemoryQuery,
) -> Pin<Box<dyn Future<Output = Result<MemoryQueryResult, MemoryRepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn query<'life0, 'async_trait>(
&'life0 self,
query: MemoryQuery,
) -> Pin<Box<dyn Future<Output = Result<MemoryQueryResult, MemoryRepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Query one exact namespace without mutating repository state.
Source§fn snapshot_namespace<'life0, 'async_trait>(
&'life0 self,
request: MemorySnapshotRequest,
) -> Pin<Box<dyn Future<Output = Result<MemoryNamespaceSnapshot, MemoryRepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn snapshot_namespace<'life0, 'async_trait>(
&'life0 self,
request: MemorySnapshotRequest,
) -> Pin<Box<dyn Future<Output = Result<MemoryNamespaceSnapshot, MemoryRepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Capture one complete, bounded, deterministic namespace view. Read more
Source§fn namespace_change_token<'life0, 'life1, 'async_trait>(
&'life0 self,
namespace: &'life1 MemoryNamespace,
) -> Pin<Box<dyn Future<Output = Result<Option<MemoryNamespaceChangeToken>, MemoryRepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn namespace_change_token<'life0, 'life1, 'async_trait>(
&'life0 self,
namespace: &'life1 MemoryNamespace,
) -> Pin<Box<dyn Future<Output = Result<Option<MemoryNamespaceChangeToken>, MemoryRepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return an optional exact-namespace change token. Read more
Source§fn record_admission<'life0, 'async_trait>(
&'life0 self,
event: MemoryAccessEvent,
) -> Pin<Box<dyn Future<Output = Result<(), MemoryRepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn record_admission<'life0, 'async_trait>(
&'life0 self,
event: MemoryAccessEvent,
) -> Pin<Box<dyn Future<Output = Result<(), MemoryRepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Record that the host admitted the current active node revision into a model context.
Source§fn record_use<'life0, 'async_trait>(
&'life0 self,
event: MemoryAccessEvent,
) -> Pin<Box<dyn Future<Output = Result<(), MemoryRepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn record_use<'life0, 'async_trait>(
&'life0 self,
event: MemoryAccessEvent,
) -> Pin<Box<dyn Future<Output = Result<(), MemoryRepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Record that the host cited, selected, or otherwise used a node.
Source§fn usage_summary<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 MemoryNamespace,
node_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<MemoryUsageSummary, MemoryRepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn usage_summary<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 MemoryNamespace,
node_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<MemoryUsageSummary, MemoryRepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Return explicit admission and use counts for a node.
Auto Trait Implementations§
impl !Freeze for InMemoryRepository
impl !RefUnwindSafe for InMemoryRepository
impl Send for InMemoryRepository
impl Sync for InMemoryRepository
impl Unpin for InMemoryRepository
impl UnsafeUnpin for InMemoryRepository
impl UnwindSafe for InMemoryRepository
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