Expand description
Rift Protocol: versioned, framed on-the-wire messages for P2P voice + text.
A Rift frame is:
- magic: 4 bytes (“RFT1”)
- version: u8
- frame_len: u32 (length of the encoded frame body)
- frame body: bincode-encoded
(RiftFrameHeader, RiftPayload)
Versioning: each peer advertises supported protocol versions. The highest common version is selected for communication.
Streams: frames declare a StreamKind (Control / Text / Voice / Custom)
to allow multiplexing and future extensions.
Structs§
- Capabilities
- Capability advertisement payload for negotiation.
- Channel
Id - Chat
Message - High-level chat message payload.
- Encrypted
Payload - Encrypted payload wrapper for E2EE.
- IceCandidate
- ICE-lite candidate structure.
- Message
Id - PeerId
- Peer
Info - Peer metadata used in peer lists and routing.
- QosProfile
- QoS profile for adaptive audio tuning.
- Rift
Frame Header - Header for every framed message.
- Session
Id - Session identifier derived from channel metadata.
- Voice
Packet - Voice packet payload (pre-Opus or Opus-encoded audio data).
Enums§
- Call
Control - One-to-one call control messages.
- Call
State - Call session lifecycle state.
- Candidate
Type - ICE-lite candidate classification.
- CodecId
- Audio codec identifiers used for voice frames.
- Control
Message - Control plane messages exchanged over the Control stream.
- Feature
Flag - Feature flags advertised during capability exchange.
- Frame
Error - Errors encountered when decoding protocol frames.
- Group
Control - Group-level control messages.
- Group
Mode - Group topology mode for multi-peer calls.
- Protocol
Version - On-the-wire protocol versions.
- Rift
Payload - The union of all possible payloads for a Rift frame.
- Stream
Kind - Logical stream classification used to multiplex payloads.
Functions§
- decode_
frame - Decode a framed message from bytes, validating length and magic.
- encode_
frame - Encode a framed message into bytes: magic + version + length + bincode(body).
- select_
version - Select the highest mutual version between two peers.
- supported_
versions - Return the protocol versions supported by this build.