StorageTestFixture

Trait StorageTestFixture 

Source
pub trait StorageTestFixture: Sized + Send {
    type Storage: Storage + Send + Sync + 'static;

    // Required methods
    fn setup() -> impl Future<Output = Self> + Send;
    fn storage(&self) -> &Self::Storage;

    // Provided method
    fn teardown(self) -> impl Future<Output = ()> + Send { ... }
}
Expand description

Trait for storage test fixtures.

Required Associated Types§

Source

type Storage: Storage + Send + Sync + 'static

The storage type being tested.

Required Methods§

Source

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

Setup the test fixture.

Source

fn storage(&self) -> &Self::Storage

Get reference to the storage adapter.

Provided Methods§

Source

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

Optional cleanup.

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§