pub trait WebSocketStreamHandler {
// Required methods
fn setup_stream(
&mut self,
stream: WebSocketStream<MaybeTlsStream<TcpStream>>,
) -> impl Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send;
fn handle_message(
&self,
message: Message,
) -> impl Future<Output = Result<Option<Message>, Box<dyn Error + Send + Sync>>> + Send;
}Expand description
Trait for types that can be used as WebSocket stream endpoints
Required Methods§
Sourcefn setup_stream(
&mut self,
stream: WebSocketStream<MaybeTlsStream<TcpStream>>,
) -> impl Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send
fn setup_stream( &mut self, stream: WebSocketStream<MaybeTlsStream<TcpStream>>, ) -> impl Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send
Setup the WebSocket stream
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.