Enum speedrun_api::api::ApiError
source · [−]#[non_exhaustive]
pub enum ApiError<E> where
E: Error + Send + Sync + 'static, {
Body(BodyError),
Client(E),
Json(Error),
Parse(ParseError),
SpeedrunApi(String),
Unknown(Value),
DataType {
source: Error,
typename: &'static str,
},
RequiresAuthentication,
}Expand description
Errors that occur from API endpoints.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Body(BodyError)
Error creating body data
Client(E)
The client encountered an error.
Json(Error)
JSON deserialization failed
Parse(ParseError)
The URL failed to parse.
SpeedrunApi(String)
Speedrun.com returned an error
Unknown(Value)
Speedrun.com returned an unknown error
DataType
Fields
source: ErrorThe source of the error
typename: &'static strThe name of the type that could not be deserialized.
Failed parsing data type from JSON
RequiresAuthentication
The endpoint requires an API key to use, but none was provided.
Implementations
Trait Implementations
sourceimpl<E> Error for ApiError<E> where
E: Error + Send + Sync + 'static,
impl<E> Error for ApiError<E> where
E: Error + Send + Sync + 'static,
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
sourceimpl From<ApiError<RestError>> for SpeedrunApiError
impl From<ApiError<RestError>> for SpeedrunApiError
sourceimpl<E> From<ParseError> for ApiError<E> where
E: Error + Send + Sync + 'static,
impl<E> From<ParseError> for ApiError<E> where
E: Error + Send + Sync + 'static,
sourcefn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl<E> !RefUnwindSafe for ApiError<E>
impl<E> Send for ApiError<E>
impl<E> Sync for ApiError<E>
impl<E> Unpin for ApiError<E> where
E: Unpin,
impl<E> !UnwindSafe for ApiError<E>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more