pub trait DatabaseTransaction: Send + Sync {
// Required methods
fn execute<'life0, 'async_trait>(
&'life0 self,
query: DatabaseQuery,
) -> Pin<Box<dyn Future<Output = AppResult<DatabaseResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn commit<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>
where Self: 'async_trait;
fn rollback<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>
where Self: 'async_trait;
}Expand description
Active database transaction.
Required Methods§
Sourcefn execute<'life0, 'async_trait>(
&'life0 self,
query: DatabaseQuery,
) -> Pin<Box<dyn Future<Output = AppResult<DatabaseResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
query: DatabaseQuery,
) -> Pin<Box<dyn Future<Output = AppResult<DatabaseResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute a statement inside the transaction.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".