Enum serenity::Error [−][src]
#[non_exhaustive] pub enum Error {}Show variants
Decode(&'static str, Value), Format(FormatError), Io(IoError), Json(JsonError), Model(ModelError), Num(ParseIntError), ExceededLimit(String, u32), NotInRange(&'static str, u64, u64, u64), Other(&'static str), Url(String), Client(ClientError), Gateway(GatewayError), Http(Box<HttpError>), Tungstenite(TungsteniteError),
Expand description
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 Self::Client
and
Self::Gateway
variants.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Expand description
An error while decoding a payload.
Format(FormatError)
Expand description
There was an error with a format.
Io(IoError)
Expand description
An std::io
error.
Json(JsonError)
Expand description
An error from the serde_json
crate.
Model(ModelError)
Expand description
An error from the model
module.
Num(ParseIntError)
Expand description
An error occurred while parsing an integer.
Expand description
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”.
Expand description
The input is not in the specified range.
Returned by GuildId::members
, Guild::members
and PartialGuild::members
(param_name, value, range_min, range_max)
Other(&'static str)
Expand description
Some other error. This is only used for “Expected value Error::Decode
variant.
Url(String)
Expand description
An error from the url
crate.
Client(ClientError)
Expand description
A client error.
Gateway(GatewayError)
Expand description
An error from the gateway
module.
Expand description
An error from the http
module.
Expand description
An error from the tungstenite
crate.
Trait Implementations
impl Error for Error
[src]
impl Error for Error
[src]fn source(&self) -> Option<&(dyn StdError + 'static)>
[src]
fn source(&self) -> Option<&(dyn StdError + 'static)>
[src]The lower-level source of this error, if any. Read more
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
fn description(&self) -> &str
1.0.0[src]
fn description(&self) -> &str
1.0.0[src]use the Display impl or to_string()
impl From<InvalidHeaderValue> for Error
[src]
impl From<InvalidHeaderValue> for Error
[src]fn from(e: InvalidHeaderValue) -> Error
[src]
fn from(e: InvalidHeaderValue) -> Error
[src]Performs the conversion.
impl From<ParseIntError> for Error
[src]
impl From<ParseIntError> for Error
[src]fn from(e: ParseIntError) -> Error
[src]
fn from(e: ParseIntError) -> Error
[src]Performs the conversion.
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,