#[non_exhaustive]pub enum ClusterError {
Rest(Error),
SessionStartLimit {
required: u32,
remaining: u32,
reset_after: Duration,
},
Io(Error),
Assignment,
Refused,
AlreadyRunning,
NotConnected,
UnknownCommand,
CommandFailed(String),
Timeout,
Encoding(String),
}Expand description
An error of multi-process sharding.
discord.js counterpart: none (discord.js rejects with plain Errors).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Rest(Error)
The manager could not ask Discord for the gateway’s details (Get Gateway Bot, D-305).
SessionStartLimit
Discord’s daily session start limit does not allow starting every shard; no process was started.
Fields
Io(Error)
Listening, connecting or starting a process failed.
Assignment
The assignment in the environment is not valid.
Refused
The manager did not accept this process (a wrong token, an unknown or already connected cluster, or no answer in time).
AlreadyRunning
The manager is already running.
NotConnected
The cluster is not connected: it is down, restarting or does not exist; or, from a cluster process, this process is not connected to its manager (not logged in).
UnknownCommand
The cluster has no handler for the command
(ClusterClient::handle).
CommandFailed(String)
The cluster’s handler returned an error, given here as text.
Timeout
The cluster did not answer within the manager’s
command_timeout.
Encoding(String)
A command’s input or output could not be converted to or from JSON (as text).
Trait Implementations§
Source§impl Debug for ClusterError
impl Debug for ClusterError
Source§impl Display for ClusterError
impl Display for ClusterError
Source§impl Error for ClusterError
impl Error for ClusterError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<ClusterError> for Error
impl From<ClusterError> for Error
Source§fn from(source: ClusterError) -> Self
fn from(source: ClusterError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for ClusterError
impl !UnwindSafe for ClusterError
impl Freeze for ClusterError
impl Send for ClusterError
impl Sync for ClusterError
impl Unpin for ClusterError
impl UnsafeUnpin for ClusterError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> ListEntry for Twhere
T: WriteEntry + ?Sized,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§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>
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString]. Read more