Skip to main content

MemoryObserver

Trait MemoryObserver 

Source
pub trait MemoryObserver: Send + Sync {
    // Required method
    fn on_memory_stored<'life0, 'async_trait>(
        &'life0 self,
        observation: MemoryObservation,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Host extension point invoked after a durable memory has been persisted.

Observer failures are logged but never roll back the memory write. This is intended for derived, auditable projections such as preference and workflow learning; the memory store remains the source of truth.

Required Methods§

Source

fn on_memory_stored<'life0, 'async_trait>( &'life0 self, observation: MemoryObservation, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§