Expand description
WebSocket gateway decorator macros. Generated code uses absolute paths so this crate does not depend on the surface crates.
#[subscribe_message("event")], #[on_connect], #[on_disconnect] are
inert attributes consumed by #[messages], same shape as the HTTP verb
attributes consumed by #[routes].
Attribute Macros§
- gateway
#[gateway(path = "/ws")]— the@WebSocketGatewayanalog. Generatesfrom_container,pub const PATH, and the inherent helpers#[messages]reads back.- messages
- Bind a
#[gateway]impl block’s message handlers. Each#[subscribe_message("event")]method handles{ "event": "...", "data": ... }; the owned parameter is deserialized fromdata, the return value serialized back under the same event (()=> no reply).