Memory

Trait Memory 

Source
pub trait Memory: Send + Sync {
    // Required methods
    fn set<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
        value: String,
    ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<String>, AgentError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait representing a generic memory store.

Required Methods§

Source

fn set<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, value: String, ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Store a value under a given key.

Source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, AgentError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve a value for a given key.

Implementors§