TransportFactory

Trait TransportFactory 

Source
pub trait TransportFactory:
    Send
    + Sync
    + 'static {
    type Transport: Transport + Send + Sync + 'static;

    // Required method
    fn connect_pair(    ) -> impl Future<Output = Result<(Self::Transport, Self::Transport), TestError>> + Send;
}
Expand description

Factory trait for creating transport pairs for testing.

Each transport implementation provides a factory that creates connected pairs of transports for testing.

Required Associated Types§

Source

type Transport: Transport + Send + Sync + 'static

The transport type being tested.

Required Methods§

Source

fn connect_pair() -> impl Future<Output = Result<(Self::Transport, Self::Transport), TestError>> + Send

Create a connected pair of transports.

Returns (client_side, server_side) where frames sent from client are received by server and vice versa.

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§