Trait DatabaseHandler

Source
pub trait DatabaseHandler<DB>: Send + Sync
where DB: DatabaseBackend + Send + Sync + Debug + 'static,
{ // Required method fn execute<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 mut TestContext<DB>, ) -> Pin<Box<dyn Future<Output = Result<(), DB::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; }
Expand description

Trait for handlers that can be executed in the context of a database

Required Methods§

Source

fn execute<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 mut TestContext<DB>, ) -> Pin<Box<dyn Future<Output = Result<(), DB::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute the handler with the given context

Implementors§

Source§

impl<DB, F, Fut> DatabaseHandler<DB> for F
where DB: DatabaseBackend + Send + Sync + Debug + 'static, F: FnOnce(&mut TestContext<DB>) -> Fut + Send + Sync + Clone, Fut: Future<Output = Result<(), DB::Error>> + Send + 'static,