pub trait WsConnect {
type Stream;
type Sink;
// Required method
fn connect(
&mut self,
ws_url: Url,
) -> impl Future<Output = Result<(Self::Sink, Self::Stream)>> + Send + Sync;
}
Expand description
The WsConnect
trait allows for connecting to a websocket.
Implementors of the WsConnect
trait are called ‘connectors’.
Connectors are defined by one method, connect()
. A call to connect()
attempts to
establish a secure websocket connection and return an asynchronous stream of [Message
]s
wrapped in a Result
.
Required Associated Types§
Required Methods§
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.