ws

Attribute Macro ws 

Source
#[ws]
Expand description

Restricts function execution to WebSocket upgrade requests only.

This attribute macro ensures the decorated function only executes when the incoming request is a valid WebSocket upgrade request with proper request headers and protocol negotiation.

ยงUsage

use hyperlane::*;
use hyperlane_macros::*;

#[ws]
async fn handle_websocket(ctx: Context) {
    // WebSocket handling logic
}

The macro takes no parameters and should be applied directly to async functions that accept a Context parameter.