Skip to main content

Module ws

Module ws 

Source
Expand description

WebSocket transport for JMAP (RFC 8887).

Provides connect_ws which establishes a WebSocket connection and returns a WsSession for sending and receiving frames.

URL source: Session::capabilities["urn:ietf:params:jmap:websocket"].url (the session document advertises the WebSocket endpoint).

Structs§

WsReceiver
Owning receive-half of a WebSocket connection (bd:JMAP-6r7c.31).
WsSender
Owning send-half of a WebSocket connection (bd:JMAP-6r7c.31).
WsSession
An established JMAP WebSocket session (RFC 8887).

Enums§

WsFrame
A parsed frame received from the JMAP WebSocket.

Constants§

DEFAULT_WS_MAX_MESSAGE_BYTES
Maximum WebSocket message size (1 MiB), consistent with the SSE frame limit. Prevents a misbehaving or hostile server from forcing the client to buffer large messages over the event connection. Default per-message / per-frame byte cap for WebSocket connections opened via connect_ws (which does not take a limit parameter). Callers that need a different cap should use connect_ws_with_limit or the crate::JmapClient::connect_ws_session convenience method which reads the max_ws_message field from ClientConfig. Default: 1 MiB.

Functions§

connect_ws
Open a JMAP WebSocket connection (RFC 8887).
connect_ws_with_limit
Establish a WebSocket connection with an explicit per-message / per-frame byte cap.