Skip to main content

Module protocol

Module protocol 

Expand description

Wire protocol used between the daemon and clients.

Defines the tagged-envelope message framing for the daemon-to-client direction over the named pipe, the lightweight message enum used by both ends, and the byte-level (de)serialization of the payloads.

Each daemon-to-client message on the wire has the form [1 byte tag][payload of tag-specific length]. The client-to-daemon direction (4-byte PID handshake) is handled separately and does not use this envelope.

Modules§

deserialization
serialization

Enums§

ClientState
Runtime state of a single client.
DaemonToClientMessage
Daemon-to-client message variants exchanged over the named pipe.

Constants§

FRAMED_HIGHLIGHT_LENGTH
Length on the wire of a framed highlight message: the tag byte plus a single-byte boolean payload (0 = not highlighted, 1 = highlighted).
FRAMED_INPUT_RECORD_LENGTH
Length on the wire of a framed input-record message: the tag byte plus the existing SERIALIZED_INPUT_RECORD_0_LENGTH-byte payload.
FRAMED_KEEP_ALIVE_LENGTH
Length on the wire of a framed keep-alive message: just the tag byte.
FRAMED_STATE_CHANGE_LENGTH
Length on the wire of a framed state-change message: the tag byte plus a single-byte ClientState payload.
SERIALIZED_INPUT_RECORD_0_LENGTH
Length of a serialized INPUT_RECORD_0
SERIALIZED_PID_LENGTH
Length of a serialized process id exchanged during the named-pipe PID handshake. Matches the size of a u32 on all supported platforms.
TAG_HIGHLIGHT
Tag byte identifying a highlight-toggle message on the daemon-to-client pipe. Payload is the byte produced by crate::protocol::serialization::serialize_highlight. Purely visual, orthogonal to ClientState.
TAG_INPUT_RECORD
Tag byte identifying an input-record message on the daemon-to-client pipe.
TAG_KEEP_ALIVE
Tag byte identifying a zero-payload keep-alive message on the daemon-to-client pipe.
TAG_STATE_CHANGE
Tag byte identifying a client state-change message on the daemon-to-client pipe.