pub struct DatabaseTransactionHandler<DB, F>{ /* private fields */ }
Expand description
Handler that combines a database instance with transaction management
Trait Implementations§
Source§impl<DB, F, Fut> IntoTransactionHandler<DB> for DatabaseTransactionHandler<DB, F>where
DB: DatabaseBackend + Send + Sync + Debug + 'static,
Fut: Future<Output = Result<(), DB::Error>> + Send + 'static,
F: FnOnce(&mut <DB as DatabaseBackend>::Connection) -> Fut + Send + Sync + 'static,
impl<DB, F, Fut> IntoTransactionHandler<DB> for DatabaseTransactionHandler<DB, F>where
DB: DatabaseBackend + Send + Sync + Debug + 'static,
Fut: Future<Output = Result<(), DB::Error>> + Send + 'static,
F: FnOnce(&mut <DB as DatabaseBackend>::Connection) -> Fut + Send + Sync + 'static,
Source§type Handler = DatabaseTransactionHandler<DB, F>
type Handler = DatabaseTransactionHandler<DB, F>
The handler type
Source§type Item = TestContext<DB>
type Item = TestContext<DB>
The result type
Source§type Error = <DB as DatabaseBackend>::Error
type Error = <DB as DatabaseBackend>::Error
The error type
Source§fn into_transaction_handler(self) -> Self::Handler
fn into_transaction_handler(self) -> Self::Handler
Convert this type into a transaction handler
Source§impl<DB, F, Fut> TransactionHandler<DB> for DatabaseTransactionHandler<DB, F>where
DB: DatabaseBackend + Send + Sync + Debug + 'static,
Fut: Future<Output = Result<(), DB::Error>> + Send + 'static,
F: FnOnce(&mut <DB as DatabaseBackend>::Connection) -> Fut + Send + Sync + 'static,
impl<DB, F, Fut> TransactionHandler<DB> for DatabaseTransactionHandler<DB, F>where
DB: DatabaseBackend + Send + Sync + Debug + 'static,
Fut: Future<Output = Result<(), DB::Error>> + Send + 'static,
F: FnOnce(&mut <DB as DatabaseBackend>::Connection) -> Fut + Send + Sync + 'static,
Source§type Item = TestContext<DB>
type Item = TestContext<DB>
The result type of this handler
Source§type Error = <DB as DatabaseBackend>::Error
type Error = <DB as DatabaseBackend>::Error
The error type
Source§fn execute<'life0, 'async_trait>(
self,
_ctx: &'life0 mut TestContext<DB>,
) -> Pin<Box<dyn Future<Output = Result<Self::Item, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
self,
_ctx: &'life0 mut TestContext<DB>,
) -> Pin<Box<dyn Future<Output = Result<Self::Item, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the handler with the given context
Source§fn execute_standalone<'async_trait>(
self,
backend: DB,
) -> Pin<Box<dyn Future<Output = Result<Self::Item, Self::Error>> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
fn execute_standalone<'async_trait>(
self,
backend: DB,
) -> Pin<Box<dyn Future<Output = Result<Self::Item, Self::Error>> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
Execute this handler with a new context Read more
Source§fn and_then<F, B>(self, f: F) -> AndThenHandler<DB, Self, B, F>
fn and_then<F, B>(self, f: F) -> AndThenHandler<DB, Self, B, F>
Chain two handlers together, where the second handler may depend on the result of the first
Source§fn setup<S, Fut, E>(
self,
setup_fn: S,
) -> impl TransactionHandler<DB, Item = (), Error = Self::Error>
fn setup<S, Fut, E>( self, setup_fn: S, ) -> impl TransactionHandler<DB, Item = (), Error = Self::Error>
Add a setup operation to this handler
Source§fn with_transaction<F, Fut, E>(
self,
transaction_fn: F,
) -> impl TransactionHandler<DB, Item = (), Error = Self::Error>
fn with_transaction<F, Fut, E>( self, transaction_fn: F, ) -> impl TransactionHandler<DB, Item = (), Error = Self::Error>
Add a transaction operation to this handler
Source§fn with_db_transaction<F, Fut, E>(
self,
db: TestDatabaseInstance<DB>,
transaction_fn: F,
) -> impl TransactionHandler<DB, Item = TestContext<DB>, Error = Self::Error>
fn with_db_transaction<F, Fut, E>( self, db: TestDatabaseInstance<DB>, transaction_fn: F, ) -> impl TransactionHandler<DB, Item = TestContext<DB>, Error = Self::Error>
Create a database transaction handler from this handler
Auto Trait Implementations§
impl<DB, F> Freeze for DatabaseTransactionHandler<DB, F>
impl<DB, F> !RefUnwindSafe for DatabaseTransactionHandler<DB, F>
impl<DB, F> Send for DatabaseTransactionHandler<DB, F>
impl<DB, F> Sync for DatabaseTransactionHandler<DB, F>
impl<DB, F> Unpin for DatabaseTransactionHandler<DB, F>
impl<DB, F> !UnwindSafe for DatabaseTransactionHandler<DB, F>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more