Enum twilight_model::gateway::event::Event[][src]

pub enum Event {
Show variants BanAdd(BanAdd), BanRemove(BanRemove), ChannelCreate(ChannelCreate), ChannelDelete(ChannelDelete), ChannelPinsUpdate(ChannelPinsUpdate), ChannelUpdate(ChannelUpdate), GatewayHeartbeat(u64), GatewayHeartbeatAck, GatewayHello(u64), GatewayInvalidateSession(bool), GatewayReconnect, GiftCodeUpdate, GuildCreate(Box<GuildCreate>), GuildDelete(Box<GuildDelete>), GuildEmojisUpdate(GuildEmojisUpdate), GuildIntegrationsUpdate(GuildIntegrationsUpdate), GuildUpdate(Box<GuildUpdate>), InviteCreate(Box<InviteCreate>), InviteDelete(InviteDelete), MemberAdd(Box<MemberAdd>), MemberRemove(MemberRemove), MemberUpdate(Box<MemberUpdate>), MemberChunk(MemberChunk), MessageCreate(Box<MessageCreate>), MessageDelete(MessageDelete), MessageDeleteBulk(MessageDeleteBulk), MessageUpdate(Box<MessageUpdate>), PresenceUpdate(Box<PresenceUpdate>), PresencesReplace, ReactionAdd(Box<ReactionAdd>), ReactionRemove(Box<ReactionRemove>), ReactionRemoveAll(ReactionRemoveAll), ReactionRemoveEmoji(ReactionRemoveEmoji), Ready(Box<Ready>), Resumed, RoleCreate(RoleCreate), RoleDelete(RoleDelete), RoleUpdate(RoleUpdate), ShardConnected(Connected), ShardConnecting(Connecting), ShardDisconnected(Disconnected), ShardIdentifying(Identifying), ShardReconnecting(Reconnecting), ShardPayload(Payload), ShardResuming(Resuming), TypingStart(Box<TypingStart>), UnavailableGuild(UnavailableGuild), UserUpdate(UserUpdate), VoiceServerUpdate(VoiceServerUpdate), VoiceStateUpdate(Box<VoiceStateUpdate>), WebhooksUpdate(WebhooksUpdate),
}
Expand description

Any type of event that a shard emits.

This brings together all of the types of DispatchEvents, GatewayEvents, and ShardEvents.

Variants

BanAdd(BanAdd)
Expand description

A user was banned from a guild.

BanRemove(BanRemove)
Expand description

A user’s ban from a guild was removed.

ChannelCreate(ChannelCreate)
Expand description

A channel was created.

ChannelDelete(ChannelDelete)
Expand description

A channel was deleted.

ChannelPinsUpdate(ChannelPinsUpdate)
Expand description

A channel’s pins were updated.

ChannelUpdate(ChannelUpdate)
Expand description

A channel was updated.

GatewayHeartbeat(u64)
Expand description

A heartbeat was sent to or received from the gateway.

GatewayHeartbeatAck
Expand description

A heartbeat acknowledgement was received from the gateway.

GatewayHello(u64)
Expand description

A “hello” packet was received from the gateway.

GatewayInvalidateSession(bool)
Expand description

A shard’s session was invalidated.

true if resumeable. If not, then the shard must do a full reconnect.

GatewayReconnect
Expand description

The gateway is indicating to perform a reconnect.

GiftCodeUpdate
Expand description

Undocumented event, should be ignored

GuildCreate(Box<GuildCreate>)
Expand description

A guild was created.

GuildDelete(Box<GuildDelete>)
Expand description

A guild was deleted or the current user was removed from a guild.

GuildEmojisUpdate(GuildEmojisUpdate)
Expand description

A guild’s emojis were updated.

GuildIntegrationsUpdate(GuildIntegrationsUpdate)
Expand description

A guild’s integrations were updated.

GuildUpdate(Box<GuildUpdate>)
Expand description

A guild was updated.

InviteCreate(Box<InviteCreate>)
Expand description

A invite was made.

InviteDelete(InviteDelete)
Expand description

A invite was deleted.

MemberAdd(Box<MemberAdd>)
Expand description

A user was added to a guild.

MemberRemove(MemberRemove)
Expand description

A user was removed from a guild.

MemberUpdate(Box<MemberUpdate>)
Expand description

A user’s member object in a guild was updated.

MemberChunk(MemberChunk)
Expand description

A chunk of members were received from the gateway.

