Struct sea_orm::DatabaseTransaction [−][src]
pub struct DatabaseTransaction { /* fields omitted */ }
Implementations
Trait Implementations
fn transaction<'life0, 'async_trait, F, T, E>(
&'life0 self,
_callback: F
) -> Pin<Box<dyn Future<Output = Result<T, TransactionError<E>>> + Send + 'async_trait>> where
F: for<'c> FnOnce(&'c DatabaseTransaction) -> Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'c>> + Send,
T: Send,
E: Error + Send,
F: 'async_trait,
T: 'async_trait,
E: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn transaction<'life0, 'async_trait, F, T, E>(
&'life0 self,
_callback: F
) -> Pin<Box<dyn Future<Output = Result<T, TransactionError<E>>> + Send + 'async_trait>> where
F: for<'c> FnOnce(&'c DatabaseTransaction) -> Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'c>> + Send,
T: Send,
E: Error + Send,
F: 'async_trait,
T: 'async_trait,
E: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Execute the function inside a transaction. If the function returns an error, the transaction will be rolled back. If it does not return an error, the transaction will be committed.