pub struct TestContext<DB>{
pub db: TestDatabaseInstance<DB>,
}
Expand description
A test context that contains a database instance
Fields§
§db: TestDatabaseInstance<DB>
Implementations§
Source§impl<DB> TestContext<DB>
impl<DB> TestContext<DB>
pub fn new(db: TestDatabaseInstance<DB>) -> Self
Trait Implementations§
Source§impl<DB> Clone for TestContext<DB>
impl<DB> Clone for TestContext<DB>
Source§fn clone(&self) -> TestContext<DB>
fn clone(&self) -> TestContext<DB>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<DB, T, Conn> DBTransactionManager<T, Conn> for TestContext<DB>where
DB: DatabaseBackend + Send + Sync + Debug + 'static,
T: DatabaseTransaction<Error = DB::Error> + Send + Sync + 'static,
Conn: TestDatabaseConnection + Send + Sync + 'static,
DB::Pool: DatabasePool<Connection = Conn, Error = DB::Error>,
impl<DB, T, Conn> DBTransactionManager<T, Conn> for TestContext<DB>where
DB: DatabaseBackend + Send + Sync + Debug + 'static,
T: DatabaseTransaction<Error = DB::Error> + Send + Sync + 'static,
Conn: TestDatabaseConnection + Send + Sync + 'static,
DB::Pool: DatabasePool<Connection = Conn, Error = DB::Error>,
Source§fn begin_transaction<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Self::Tx, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn begin_transaction<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Self::Tx, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Begin a new transaction
Source§fn commit_transaction<'life0, 'async_trait>(
tx: &'life0 mut Self::Tx,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn commit_transaction<'life0, 'async_trait>(
tx: &'life0 mut Self::Tx,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Commit a transaction
Source§fn rollback_transaction<'life0, 'async_trait>(
tx: &'life0 mut Self::Tx,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn rollback_transaction<'life0, 'async_trait>(
tx: &'life0 mut Self::Tx,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Rollback a transaction
Source§type Error = <DB as DatabaseBackend>::Error
type Error = <DB as DatabaseBackend>::Error
The error type for transaction operations
Source§impl<DB> Debug for TestContext<DB>
impl<DB> Debug for TestContext<DB>
Source§impl<DB> TransactionStarter<DB> for TestContext<DB>
impl<DB> TransactionStarter<DB> for TestContext<DB>
Source§type Transaction = MockTransactionFor<DB>
type Transaction = MockTransactionFor<DB>
The transaction type
Source§type Connection = MockConnectionFor<DB>
type Connection = MockConnectionFor<DB>
The connection type
Source§fn begin_transaction_type() -> Self::Transaction
fn begin_transaction_type() -> Self::Transaction
Begin a transaction
Auto Trait Implementations§
impl<DB> Freeze for TestContext<DB>
impl<DB> !RefUnwindSafe for TestContext<DB>
impl<DB> Send for TestContext<DB>
impl<DB> Sync for TestContext<DB>
impl<DB> Unpin for TestContext<DB>
impl<DB> !UnwindSafe for TestContext<DB>
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