[][src]Enum serenity::Error

pub enum Error {
    Decode(&'static strValue),
    Format(FormatError),
    Io(IoError),
    Json(JsonError),
    Model(ModelError),
    Num(ParseIntError),
    ExceededLimit(Stringu32),
    Other(&'static str),
    Url(String),
    Client(ClientError),
    Gateway(GatewayError),
    Http(HttpError),
    Hyper(HyperError),
    Tls(TlsError),
    WebSocket(WebSocketError),
    Opus(OpusError),
    Voice(VoiceError),
}

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

An error while decoding a payload.

There was an error with a format.

An std::io error.

An error from the serde_json crate.

An error from the model module.

An error occurred while parsing an integer.

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".

Some other error. This is only used for "Expected value " errors, when a more detailed error can not be easily provided via the Error::Decode variant.

An error from the url crate.

A client error.

An error from the gateway module.

An error from the http module.

An error from the hyper crate.

An error from the native-tls crate.

An error from the rust-websocket crate.

An error from the opus crate.

Indicating an error within the voice module.

Trait Implementations

impl From<Error> for Error
[src]

Performs the conversion.

impl From<Error> for Error
[src]

Performs the conversion.

impl From<Error> for Error
[src]

Performs the conversion.

impl From<Error> for Error
[src]

Performs the conversion.

impl From<Error> for Error
[src]

Performs the conversion.

impl From<ParseIntError> for Error
[src]

Performs the conversion.

impl From<Error> for Error
[src]

Performs the conversion.

impl From<Error> for Error
[src]

Performs the conversion.

impl From<Error> for Error
[src]

Performs the conversion.

impl From<WebSocketError> for Error
[src]

Performs the conversion.

impl Debug for Error
[src]

Formats the value using the given formatter. Read more

impl Display for Error
[src]

Formats the value using the given formatter. Read more

impl Error for Error
[src]

This method is soft-deprecated. Read more

Deprecating in 1.33.0

: replaced by Error::source, which can support downcasting

The lower-level cause of this error, if any. Read more

The lower-level source of this error, if any. Read more

Auto Trait Implementations

impl Send for Error

impl !Sync for Error

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

Converts the given value to a String. Read more

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 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> Typeable for T where
    T: Any

Get the TypeId of this object.

impl<T> DebugAny for T where
    T: Any + Debug
[src]

impl<T> UnsafeAny for T where
    T: Any