Skip to main content

Crate nest_rs_ws_macros

Crate nest_rs_ws_macros 

Source
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 @WebSocketGateway analog. Generates from_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 from data, the return value serialized back under the same event (() => no reply).