Skip to main content

Dispatch

Enum Dispatch 

Source
#[non_exhaustive]
pub enum Dispatch {
Show 94 variants ClientReady(Arc<Ready>), ShardReady(Arc<Ready>), ShardResume(Arc<ShardResume>), ShardReconnecting(Arc<ShardReconnecting>), Invalidated(Arc<Invalidated>), ShardError(Arc<ReceiveError>), ShardDisconnect(Arc<CloseCode>), Raw(Arc<DispatchEvent>), ApplicationCommandPermissionsUpdate(Arc<ApplicationCommandPermissionsUpdate>), AutoModerationActionExecution(Arc<AutoModerationActionExecution>), AutoModerationRuleCreate(Arc<AutoModerationRuleCreate>), AutoModerationRuleUpdate(Arc<AutoModerationRuleUpdate>), AutoModerationRuleDelete(Arc<AutoModerationRuleDelete>), EntitlementCreate(Arc<EntitlementCreate>), EntitlementUpdate(Arc<EntitlementUpdate>), EntitlementDelete(Arc<EntitlementDelete>), SubscriptionCreate(Arc<SubscriptionCreate>), SubscriptionUpdate(Arc<SubscriptionUpdate>), SubscriptionDelete(Arc<SubscriptionDelete>), ChannelCreate(Arc<ChannelCreate>), ChannelUpdate(Arc<ChannelUpdate>), ChannelDelete(Arc<ChannelDelete>), ChannelPinsUpdate(Arc<ChannelPinsUpdate>), ChannelInfo(Arc<ChannelInfo>), ThreadCreate(Arc<ThreadCreate>), ThreadUpdate(Arc<ThreadUpdate>), ThreadDelete(Arc<ThreadDelete>), ThreadListSync(Arc<ThreadListSync>), ThreadMemberUpdate(Arc<ThreadMemberUpdate>), ThreadMembersUpdate(Arc<ThreadMembersUpdate>), GuildCreate(Arc<GuildCreate>), GuildAvailable(Arc<GuildCreate>), GuildUpdate(Arc<GuildUpdate>), GuildDelete(Arc<GuildDelete>), GuildUnavailable(Arc<GuildUnavailable>), GuildAuditLogEntryCreate(Arc<GuildAuditLogEntryCreate>), GuildBanAdd(Arc<GuildBanAdd>), GuildBanRemove(Arc<GuildBanRemove>), GuildEmojisUpdate(Arc<GuildEmojisUpdate>), GuildEmojiCreate(Arc<GuildEmojiCreate>), GuildEmojiUpdate(Arc<GuildEmojiUpdate>), GuildEmojiDelete(Arc<GuildEmojiDelete>), GuildStickersUpdate(Arc<GuildStickersUpdate>), GuildStickerCreate(Arc<GuildStickerCreate>), GuildStickerUpdate(Arc<GuildStickerUpdate>), GuildStickerDelete(Arc<GuildStickerDelete>), GuildIntegrationsUpdate(Arc<GuildIntegrationsUpdate>), IntegrationCreate(Arc<IntegrationCreate>), IntegrationUpdate(Arc<IntegrationUpdate>), IntegrationDelete(Arc<IntegrationDelete>), GuildMemberAdd(Arc<GuildMemberAdd>), GuildMemberUpdate(Arc<GuildMemberUpdate>), GuildMemberRemove(Arc<GuildMemberRemove>), GuildMembersChunk(Arc<GuildMembersChunk>), GuildRoleCreate(Arc<GuildRoleCreate>), GuildRoleUpdate(Arc<GuildRoleUpdate>), GuildRoleDelete(Arc<GuildRoleDelete>), GuildScheduledEventCreate(Arc<GuildScheduledEventCreate>), GuildScheduledEventUpdate(Arc<GuildScheduledEventUpdate>), GuildScheduledEventDelete(Arc<GuildScheduledEventDelete>), GuildScheduledEventUserAdd(Arc<GuildScheduledEventUserAdd>), GuildScheduledEventUserRemove(Arc<GuildScheduledEventUserRemove>), GuildSoundboardSoundCreate(Arc<GuildSoundboardSoundCreate>), GuildSoundboardSoundUpdate(Arc<GuildSoundboardSoundUpdate>), GuildSoundboardSoundDelete(Arc<GuildSoundboardSoundDelete>), GuildSoundboardSoundsUpdate(Arc<GuildSoundboardSoundsUpdate>), SoundboardSounds(Arc<SoundboardSounds>), StageInstanceCreate(Arc<StageInstanceCreate>), StageInstanceUpdate(Arc<StageInstanceUpdate>), StageInstanceDelete(Arc<StageInstanceDelete>), InteractionCreate(Arc<InteractionCreate>), InviteCreate(Arc<InviteCreate>), InviteDelete(Arc<InviteDelete>), MessageCreate(Arc<MessageCreate>), MessageUpdate(Arc<MessageUpdate>), MessageDelete(Arc<MessageDelete>), MessageBulkDelete(Arc<MessageBulkDelete>), MessageReactionAdd(Arc<MessageReactionAdd>), MessageReactionRemove(Arc<MessageReactionRemove>), MessageReactionRemoveAll(Arc<MessageReactionRemoveAll>), MessageReactionRemoveEmoji(Arc<MessageReactionRemoveEmoji>), MessagePollVoteAdd(Arc<MessagePollVoteAdd>), MessagePollVoteRemove(Arc<MessagePollVoteRemove>), TypingStart(Arc<TypingStart>), PresenceUpdate(Arc<PresenceUpdate>), UserUpdate(Arc<UserUpdate>), VoiceStateUpdate(Arc<VoiceStateUpdate>), VoiceServerUpdate(Arc<VoiceServerUpdate>), VoiceChannelEffectSend(Arc<VoiceChannelEffectSend>), VoiceChannelStatusUpdate(Arc<VoiceChannelStatusUpdate>), VoiceChannelStartTimeUpdate(Arc<VoiceChannelStartTimeUpdate>), WebhooksUpdate(Arc<WebhooksUpdate>), RateLimited(Arc<RateLimited>), Unknown(Arc<str>),
}
Expand description

