Skip to main content

TestConnectionExt

Trait TestConnectionExt 

Source
pub trait TestConnectionExt: Sized {
    type Error;

    // Required methods
    fn begin_test_transaction<'async_trait>(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<TestTransaction<Self>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait;
    fn commit_transaction<'async_trait>(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait;
    fn rollback_transaction<'async_trait>(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait;
}
Expand description

Trait for types that can be used as test transaction connections.

Required Associated Types§

Source

type Error

The error type.

Required Methods§

Source

fn begin_test_transaction<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<TestTransaction<Self>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,

Begin a new transaction that will rollback on drop.

Source

fn commit_transaction<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,

Commit the transaction explicitly.

Source

fn rollback_transaction<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,

Rollback the transaction explicitly.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§