[][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

Decode(&'static strValue)

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(Stringu32)

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 " errors, when a more detailed error can not be easily provided via the 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[src]

impl From<Error> for Error[src]

impl From<Error> for Error[src]

impl From<Error> for Error[src]

impl From<ParseIntError> for Error[src]

impl From<Error> for Error[src]

impl From<Error> for Error[src]

impl From<Error> for Error[src]

impl From<WebSocketError> for Error[src]

impl Display for Error[src]

impl Debug for Error[src]

impl Error for Error[src]

fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0
[src]

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]

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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

impl<T> Erased for T

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

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

impl<T> UnsafeAny for T where
    T: Any