Skip to main content

InMemoryRepository

Struct InMemoryRepository 

Source
pub struct InMemoryRepository { /* private fields */ }
Expand description

In-memory executable reference implementation of MemoryRepository.

Implementations§

Source§

impl InMemoryRepository

Source

pub fn new() -> Self

Source

pub async fn snapshot(&self) -> MemoryRepositorySnapshot

Capture deterministic visible state for conformance and diagnostics.

Trait Implementations§

Source§

impl Debug for InMemoryRepository

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for InMemoryRepository

Source§

fn default() -> InMemoryRepository

Returns the “default value” for a type. Read more
Source§

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,

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,

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,

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,

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,

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,

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,

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,

Return explicit admission and use counts for a node.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.