pub enum NewsApiError {
Request(Error),
Api {
code: String,
message: String,
},
InvalidApiKey,
RateLimitExceeded,
InvalidParams(String),
Timeout(Duration),
Json(Error),
}Expand description
The main error type for the News API client library.
Variants§
Request(Error)
An error occurred while making the HTTP request.
Api
The API returned an error response.
Fields
InvalidApiKey
The API key provided is invalid.
RateLimitExceeded
The API rate limit has been exceeded.
InvalidParams(String)
The requested resource are semantically wrong or missing required parameters.
Timeout(Duration)
The request timed out.
Json(Error)
An error occurred while deserializing the JSON response.
Trait Implementations§
Source§impl Debug for NewsApiError
impl Debug for NewsApiError
Source§impl Display for NewsApiError
impl Display for NewsApiError
Source§impl Error for NewsApiError
impl Error for NewsApiError
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 NewsApiError
impl From<Error> for NewsApiError
Auto Trait Implementations§
impl !RefUnwindSafe for NewsApiError
impl !UnwindSafe for NewsApiError
impl Freeze for NewsApiError
impl Send for NewsApiError
impl Sync for NewsApiError
impl Unpin for NewsApiError
impl UnsafeUnpin for NewsApiError
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