pub trait Transaction: Queryable {
    // Required methods
    fn commit<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn rollback<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn as_queryable(&self) -> &dyn Queryable;
}

Required Methods§

source

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

Commit the changes to the database and consume the transaction.

source

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

Rolls back the changes to the database.

source

fn as_queryable(&self) -> &dyn Queryable

workaround for lack of upcasting between traits https://github.com/rust-lang/rust/issues/65991

Implementors§