Enum twilight_model::gateway::CloseCode
source · #[non_exhaustive]
#[repr(u16)]
pub enum CloseCode {
Show 14 variants
UnknownError,
UnknownOpcode,
DecodeError,
NotAuthenticated,
AuthenticationFailed,
AlreadyAuthenticated,
InvalidSequence,
RateLimited,
SessionTimedOut,
InvalidShard,
ShardingRequired,
InvalidApiVersion,
InvalidIntents,
DisallowedIntents,
}
Expand description
Gateway close event codes.
See Discord Docs/Gateway Close Event Codes for more information.
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.
UnknownError
An unknown error occurred.
UnknownOpcode
An invalid opcode or payload for an opcode was sent.
DecodeError
An invalid payload was sent.
NotAuthenticated
A payload was sent prior to identifying.
AuthenticationFailed
An invalid token was sent when identifying.
AlreadyAuthenticated
Multiple identify payloads were sent.
InvalidSequence
An invalid sequence was sent for resuming.
RateLimited
Too many payloads were sent in a certain amount of time.
SessionTimedOut
The session timed out.
InvalidShard
An invalid shard was sent when identifying.
ShardingRequired
Sharding is required because there are too many guilds.
InvalidApiVersion
An invalid version for the gateway was sent.
InvalidIntents
An invalid intent was sent.
DisallowedIntents
A disallowed intent was sent, may need allowlisting.
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for CloseCode
impl<'de> Deserialize<'de> for CloseCode
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>,
Deserialize this value from the given Serde deserializer. Read more