Skip to main content

MemoryStore

Trait MemoryStore 

Source
pub trait MemoryStore: Send + Sync {
    // Required methods
    fn id(&self) -> MemoryStoreId;
    fn put<'life0, 'async_trait>(
        &'life0 self,
        record: MemoryRecord,
    ) -> Pin<Box<dyn Future<Output = Result<MemoryId>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 MemoryId,
    ) -> Pin<Box<dyn Future<Output = Result<Option<MemoryRecord>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn search<'life0, 'async_trait>(
        &'life0 self,
        query: MemoryQuery,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<MemorySearchResult>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 MemoryId,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn list<'life0, 'async_trait>(
        &'life0 self,
        scope: Option<MemoryScope>,
        limit: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryRecord>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}

Required Methods§

Source

fn id(&self) -> MemoryStoreId

Source

fn put<'life0, 'async_trait>( &'life0 self, record: MemoryRecord, ) -> Pin<Box<dyn Future<Output = Result<MemoryId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 MemoryId, ) -> Pin<Box<dyn Future<Output = Result<Option<MemoryRecord>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn search<'life0, 'async_trait>( &'life0 self, query: MemoryQuery, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemorySearchResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn delete<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 MemoryId, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

fn list<'life0, 'async_trait>( &'life0 self, scope: Option<MemoryScope>, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryRecord>>> + 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§