Skip to main content

Module envelope

Module envelope 

Source
Expand description

Canonical message envelope (RFC §6.1).

Every wire-level ARCP message is an Envelope. The protocol metadata lives at the envelope level; the type-specific body lives in crate::messages::MessageType, embedded with #[serde(flatten)] so that on the wire type and payload appear at the envelope level alongside id, timestamp, etc., per the canonical wire format.

Two layered representations exist:

  • Envelope — typed; payload is a MessageType.
  • RawEnvelope — untyped; payload is a serde_json::Value and type is a free-form string. The transport boundary uses this when it needs to inspect the message before committing to a type (e.g. to apply RFC §21.3 unknown-message handling without a deserialise error).

The two are interconvertible via Envelope::into_raw / RawEnvelope::try_into_typed.

Structs§

Envelope
Typed protocol envelope (RFC §6.1).
RawEnvelope
Untyped envelope used at the transport boundary.

Enums§

Priority
Message priority class (RFC §6.5).