pub struct AndThenHandler<DB, A, B, F>where
DB: DatabaseBackend + Send + Sync + Debug + 'static,
A: TransactionHandler<DB> + Send + Sync,
B: TransactionHandler<DB, Error = A::Error> + Send + Sync,
F: FnOnce(A::Item) -> B + Send + Sync + 'static,{ /* private fields */ }
Expand description
Handler that executes two handlers in sequence
Trait Implementations§
Source§impl<DB, A, B, F> TransactionHandler<DB> for AndThenHandler<DB, A, B, F>where
DB: DatabaseBackend + Send + Sync + Debug + 'static,
A: TransactionHandler<DB> + Send + Sync,
B: TransactionHandler<DB, Error = A::Error> + Send + Sync,
F: FnOnce(A::Item) -> B + Send + Sync + 'static,
impl<DB, A, B, F> TransactionHandler<DB> for AndThenHandler<DB, A, B, F>where
DB: DatabaseBackend + Send + Sync + Debug + 'static,
A: TransactionHandler<DB> + Send + Sync,
B: TransactionHandler<DB, Error = A::Error> + Send + Sync,
F: FnOnce(A::Item) -> B + Send + Sync + 'static,
Source§type Item = <B as TransactionHandler<DB>>::Item
type Item = <B as TransactionHandler<DB>>::Item
The result type of this handler
Source§type Error = <A as TransactionHandler<DB>>::Error
type Error = <A as TransactionHandler<DB>>::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, A, B, F> Freeze for AndThenHandler<DB, A, B, F>
impl<DB, A, B, F> RefUnwindSafe for AndThenHandler<DB, A, B, F>
impl<DB, A, B, F> Send for AndThenHandler<DB, A, B, F>
impl<DB, A, B, F> Sync for AndThenHandler<DB, A, B, F>
impl<DB, A, B, F> Unpin for AndThenHandler<DB, A, B, F>
impl<DB, A, B, F> UnwindSafe for AndThenHandler<DB, A, B, 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