Expand description
Wire frames shared between the bridge and the central server.
Both peers serialize ProtocolMessage with a fixed bincode configuration behind a
length-delimited framing (the ProtocolWrite / ProtocolRead stream extensions). Two
properties are fixed here for forward-compat (DESIGN.md §13), so later additions are additive
rather than breaking:
- a protocol-version field carried in
ProtocolMessage::Helloand checked withnegotiate_version; peers advertising an incompatible version are rejected, - an opaque encrypted-payload envelope + key-id (
Payload::Encrypted), so end-to-end encryption (DESIGN.md §19) can be layered in without a wire break.
ProtocolError is the typed, wire-crossing error surfaced as a ProtocolMessage::Error
frame; application glue elsewhere uses anyhow via the Res / Void aliases.
Structs§
- Channel
Info - A channel as surfaced by discovery (
ProtocolMessage::ChannelList, DESIGN.md §6). - Envelope
- An opaque end-to-end-encrypted payload envelope, reserved now for v2 (DESIGN.md §13, §19).
- Invite
Info - An outstanding invite as surfaced by the channel-admin audit (
ProtocolMessage::InviteList). - Machine
Info - An enrolled machine as surfaced by
ProtocolMessage::MachineList(machine list, §5.1).
Enums§
- AdminOp
- An admin / moderation operation (DESIGN.md §7), authorized server-side by user role.
- Payload
- A message body: plaintext in v1, or the reserved E2E
Envelopein v2. - Protocol
Error - Errors that cross the wire as a
ProtocolMessage::Errorframe and are matched on by the server and bridge (DESIGN.md §16). Application glue elsewhere usesanyhowviaRes/Void. - Protocol
Message - The versioned frame exchanged between a bridge and a central server.
Traits§
- Protocol
Read - Length-delimited receiving of protocol frames over any async reader.
- Protocol
Write - Length-delimited sending of protocol frames over any async writer.
Functions§
- decode
- Decodes a frame from its wire bytes with the fixed codec configuration.
- encode
- Encodes a frame to its wire bytes with the fixed codec configuration.
- negotiate_
version - Returns this build’s protocol version if
theirsis compatible, else aProtocolError::VersionMismatch.