Skip to main content

Crate rift_protocol

Crate rift_protocol 

Source
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.
ChannelId
ChatMessage
High-level chat message payload.
EncryptedPayload
Encrypted payload wrapper for E2EE.
IceCandidate
ICE-lite candidate structure.
MessageId
PeerId
PeerInfo
Peer metadata used in peer lists and routing.
QosProfile
QoS profile for adaptive audio tuning.
RiftFrameHeader
Header for every framed message.
SessionId
Session identifier derived from channel metadata.
VoicePacket
Voice packet payload (pre-Opus or Opus-encoded audio data).

Enums§

CallControl
One-to-one call control messages.
CallState
Call session lifecycle state.
CandidateType
ICE-lite candidate classification.
CodecId
Audio codec identifiers used for voice frames.
ControlMessage
Control plane messages exchanged over the Control stream.
FeatureFlag
Feature flags advertised during capability exchange.
FrameError
Errors encountered when decoding protocol frames.
GroupControl
Group-level control messages.
GroupMode
Group topology mode for multi-peer calls.
ProtocolVersion
On-the-wire protocol versions.
RiftPayload
The union of all possible payloads for a Rift frame.
StreamKind
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.

Type Aliases§

StreamId