pub trait KeyValueDbTransactionTrait: KeyValueDbTraitSingleWriter + Drop {
    // Required methods
    fn commit(&mut self, db: &dyn Any) -> Result<()>;
    fn revert(&mut self) -> Result<()>;
    fn restart(&mut self, immediate_write: bool, no_revert: bool) -> Result<()>;
}

Required Methods§

source

fn commit(&mut self, db: &dyn Any) -> Result<()>

Commit may be retried upon failure.

source

fn revert(&mut self) -> Result<()>

source

fn restart(&mut self, immediate_write: bool, no_revert: bool) -> Result<()>

When error occured within a transaction before commit, user may have to revert the transaction and restart a new transaction.

When restart fails, user may retry with no_revert set to true.

Implementors§