pub trait Connection {
// Required methods
fn receive(&mut self) -> impl Future<Output = Option<Message>> + Send;
fn send(
&mut self,
message: Message,
) -> impl Future<Output = Result<(), Error>> + Send;
}
Expand description
Abstraction around a websocket connection.
Built in implementations are provided for ws_stream_wasm
& async_tungstenite
.
If users wish to add support for a new client they should implement this trait.
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.