MessageCreate(Box<MessageCreate>)
Expand description

A message was created in a channel.

MessageDelete(MessageDelete)
Expand description

A message was deleted in a channel.

MessageDeleteBulk(MessageDeleteBulk)
Expand description

Multiple messages were deleted in a channel.

MessageUpdate(Box<MessageUpdate>)
Expand description

A message was updated in a channel.

PresenceUpdate(Box<PresenceUpdate>)
Expand description

A user’s active presence (such as game or online status) was updated.

PresencesReplace
Expand description

Multiple presences outside of a guild were updated.

For bots this is always empty and useless.

ReactionAdd(Box<ReactionAdd>)
Expand description

A reaction was added to a message.

ReactionRemove(Box<ReactionRemove>)
Expand description

A reaction was removed from a message.

ReactionRemoveAll(ReactionRemoveAll)
Expand description

All reactions were removed from a message.

ReactionRemoveEmoji(ReactionRemoveEmoji)
Expand description

All instances of a given emoji from the reactions of a message were removed.

Ready(Box<Ready>)
Expand description

A shard is now “ready” and fully connected.

Resumed
Expand description

A shard has successfully resumed.

RoleCreate(RoleCreate)
Expand description

A role was created in a guild.

RoleDelete(RoleDelete)
Expand description

A role was deleted in a guild.

RoleUpdate(RoleUpdate)
Expand description

A role was updated in a guild.

ShardConnected(Connected)
Expand description

A shard is now in a connected stage after being fully connected to the gateway.

ShardConnecting(Connecting)
Expand description

A shard is now in a connecting stage after starting to connect to the gateway.

ShardDisconnected(Disconnected)
Expand description

A shard is now in a disconnected stage after the connection was closed.

ShardIdentifying(Identifying)
Expand description

A shard is now in a identifying stage after starting a new session.

ShardReconnecting(Reconnecting)
Expand description

A shard is now in a reconnecting stage after a disconnect or session was ended.

ShardPayload(Payload)
Expand description

A payload of bytes came in through the shard’s connection.

ShardResuming(Resuming)
Expand description

A shard is now in a Resuming stage after a disconnect.

TypingStart(Box<TypingStart>)
Expand description

A user started typing in a channel.

UnavailableGuild(UnavailableGuild)
Expand description

A guild is now unavailable.

UserUpdate(UserUpdate)
Expand description

The current user was updated.

VoiceServerUpdate(VoiceServerUpdate)
Expand description

A voice server update was sent.

VoiceStateUpdate(Box<VoiceStateUpdate>)
Expand description

A voice state in a voice channel was updated.

WebhooksUpdate(WebhooksUpdate)
Expand description

A webhook was updated.

Implementations

impl Event[src]

pub fn kind(&self) -> EventType[src]

Trait Implementations

impl Clone for Event[src]

fn clone(&self) -> Event[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Event[src]

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

Formats the value using the given formatter. Read more

impl From<Box<DispatchEvent, Global>> for Event[src]

fn from(event: Box<DispatchEvent>) -> Self[src]

Performs the conversion.

impl From<GatewayEvent> for Event[src]

fn from(event: GatewayEvent) -> Self[src]

Performs the conversion.

impl From<ShardEvent> for Event[src]

fn from(event: ShardEvent) -> Self[src]

Performs the conversion.

impl PartialEq<Event> for Event[src]

fn eq(&self, other: &Event) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Event) -> bool[src]

This method tests for !=.

impl TryFrom<Event> for GatewayEvent[src]

type Error = EventConversionError

The type returned in the event of a conversion error.

fn try_from(event: Event) -> Result<Self, Self::Error>[src]

Performs the conversion.

impl TryFrom<Event> for ShardEvent[src]

type Error = EventConversionError

The type returned in the event of a conversion error.

fn try_from(event: Event) -> Result<Self, Self::Error>[src]

Performs the conversion.

impl TryFrom<Event> for DispatchEvent[src]

type Error = EventConversionError

The type returned in the event of a conversion error.

fn try_from(event: Event) -> Result<Self, Self::Error>[src]

Performs the conversion.

impl Eq for Event[src]

impl StructuralEq for Event[src]

impl StructuralPartialEq for Event[src]

Auto Trait Implementations

impl RefUnwindSafe for Event

impl Send for Event

impl Sync for Event

impl Unpin for Event

impl UnwindSafe for Event

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

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

fn in_current_span(self) -> Instrumented<Self>[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.