An event as delivered by Client::events: one variant per event of Events, with the payload its handlers receive.

Raw is only delivered to handlers, never to event streams (they already receive every event).

discord.js counterpart: none (one variant per member of Events).

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

ClientReady(Arc<Ready>)

The ClientReady event.

§

ShardReady(Arc<Ready>)

The ShardReady event.

§

ShardResume(Arc<ShardResume>)

The ShardResume event.

§

ShardReconnecting(Arc<ShardReconnecting>)

The ShardReconnecting event.

§

Invalidated(Arc<Invalidated>)

The Invalidated event.

§

ShardError(Arc<ReceiveError>)

The ShardError event.

§

ShardDisconnect(Arc<CloseCode>)

The ShardDisconnect event.

§

Raw(Arc<DispatchEvent>)

The Raw event.

§

ApplicationCommandPermissionsUpdate(Arc<ApplicationCommandPermissionsUpdate>)

§

AutoModerationActionExecution(Arc<AutoModerationActionExecution>)

§

AutoModerationRuleCreate(Arc<AutoModerationRuleCreate>)

§

AutoModerationRuleUpdate(Arc<AutoModerationRuleUpdate>)

§

AutoModerationRuleDelete(Arc<AutoModerationRuleDelete>)

§

EntitlementCreate(Arc<EntitlementCreate>)

The EntitlementCreate event.

§

EntitlementUpdate(Arc<EntitlementUpdate>)

The EntitlementUpdate event.

§

EntitlementDelete(Arc<EntitlementDelete>)

The EntitlementDelete event.

§

SubscriptionCreate(Arc<SubscriptionCreate>)

