#[non_exhaustive]pub enum GatewayEvent {
Dispatch(u64, DispatchEvent),
Heartbeat,
Reconnect,
InvalidSession(bool),
Hello(Hello),
HeartbeatAck,
Unknown(OpCode),
}Expand description
A payload received from the gateway, decoded according to its opcode.
Decode payloads with GatewayEventDeserializer.
discord.js counterpart: GatewayReceivePayload (discord-api-types).
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.
Dispatch(u64, DispatchEvent)
An event was dispatched (opcode 0), with its sequence number.
Heartbeat
Discord requests an immediate heartbeat (opcode 1).
Reconnect
The client should reconnect and resume (opcode 7).
InvalidSession(bool)
The session was invalidated (opcode 9). The value says whether the session can be resumed.
Hello(Hello)
Sent right after connecting, with the heartbeat interval (opcode 10).
HeartbeatAck
A heartbeat was acknowledged (opcode 11).
Unknown(OpCode)
A payload with an opcode this version of the library does not handle. Its data was skipped.
Trait Implementations§
Source§impl Clone for GatewayEvent
impl Clone for GatewayEvent
Source§impl Debug for GatewayEvent
impl Debug for GatewayEvent
Source§impl PartialEq for GatewayEvent
impl PartialEq for GatewayEvent
impl StructuralPartialEq for GatewayEvent
Auto Trait Implementations§
impl Forget for GatewayEvent
impl Freeze for GatewayEvent
impl Move for GatewayEvent
impl RefUnwindSafe for GatewayEvent
impl Send for GatewayEvent
impl Sync for GatewayEvent
impl Unpin for GatewayEvent
impl UnsafeUnpin for GatewayEvent
impl UnwindSafe for GatewayEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more