Trait AsyncTestContext

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

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

Required Methods§

Source

fn setup() -> impl Future<Output = Self> + Send

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

Provided Methods§

Source

fn teardown(self) -> impl Future<Output = ()> + Send

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§