The SubscriptionCreate event.

§

SubscriptionUpdate(Arc<SubscriptionUpdate>)

The SubscriptionUpdate event.

§

SubscriptionDelete(Arc<SubscriptionDelete>)

The SubscriptionDelete event.

§

ChannelCreate(Arc<ChannelCreate>)

The ChannelCreate event.

§

ChannelUpdate(Arc<ChannelUpdate>)

The ChannelUpdate event.

§

ChannelDelete(Arc<ChannelDelete>)

The ChannelDelete event.

§

ChannelPinsUpdate(Arc<ChannelPinsUpdate>)

The ChannelPinsUpdate event.

§

ChannelInfo(Arc<ChannelInfo>)

The ChannelInfo event.

§

ThreadCreate(Arc<ThreadCreate>)

The ThreadCreate event.

§

ThreadUpdate(Arc<ThreadUpdate>)

The ThreadUpdate event.

§

ThreadDelete(Arc<ThreadDelete>)

The ThreadDelete event.

§

ThreadListSync(Arc<ThreadListSync>)

The ThreadListSync event.

§

ThreadMemberUpdate(Arc<ThreadMemberUpdate>)

The ThreadMemberUpdate event.

§

ThreadMembersUpdate(Arc<ThreadMembersUpdate>)

§

GuildCreate(Arc<GuildCreate>)

The GuildCreate event.

§

GuildAvailable(Arc<GuildCreate>)

The GuildAvailable event.

§

GuildUpdate(Arc<GuildUpdate>)

The GuildUpdate event.

§

GuildDelete(Arc<GuildDelete>)

The GuildDelete event.

§

GuildUnavailable(Arc<GuildUnavailable>)

The GuildUnavailable event.

§

GuildAuditLogEntryCreate(Arc<GuildAuditLogEntryCreate>)

§

GuildBanAdd(Arc<GuildBanAdd>)

The GuildBanAdd event.

§

GuildBanRemove(Arc<GuildBanRemove>)

The GuildBanRemove event.

§

GuildEmojisUpdate(Arc<GuildEmojisUpdate>)

The GuildEmojisUpdate event.

§

GuildEmojiCreate(Arc<GuildEmojiCreate>)

The GuildEmojiCreate event.

§

GuildEmojiUpdate(Arc<GuildEmojiUpdate>)

The GuildEmojiUpdate event.

§

GuildEmojiDelete(Arc<GuildEmojiDelete>)

The GuildEmojiDelete event.

§

GuildStickersUpdate(Arc<GuildStickersUpdate>)

§

GuildStickerCreate(Arc<GuildStickerCreate>)

The GuildStickerCreate event.

§

GuildStickerUpdate(Arc<GuildStickerUpdate>)

The GuildStickerUpdate event.

§

GuildStickerDelete(Arc<GuildStickerDelete>)

The GuildStickerDelete event.

§

GuildIntegrationsUpdate(Arc<GuildIntegrationsUpdate>)

§

IntegrationCreate(Arc<IntegrationCreate>)

The IntegrationCreate event.

§

IntegrationUpdate(Arc<IntegrationUpdate>)

The IntegrationUpdate event.

§

IntegrationDelete(Arc<IntegrationDelete>)

The IntegrationDelete event.

§

GuildMemberAdd(Arc<GuildMemberAdd>)

The GuildMemberAdd event.

§

GuildMemberUpdate(Arc<GuildMemberUpdate>)

The GuildMemberUpdate event.

§

GuildMemberRemove(Arc<GuildMemberRemove>)

The GuildMemberRemove event.

§

GuildMembersChunk(Arc<GuildMembersChunk>)

The GuildMembersChunk event.

§

GuildRoleCreate(Arc<GuildRoleCreate>)

The GuildRoleCreate event.

§

GuildRoleUpdate(Arc<GuildRoleUpdate>)

The GuildRoleUpdate event.

