pub trait WebSocketHandler:
Send
+ Sync
+ 'static {
// Required method
fn handle_connection(
&self,
id: ConnectionId,
connection: Arc<WebSocketConnection>,
) -> impl Future<Output = ()> + Send;
}
Expand description
WebSocket handler trait for user-defined handlers
Required Methods§
Sourcefn handle_connection(
&self,
id: ConnectionId,
connection: Arc<WebSocketConnection>,
) -> impl Future<Output = ()> + Send
fn handle_connection( &self, id: ConnectionId, connection: Arc<WebSocketConnection>, ) -> impl Future<Output = ()> + Send
Handle a new WebSocket 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.