[−][src]Enum serenity::Error
A common error enum returned by most of the library's functionality within a
custom Result
.
The most common error types, the ClientError
and GatewayError
enums, are both wrapped around this in the form of the Client
and
Gateway
variants.
Variants
Decode(&'static str, Value)
An error while decoding a payload.
Format(FormatError)
There was an error with a format.
Io(IoError)
An std::io
error.
Json(JsonError)
An error from the serde_json
crate.
Model(ModelError)
An error from the model
module.
Num(ParseIntError)
An error occurred while parsing an integer.
ExceededLimit(String, u32)
Input exceeded a limit. Providing the input and the limit that's not supposed to be exceeded.
This only exists for the GuildId::ban
and Member::ban
functions. For their cases,
it's the "reason".
Other(&'static str)
Some other error. This is only used for "Expected value Error::Decode
variant.
Url(String)
An error from the url
crate.
Client(ClientError)
A client error.
Gateway(GatewayError)
An error from the gateway
module.
Http(HttpError)
An error from the http
module.
Hyper(HyperError)
An error from the hyper
crate.
Tls(TlsError)
An error from the native-tls
crate.
WebSocket(WebSocketError)
An error from the rust-websocket
crate.
Opus(OpusError)
An error from the opus
crate.
Voice(VoiceError)
Indicating an error within the voice module.
Trait Implementations
impl From<Error> for Error
[src]
impl From<Error> for Error
fn from(e: FormatError) -> Error
[src]
fn from(e: FormatError) -> Error
Performs the conversion.
impl From<Error> for Error
[src]
impl From<Error> for Error
fn from(e: GatewayError) -> Error
[src]
fn from(e: GatewayError) -> Error
Performs the conversion.
impl From<Error> for Error
[src]
impl From<Error> for Error
fn from(e: HyperError) -> Error
[src]
fn from(e: HyperError) -> Error
Performs the conversion.
impl From<Error> for Error
[src]
impl From<Error> for Error
impl From<Error> for Error
[src]
impl From<Error> for Error
impl From<ParseIntError> for Error
[src]
impl From<ParseIntError> for Error
fn from(e: ParseIntError) -> Error
[src]
fn from(e: ParseIntError) -> Error
Performs the conversion.
impl From<Error> for Error
[src]
impl From<Error> for Error
fn from(e: ModelError) -> Error
[src]
fn from(e: ModelError) -> Error
Performs the conversion.
impl From<Error> for Error
[src]
impl From<Error> for Error
impl From<Error> for Error
[src]
impl From<Error> for Error
impl From<WebSocketError> for Error
[src]
impl From<WebSocketError> for Error
fn from(e: WebSocketError) -> Error
[src]
fn from(e: WebSocketError) -> Error
Performs the conversion.
impl Debug for Error
[src]
impl Debug for Error
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Display for Error
[src]
impl Display for Error
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Error for Error
[src]
impl Error for Error
fn description(&self) -> &str
[src]
fn description(&self) -> &str
This method is soft-deprecated. Read more
fn cause(&self) -> Option<&dyn StdError>
[src]
fn cause(&self) -> Option<&dyn StdError>
: replaced by Error::source, which can support downcasting
The lower-level cause of this error, if any. Read more
fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
impl<T> ToString for T where
T: Display + ?Sized,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> Erased for T
impl<T> Erased for T
impl<T> Typeable for T where
T: Any,
impl<T> Typeable for T where
T: Any,
impl<T> DebugAny for T where
T: Any + Debug,
[src]
impl<T> DebugAny for T where
T: Any + Debug,
impl<T> UnsafeAny for T where
T: Any,
impl<T> UnsafeAny for T where
T: Any,