Skip to main content

Module protocol

Module protocol 

Source
Expand description

Protocol-1 wire envelope encode/decode.

Structs§

Envelope
Unified {proto, type, method, params, id} envelope.
ErrorObject
Structured error nested under envelope.error.

Enums§

MessageType
Message class values for the envelope type field.

Constants§

CLIENT_VERSION
Client version reported in connection_init (crate version).
DEFAULT_CLIENT_CAPABILITIES
Default capabilities declared in the handshake.
PROTO_VERSION
Protocol version string.

Functions§

as_str
Coerce JSON value to string.
decode_message
Decode a WebSocket text frame into a JSON value.
expand_wire_messages
Expand event_batch frames into individual events.
new_connection_init
Build connection_init.
new_disconnect
Build disconnect notification.
new_notification
Build a notification envelope (no id).
new_ping
Build ping.
new_pong
Build pong.
new_request
Build a request envelope.
new_request_id
Generate a 32-hex request id (UUID without dashes).
new_subscribe
Build a subscribe envelope.
new_unsubscribe
Build an unsubscribe envelope.
params_map
Map helper: insert string.
unwrap_next
Unwrap a next envelope to its inner frame when possible.