Skip to main content

MemoryStore

Trait MemoryStore 

Source
pub trait MemoryStore:
    Send
    + Sync
    + Debug {
    // Required methods
    fn load<'a>(
        &'a self,
        scope: &'a MemoryScope,
    ) -> BoxFuture<'a, Result<Vec<MemoryBlock>, AgentError>>;
    fn apply<'a>(
        &'a self,
        scope: &'a MemoryScope,
        op: MemoryOp,
    ) -> BoxFuture<'a, Result<MemoryBlock, AgentError>>;
}
Expand description

Persistence for memory blocks.

Required Methods§

Source

fn load<'a>( &'a self, scope: &'a MemoryScope, ) -> BoxFuture<'a, Result<Vec<MemoryBlock>, AgentError>>

Load every block for a scope. A new scope gets the store’s default (empty) blocks.

Source

fn apply<'a>( &'a self, scope: &'a MemoryScope, op: MemoryOp, ) -> BoxFuture<'a, Result<MemoryBlock, AgentError>>

Apply one edit and persist it. Implementations call apply_op so the rules match everywhere.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§