Skip to main content

Transaction

Trait Transaction 

Source
pub trait Transaction {
    // Required methods
    fn commit(self) -> Result<()>;
    fn rollback(self) -> Result<()>;
}
Expand description

A scoped database transaction. Commits on .commit(), rolls back on drop if not committed.

Transaction does NOT implement the Reader/Writer traits directly because those require Send + Sync (for Arc<dyn Trait> usage). Instead, Transaction provides equivalent methods that execute against the held connection. Domain-specific methods are added as each write path is extracted.

Required Methods§

Source

fn commit(self) -> Result<()>

Source

fn rollback(self) -> Result<()>

Implementors§