Expand description
JSON ↔ Rust codec and semantic event decomposition.
This module sits between the transport layer (raw WebSocket frames) and the session layer (typed events). It provides three operations:
encode— serialise aClientMessageto a JSON string for sending.decode— parse a JSON string from the wire into aServerMessage.into_events— decompose oneServerMessageinto aVec<ServerEvent>.
The split between decode and into_events allows the session layer to
inspect raw fields (e.g. session_resumption_update) before broadcasting
the higher-level events to the application.
Functions§
- decode
- Parse a JSON string from the wire into a
ServerMessage. - encode
- Serialise a
ClientMessageto its JSON wire representation. - into_
events - Decompose a single
ServerMessageinto a sequence of semanticServerEvents.