#[non_exhaustive]pub enum UniRateError {
Authentication,
RateLimit,
InvalidCurrency,
InvalidDate,
Api {
status: u16,
body: String,
},
Http(Error),
Json(Error),
}Expand description
Errors returned by Client methods.
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.
Authentication
HTTP 401 — missing or invalid API key.
RateLimit
HTTP 429 — rate limit exceeded.
InvalidCurrency
HTTP 404 — currency not found or no data available for the requested parameters.
InvalidDate
HTTP 400 — invalid request parameters (commonly bad date format).
Api
Any other non-2xx HTTP response. 403 for Pro-gated endpoints on free tier,
503 for service unavailable, etc.
Http(Error)
Transport-level / network error from reqwest.
Json(Error)
JSON deserialization failure.
Trait Implementations§
Source§impl Debug for UniRateError
impl Debug for UniRateError
Source§impl Display for UniRateError
impl Display for UniRateError
Source§impl Error for UniRateError
impl Error for UniRateError
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()
Source§impl From<Error> for UniRateError
impl From<Error> for UniRateError
Auto Trait Implementations§
impl !RefUnwindSafe for UniRateError
impl !UnwindSafe for UniRateError
impl Freeze for UniRateError
impl Send for UniRateError
impl Sync for UniRateError
impl Unpin for UniRateError
impl UnsafeUnpin for UniRateError
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