Skip to main content

GatewayCommand

Trait GatewayCommand 

Source
pub trait GatewayCommand: Serialize {
    const OPCODE: OpCode;
}
Expand description

A payload that can be sent to the gateway.

Each command knows its opcode. Wrap a command in CommandPayload to get the {"op": …, "d": …} envelope the gateway expects.

discord.js counterpart: GatewaySendPayload (discord-api-types).

Required Associated Constants§

Source

const OPCODE: OpCode

The opcode of the command.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl GatewayCommand for Heartbeat

Source§

const OPCODE: OpCode = OpCode::Heartbeat

Source§

impl GatewayCommand for Identify

Source§

const OPCODE: OpCode = OpCode::Identify

Source§

impl GatewayCommand for RequestChannelInfo

Source§

const OPCODE: OpCode = OpCode::RequestChannelInfo

Source§

impl GatewayCommand for RequestGuildMembers

Source§

const OPCODE: OpCode = OpCode::RequestGuildMembers

Source§

impl GatewayCommand for RequestSoundboardSounds

Source§

const OPCODE: OpCode = OpCode::RequestSoundboardSounds

Source§

impl GatewayCommand for Resume

Source§

const OPCODE: OpCode = OpCode::Resume

Source§

impl GatewayCommand for UpdatePresence

Source§

const OPCODE: OpCode = OpCode::PresenceUpdate

Source§

impl GatewayCommand for UpdateVoiceState

Source§

const OPCODE: OpCode = OpCode::VoiceStateUpdate