Skip to main content

MemoryStore

Trait MemoryStore 

Source
pub trait MemoryStore: Send + Sync {
    // Required methods
    fn save<'life0, 'life1, 'async_trait>(
        &'life0 self,
        who: &'life1 Requester,
        note: MemoryNote,
    ) -> Pin<Box<dyn Future<Output = Result<MemoryEntry, MemoryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list<'life0, 'life1, 'async_trait>(
        &'life0 self,
        who: &'life1 Requester,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryEntry>, MemoryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn forget<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        who: &'life1 Requester,
        id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<MemoryEntry, MemoryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided method
    fn note<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        who: &'life1 Requester,
        scope: MemoryScope,
        text: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<String, MemoryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}
Expand description

Saves, lists and forgets notes, always within the requester’s visibility.

Required Methods§

Source

fn save<'life0, 'life1, 'async_trait>( &'life0 self, who: &'life1 Requester, note: MemoryNote, ) -> Pin<Box<dyn Future<Output = Result<MemoryEntry, MemoryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Saves a note.

Source

fn list<'life0, 'life1, 'async_trait>( &'life0 self, who: &'life1 Requester, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryEntry>, MemoryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Notes visible to who: their own, their room’s and the team’s.

Source

fn forget<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, who: &'life1 Requester, id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<MemoryEntry, MemoryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Removes a note by id. Personal and room notes can be removed by anyone who sees them; team notes by their author (operators use okbot memory forget).

Provided Methods§

Source

fn note<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, who: &'life1 Requester, scope: MemoryScope, text: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<String, MemoryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Appends a quick note to today’s journal of who (User) or of the room (Room) and returns the journal’s id (design §5.9). Stores without a journal refuse.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§