Skip to main content

WebSocketInterceptor

Trait WebSocketInterceptor 

Source
pub trait WebSocketInterceptor:
    Send
    + Sync
    + 'static {
    // Provided methods
    fn before(
        &self,
        _context: WebSocketContext,
    ) -> BoxFuture<'static, Result<()>> { ... }
    fn after(
        &self,
        _context: WebSocketContext,
        reply: Option<WebSocketMessage>,
    ) -> BoxFuture<'static, Result<Option<WebSocketMessage>>> { ... }
}
Expand description

Around-handler hook for WebSocket gateway messages.

Provided Methods§

Source

fn before(&self, _context: WebSocketContext) -> BoxFuture<'static, Result<()>>

Source

fn after( &self, _context: WebSocketContext, reply: Option<WebSocketMessage>, ) -> BoxFuture<'static, Result<Option<WebSocketMessage>>>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§