Trait tc_transact::Transact

source ·
pub trait Transact {
    type Commit: Send + Sync;

    // Required methods
    fn commit<'life0, 'async_trait>(
        &'life0 self,
        txn_id: TxnId
    ) -> Pin<Box<dyn Future<Output = Self::Commit> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn rollback<'life0, 'life1, 'async_trait>(
        &'life0 self,
        txn_id: &'life1 TxnId
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn finalize<'life0, 'life1, 'async_trait>(
        &'life0 self,
        txn_id: &'life1 TxnId
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Transaction lifecycle callbacks

Required Associated Types§

source

type Commit: Send + Sync

A guard which blocks concurrent commits

Required Methods§

source

fn commit<'life0, 'async_trait>( &'life0 self, txn_id: TxnId ) -> Pin<Box<dyn Future<Output = Self::Commit> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Commit this transaction.

source

fn rollback<'life0, 'life1, 'async_trait>( &'life0 self, txn_id: &'life1 TxnId ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Roll back this transaction.

source

fn finalize<'life0, 'life1, 'async_trait>( &'life0 self, txn_id: &'life1 TxnId ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete any version data specific to this transaction.

Implementors§

source§

impl<FE, B> Transact for File<FE, B>
where FE: for<'a> FileSave<'a> + AsType<B> + Clone + Send + Sync, B: FileLoad + GetSize + Clone, Self: Send + Sync,

§

type Commit = ()