MessageConnector

Trait MessageConnector 

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

    // Required method
    fn connect(&self) -> impl Future<Output = Result<Self::Transport>> + Send;
}
Expand description

A factory that creates new message-based connections on demand.

Used by connect_framed() for reconnection with transports that already provide message framing (like WebSocket).

Required Associated Types§

Source

type Transport: MessageTransport

The message transport type (e.g., WsTransport).

Required Methods§

Source

fn connect(&self) -> impl Future<Output = Result<Self::Transport>> + Send

Establish a new connection.

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§