#[repr(u8)]pub enum OpCode {
Dispatch = 0,
Heartbeat = 1,
Identify = 2,
PresenceUpdate = 3,
VoiceStateUpdate = 4,
Resume = 6,
Reconnect = 7,
RequestGuildMembers = 8,
InvalidSession = 9,
Hello = 10,
HeartbeatAck = 11,
RequestSoundboardSounds = 31,
}Expand description
Discord Gateway operation codes.
See: https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
Variants§
Dispatch = 0
Dispatch - An event was dispatched. Direction: Receive
Heartbeat = 1
Heartbeat - Keep the connection alive. Direction: Send/Receive
Identify = 2
Identify - Start a new session. Direction: Send
PresenceUpdate = 3
Presence Update - Update the client’s presence. Direction: Send
VoiceStateUpdate = 4
Voice State Update - Join/leave/move between voice channels. Direction: Send
Resume = 6
Resume - Resume a previous session. Direction: Send
Reconnect = 7
Reconnect - Server requested a reconnect. Direction: Receive
RequestGuildMembers = 8
Request Guild Members - Request guild member chunks. Direction: Send
InvalidSession = 9
Invalid Session - Session has been invalidated. Direction: Receive
Hello = 10
Hello - Sent after connecting, contains heartbeat interval. Direction: Receive
HeartbeatAck = 11
Heartbeat ACK - Acknowledgment of heartbeat received. Direction: Receive
RequestSoundboardSounds = 31
Request Soundboard Sounds - Request soundboard sounds (API v10+). Direction: Send
Implementations§
Source§impl OpCode
impl OpCode
Sourcepub const fn is_receive_only(self) -> bool
pub const fn is_receive_only(self) -> bool
Returns whether this opcode is only received (not sent).
Sourcepub const fn is_send_only(self) -> bool
pub const fn is_send_only(self) -> bool
Returns whether this opcode is only sent (not received).
Sourcepub const fn is_bidirectional(self) -> bool
pub const fn is_bidirectional(self) -> bool
Returns whether this opcode can be both sent and received.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for OpCode
impl<'de> Deserialize<'de> for OpCode
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
impl Copy for OpCode
impl Eq for OpCode
impl StructuralPartialEq for OpCode
Auto Trait Implementations§
impl Freeze for OpCode
impl RefUnwindSafe for OpCode
impl Send for OpCode
impl Sync for OpCode
impl Unpin for OpCode
impl UnwindSafe for OpCode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.