Skip to main content

Module codec

Module codec 

Source
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:

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 ClientMessage to its JSON wire representation.
into_events
Decompose a single ServerMessage into a sequence of semantic ServerEvents.