Expand description
The Commy wire contract: the binary range frame and the error-code vocabulary.
The specification is in spec/, the language-neutral golden vectors are in
vectors/, and every SDK runs the same vectors in its own CI. This crate is
the Rust side of that contract and is tested against those exact files.
Structs§
- Authenticate
- Client to server. Carries the protocol version.
- Confirm
Local - Client to server: the nonce read from
nonce_path, proving the same filesystem view. - Confirm
Local Ack - Server to client: the nonce matched; the server deletes the nonce file. A mismatch is an
ErrorwithPERMISSION_DENIED. - Error
Reply - Server to client: a request failed.
- Flush
Ack - Server to client: the flush identified by
request_idis applied;seqis the new sequence. - GetService
File Path - Client to server: may this service file be mapped locally?
- Range
Frame - A run of bytes that changed in one service file. All integers are little-endian.
- Resync
- Client to server: send the whole file again (no replay log in v1).
- Resync
Done - Server to client: the last range frame of the snapshot has been sent.
- Service
File Path - Server to client: the
file_idthat range frames use for this service.pathandnonce_pathare both present (local mapping offered) or both absent (stay on WSS ranges). They are absent unless the service is open to local mapping and the caller holds a write grant on it.
Enums§
- Control
Message - JSON control messages, sent as WebSocket text frames. Adjacently tagged
(
{"type": ..., "data": {...}}); unknown fields and unknown types are refused. - Error
Code - The only spellings an error code may have on the wire, from server and SDKs alike.
- Frame
Error - Why a binary frame was refused.
Constants§
- HEADER_
LEN - Bytes before the payload: kind (1) + file_id (4) + seq (8) + offset (8) + len (4).
- KIND_
RANGE - First byte of a binary range frame.
- MAX_
PAYLOAD - Largest payload one frame may carry. A bigger change is split into several frames.