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.
Fields
Section titled “Fields”v: u16
Section titled “v: u16”Envelope version.
kind: String
Section titled “kind: String”Event name.
community_id: CommunityId
Section titled “community_id: CommunityId”The community.
channel_id: Option<ChannelId>
Section titled “channel_id: Option<ChannelId>”Present for channel-stream and channel-related member-stream events.
stream: Stream
Section titled “stream: Stream”The stream.
sequence: Option<u64>
Section titled “sequence: Option<u64>”channel_seq or member_seq; absent on the live stream.
timestamp: u64
Section titled “timestamp: u64”Host time of acceptance, ms since the Unix epoch.
actor_id: Option<MemberId>
Section titled “actor_id: Option<MemberId>”The member who caused the event; null for host-initiated events.
body: Box<RawValue>
Section titled “body: Box<RawValue>”The event body object.
Methods
Section titled “Methods”validate
Section titled “validate”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.
Errors
Section titled “Errors”The first rule broken.
Trait implementations
Section titled “Trait implementations”Clone, Debug, Deserialize<'de>, Serialize