§

GuildRoleDelete(Arc<GuildRoleDelete>)

The GuildRoleDelete event.

§

GuildScheduledEventCreate(Arc<GuildScheduledEventCreate>)

§

GuildScheduledEventUpdate(Arc<GuildScheduledEventUpdate>)

§

GuildScheduledEventDelete(Arc<GuildScheduledEventDelete>)

§

GuildScheduledEventUserAdd(Arc<GuildScheduledEventUserAdd>)

§

GuildScheduledEventUserRemove(Arc<GuildScheduledEventUserRemove>)

§

GuildSoundboardSoundCreate(Arc<GuildSoundboardSoundCreate>)

§

GuildSoundboardSoundUpdate(Arc<GuildSoundboardSoundUpdate>)

§

GuildSoundboardSoundDelete(Arc<GuildSoundboardSoundDelete>)

§

GuildSoundboardSoundsUpdate(Arc<GuildSoundboardSoundsUpdate>)

§

SoundboardSounds(Arc<SoundboardSounds>)

The SoundboardSounds event.

§

StageInstanceCreate(Arc<StageInstanceCreate>)

§

StageInstanceUpdate(Arc<StageInstanceUpdate>)

§

StageInstanceDelete(Arc<StageInstanceDelete>)

§

InteractionCreate(Arc<InteractionCreate>)

The InteractionCreate event.

§

InviteCreate(Arc<InviteCreate>)

The InviteCreate event.

§

InviteDelete(Arc<InviteDelete>)

The InviteDelete event.

§

MessageCreate(Arc<MessageCreate>)

The MessageCreate event.

§

MessageUpdate(Arc<MessageUpdate>)

The MessageUpdate event.

§

MessageDelete(Arc<MessageDelete>)

The MessageDelete event.

§

MessageBulkDelete(Arc<MessageBulkDelete>)

The MessageBulkDelete event.

§

MessageReactionAdd(Arc<MessageReactionAdd>)

The MessageReactionAdd event.

§

MessageReactionRemove(Arc<MessageReactionRemove>)

§

MessageReactionRemoveAll(Arc<MessageReactionRemoveAll>)

§

MessageReactionRemoveEmoji(Arc<MessageReactionRemoveEmoji>)

§

MessagePollVoteAdd(Arc<MessagePollVoteAdd>)

The MessagePollVoteAdd event.

§

MessagePollVoteRemove(Arc<MessagePollVoteRemove>)

§

TypingStart(Arc<TypingStart>)

The TypingStart event.

§

PresenceUpdate(Arc<PresenceUpdate>)

The PresenceUpdate event.

§

UserUpdate(Arc<UserUpdate>)

The UserUpdate event.

§

VoiceStateUpdate(Arc<VoiceStateUpdate>)

The VoiceStateUpdate event.

§

VoiceServerUpdate(Arc<VoiceServerUpdate>)

The VoiceServerUpdate event.

§

VoiceChannelEffectSend(Arc<VoiceChannelEffectSend>)

§

VoiceChannelStatusUpdate(Arc<VoiceChannelStatusUpdate>)

§

VoiceChannelStartTimeUpdate(Arc<VoiceChannelStartTimeUpdate>)

§

WebhooksUpdate(Arc<WebhooksUpdate>)

The WebhooksUpdate event.

§

RateLimited(Arc<RateLimited>)

The RateLimited event.

§

Unknown(Arc<str>)

A gateway dispatch this version of the library does not know, with its name.

Implementations§

Source§

impl Dispatch

Source

pub fn name(&self) -> &str

Returns the event’s name as discord.js spells it ("messageCreate"), or the Discord name of an Unknown dispatch.

Trait Implementations§

Source§

impl Clone for Dispatch

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Dispatch

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Classify for T

§

type Classified = T

§

fn classify(self) -> T

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Declassify for T

§

type Declassified = T

§

fn declassify(self) -> T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more