MemoryRepository

Trait MemoryRepository 

Source
pub trait MemoryRepository: Send + Sync {
    // Required methods
    fn get<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        user_id: &'life1 UserId,
        memory_id: &'life2 MemoryId,
    ) -> Pin<Box<dyn Future<Output = Result<Option<CanonicalMemory>, MemoryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn find_candidates<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        user_id: &'life1 UserId,
        selector: &'life2 ReconciliationSelector,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<CanonicalMemory>, MemoryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn all<'life0, 'life1, 'async_trait>(
        &'life0 self,
        user_id: &'life1 UserId,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<CanonicalMemory>, MemoryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn revision<'life0, 'life1, 'async_trait>(
        &'life0 self,
        user_id: &'life1 UserId,
    ) -> Pin<Box<dyn Future<Output = Result<u64, MemoryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn commit<'life0, 'async_trait>(
        &'life0 self,
        transaction: MemoryTransaction,
    ) -> Pin<Box<dyn Future<Output = Result<CommitReceipt, MemoryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Read and write access to canonical memory.

Required Methods§

Source

fn get<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, user_id: &'life1 UserId, memory_id: &'life2 MemoryId, ) -> Pin<Box<dyn Future<Output = Result<Option<CanonicalMemory>, MemoryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetch one record.

Source

fn find_candidates<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, user_id: &'life1 UserId, selector: &'life2 ReconciliationSelector, ) -> Pin<Box<dyn Future<Output = Result<Vec<CanonicalMemory>, MemoryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Find records a proposal should be reconciled against.

Source

fn all<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 UserId, ) -> Pin<Box<dyn Future<Output = Result<Vec<CanonicalMemory>, MemoryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Every record in the namespace, whatever its status.

Source

fn revision<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 UserId, ) -> Pin<Box<dyn Future<Output = Result<u64, MemoryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The namespace’s current revision.

Source

fn commit<'life0, 'async_trait>( &'life0 self, transaction: MemoryTransaction, ) -> Pin<Box<dyn Future<Output = Result<CommitReceipt, MemoryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Apply a transaction atomically.

Implementors§