Skip to content

Struct envelope::EventEnvelope

zaun_community_protocol::envelope::EventEnvelope · Struct

pub struct EventEnvelope { … }

{ "v", "type", "community_id", "channel_id"?, "stream", "sequence"?, "timestamp", "actor_id", "body" }. Deserialisation validates with EventEnvelope::validate.

Envelope version.

Event name.

The community.

Present for channel-stream and channel-related member-stream events.

The stream.

channel_seq or member_seq; absent on the live stream.

Host time of acceptance, ms since the Unix epoch.

The member who caused the event; null for host-initiated events.

The event body object.

pub fn validate(&self) -> Result<(), EventError>

Checks the the protocol rules: sequence present on channel/member streams and absent on live, channel_id on the channel stream, integers below 2^53, an object body.

The first rule broken.

Clone, Debug, Deserialize<'de>, Serialize

Full rustdoc page