#[non_exhaustive]pub enum Error {
MissingApiKey,
InvalidApiKey,
RateLimited {
retry_after: Option<Duration>,
},
Api {
status: u16,
cause: String,
},
Http(Error),
Decode(Error),
}Expand description
Errors returned by the Hypixel SDK.
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.
MissingApiKey
A method requiring authentication was called without an API key configured.
InvalidApiKey
The configured API key was rejected by the API (HTTP 403).
RateLimited
The request was rate limited (HTTP 429).
Fields
Api
The API responded with a non-success status and an error cause.
Fields
Http(Error)
The request could not be sent or the connection failed.
Decode(Error)
The response body could not be deserialized into the expected type.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more