[−][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(Box<HttpError>)
An error from the http
module.
Tungstenite(TungsteniteError)
An error from the tungstenite
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]
fn from(e: FormatError) -> Error
[src]
impl From<Error> for Error
[src]
fn from(e: GatewayError) -> Error
[src]
impl From<Error> for Error
[src]
impl From<Error> for Error
[src]
impl From<ParseIntError> for Error
[src]
fn from(e: ParseIntError) -> Error
[src]
impl From<Error> for Error
[src]
fn from(e: ModelError) -> Error
[src]
impl From<Error> for Error
[src]
impl From<VoiceError> for Error
[src]
fn from(e: VoiceError) -> Error
[src]
impl From<Error> for Error
[src]
fn from(e: TungsteniteError) -> Error
[src]
impl From<Error> for Error
[src]
impl From<InvalidHeaderValue> for Error
[src]
fn from(e: InvalidHeaderValue) -> Error
[src]
impl From<Error> for Error
[src]
fn from(e: ReqwestError) -> Error
[src]
impl Display for Error
[src]
impl Debug for Error
[src]
impl Error for Error
[src]
Auto Trait Implementations
impl Send for Error
impl Unpin for Error
impl Sync for Error
impl !UnwindSafe for Error
impl !RefUnwindSafe for Error
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Erased for T
impl<E> Fail for E where
E: 'static + Error + Send + Sync,
E: 'static + Error + Send + Sync,
fn name(&self) -> Option<&str>
Returns the "name" of the error. Read more
fn cause(&self) -> Option<&(dyn Fail + 'static)>
Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more
fn backtrace(&self) -> Option<&Backtrace>
Returns a reference to the Backtrace
carried by this failure, if it carries one. Read more
fn context<D>(self, context: D) -> Context<D> where
D: Display + Send + Sync + 'static,
D: Display + Send + Sync + 'static,
Provides context for this failure. Read more
fn compat(self) -> Compat<Self>
Wraps this failure in a compatibility wrapper that implements std::error::Error
. Read more
impl<T> AsFail for T where
T: Fail,
T: Fail,
fn as_fail(&self) -> &(dyn Fail + 'static)
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<T> DebugAny for T where
T: Any + Debug,
[src]
T: Any + Debug,
impl<T> UnsafeAny for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,