Skip to main content

Persistence

Trait Persistence 

Source
pub trait Persistence: Send + Sync {
    // Required methods
    fn persist_transaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        tr: &'life1 Transaction,
        doc_id: &'life2 str,
        context_meta: &'life3 Value,
    ) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn load_state<'life0, 'life1, 'async_trait>(
        &'life0 self,
        doc_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<LoadedState>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn checkpoint_if_needed<'life0, 'life1, 'async_trait>(
        &'life0 self,
        doc_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

高层持久化编排:事务持久化与快照检查点。

Required Methods§

Source

fn persist_transaction<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, tr: &'life1 Transaction, doc_id: &'life2 str, context_meta: &'life3 Value, ) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn load_state<'life0, 'life1, 'async_trait>( &'life0 self, doc_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<LoadedState>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§