#[non_exhaustive]pub enum ReceiveErrorKind {
Connect,
Connection,
Decompress,
Deserialize,
FatallyClosed {
code: CloseCode,
},
}Expand description
The kind of a ReceiveError.
discord.js counterpart: the error event of WebSocketShard (@discordjs/ws).
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.
Connect
Connecting to the gateway failed. The shard retries with exponential backoff.
Connection
Reading from or writing to the WebSocket failed. The shard reconnects and resumes.
Decompress
A compressed message could not be decompressed. The shard reconnects (a broken decompression context cannot be recovered).
Deserialize
A payload could not be deserialized. It was skipped; the connection is unaffected.
FatallyClosed
Discord closed the connection with a close code that forbids reconnecting.
Fields
§
code: CloseCodeThe close code Discord sent.
Trait Implementations§
Source§impl Debug for ReceiveErrorKind
impl Debug for ReceiveErrorKind
Source§impl Display for ReceiveErrorKind
impl Display for ReceiveErrorKind
Source§impl Error for ReceiveErrorKind
impl Error for ReceiveErrorKind
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ReceiveErrorKind
impl RefUnwindSafe for ReceiveErrorKind
impl Send for ReceiveErrorKind
impl Sync for ReceiveErrorKind
impl Unpin for ReceiveErrorKind
impl UnsafeUnpin for ReceiveErrorKind
impl UnwindSafe for ReceiveErrorKind
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of [
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a [
CompactString]. Read more