pub trait AsyncTestContext
where Self: Sized,
{ // Required method fn setup<'async_trait>( ) -> Pin<Box<dyn Future<Output = Self> + Send + 'async_trait>> where Self: 'async_trait; // Provided method fn teardown<'async_trait>( self ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: Send + 'async_trait { ... } }
Expand description

The trait to implement to get setup/teardown functionality for async tests.

Required Methods§

source

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

Create the context. This is run once before each test that uses the context.

Provided Methods§

source

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

Perform any additional cleanup of the context besides that already provided by normal “drop” semantics.

Object Safety§

This trait is not object safe.

Implementors§