Skip to main content

Crate commy_wire

Crate commy_wire 

Source
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.
ConfirmLocal
Client to server: the nonce read from nonce_path, proving the same filesystem view.
ConfirmLocalAck
Server to client: the nonce matched; the server deletes the nonce file. A mismatch is an Error with PERMISSION_DENIED.
ErrorReply
Server to client: a request failed.
FlushAck
Server to client: the flush identified by request_id is applied; seq is the new sequence.
GetServiceFilePath
Client to server: may this service file be mapped locally?
RangeFrame
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).
ResyncDone
Server to client: the last range frame of the snapshot has been sent.
ServiceFilePath
Server to client: the file_id that range frames use for this service. path and nonce_path are 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§

ControlMessage
JSON control messages, sent as WebSocket text frames. Adjacently tagged ({"type": ..., "data": {...}}); unknown fields and unknown types are refused.
ErrorCode
The only spellings an error code may have on the wire, from server and SDKs alike.
FrameError
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.