[][src]Enum screeps_api::error::ApiError

pub enum ApiError {
    NotOk(i32),
    ServerDown,
    InvalidRoom,
    InvalidShard,
    ResultNotFound,
    UserNotFound,
    RegistrationNotAllowed,
    UsernameAlreadyExists,
    InvalidParameters,
    GenericError(String),
    MissingField(&'static str),
    MalformedResponse(String),
    // some variants omitted
}

Error representing some abnormal response from the API.

Variants

NotOk(i32)

The server responded with an "ok" code which was not 1.

ServerDown

The server is offline.

InvalidRoom

A known response to a query about an invalid room.

InvalidShard

A known response to a query about an invalid shard.

ResultNotFound

The data being requested was not found.

UserNotFound

The user whose data was being requested was not found.

RegistrationNotAllowed

Registration is not allowed.

UsernameAlreadyExists

The username that was attempted to register already existed.

InvalidParameters

The API returned that invalid parameters were passed.

GenericError(String)

An error found from the API. Data is the raw error string reported by the server.

MissingField(&'static str)

The server response was missing a top-level JSON field that was expected.

MalformedResponse(String)

A malformed response, including a formatted String description of the error.

Trait Implementations

impl Clone for ApiError[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl From<ApiError> for Error[src]

impl Debug for ApiError[src]

impl Display for ApiError[src]

impl Error for ApiError[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

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,