pub trait TransactionExt {
// Required methods
fn transaction<'life0, 'async_trait, F, T, Fut>(
&'life0 self,
f: F,
) -> Pin<Box<dyn Future<Output = Result<T, FrameworkError>> + Send + 'async_trait>>
where F: FnOnce(&DatabaseTransaction) -> Fut + Send + 'async_trait,
Fut: Future<Output = Result<T, FrameworkError>> + Send + 'async_trait,
T: Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait;
fn transaction_with<'life0, 'async_trait, F, T, Fut>(
&'life0 self,
isolation_level: IsolationLevel,
f: F,
) -> Pin<Box<dyn Future<Output = Result<T, FrameworkError>> + Send + 'async_trait>>
where F: FnOnce(&DatabaseTransaction) -> Fut + Send + 'async_trait,
Fut: Future<Output = Result<T, FrameworkError>> + Send + 'async_trait,
T: Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Extension trait for running transactions on a database connection
Required Methods§
Sourcefn transaction<'life0, 'async_trait, F, T, Fut>(
&'life0 self,
f: F,
) -> Pin<Box<dyn Future<Output = Result<T, FrameworkError>> + Send + 'async_trait>>where
F: FnOnce(&DatabaseTransaction) -> Fut + Send + 'async_trait,
Fut: Future<Output = Result<T, FrameworkError>> + Send + 'async_trait,
T: Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
fn transaction<'life0, 'async_trait, F, T, Fut>(
&'life0 self,
f: F,
) -> Pin<Box<dyn Future<Output = Result<T, FrameworkError>> + Send + 'async_trait>>where
F: FnOnce(&DatabaseTransaction) -> Fut + Send + 'async_trait,
Fut: Future<Output = Result<T, FrameworkError>> + Send + 'async_trait,
T: Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn transaction_with<'life0, 'async_trait, F, T, Fut>(
&'life0 self,
isolation_level: IsolationLevel,
f: F,
) -> Pin<Box<dyn Future<Output = Result<T, FrameworkError>> + Send + 'async_trait>>where
F: FnOnce(&DatabaseTransaction) -> Fut + Send + 'async_trait,
Fut: Future<Output = Result<T, FrameworkError>> + Send + 'async_trait,
T: Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
fn transaction_with<'life0, 'async_trait, F, T, Fut>(
&'life0 self,
isolation_level: IsolationLevel,
f: F,
) -> Pin<Box<dyn Future<Output = Result<T, FrameworkError>> + Send + 'async_trait>>where
F: FnOnce(&DatabaseTransaction) -> Fut + Send + 'async_trait,
Fut: Future<Output = Result<T, FrameworkError>> + Send + 'async_trait,
T: Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
Execute a closure within a transaction with custom isolation level
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.