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§
Enums§
- Client
State - Runtime state of a single client.
- Daemon
ToClient Message - 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
ClientStatepayload. - 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
u32on 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 toClientState. - 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.