Skip to content

Enum event::Event

zaun_community_protocol::event::Event · Enum

pub enum Event { … }

A decoded event body: one variant per event of the the protocol catalogue.

message.created

message.updated

message.deleted

messages.bulk_deleted

reaction.added

reaction.removed

community.updated

community.descriptor_updated

channel.created

channel.updated

channel.deleted

channel.reordered

role.created

role.updated

role.deleted

role.reordered

member.roles_updated

member.timed_out

member.joined

member.left

member.updated

member.removed

membership.requested

membership.updated

admission.policy.updated

moderation.lockdown.updated

attachment.updated

report.created

report.updated

voice.joined

voice.left

voice.updated

voice.signal

voice.keys

signal.typing

signal.presence

bot.updated

bot.removed

command.updated

interaction.created

interaction.message

interaction.modal

InteractionAutocomplete(InteractionAutocomplete)

Section titled “InteractionAutocomplete(InteractionAutocomplete)”

interaction.autocomplete

interaction.failed

dm.created

dm.closed

pub const fn name(&self) -> &'static str

The wire name (type).

pub const fn streams(&self) -> &'static [Stream]

The streams the event travels on, primary first.

pub fn streams_of(type_: &str) -> Option<&'static [Stream]>

The streams of the event named type_, or None if unknown.

pub fn parse(type_: &str, body: &str) -> Result<Parsed, BodyError>

Decodes an event body. Unknown types are Parsed::Unknown, never an error.

A known event whose body is malformed, or a messages.bulk_deleted above 1 000 ids.

pub const fn stream(&self) -> Stream

The primary stream: the first of Event::streams.

Clone, Debug, PartialEq, Serialize, StructuralPartialEq

Full rustdoc page