Skip to main content

WebSocketGatewayConnectionHook

Trait WebSocketGatewayConnectionHook 

Source
pub trait WebSocketGatewayConnectionHook:
    Send
    + Sync
    + 'static {
    // Required method
    fn handle_connection(
        &self,
        connection: WebSocketGatewayConnection,
    ) -> BoxFuture<'static, Result<()>>;
}
Expand description

Hook invoked when a WebSocket client connects to a gateway.

Required Methods§

Source

fn handle_connection( &self, connection: WebSocketGatewayConnection, ) -> BoxFuture<'static, Result<()>>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F, Fut> WebSocketGatewayConnectionHook for F
where F: Fn(WebSocketGatewayConnection) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<()>> + Send + 'static,