pub struct Error<T>where
T: Error + 'static,{ /* private fields */ }Expand description
An error returned by an API call.
The error includes the HTTP Method and URL of the API call, regardless of whether the request was actually sent to the server.
Implementations
sourceimpl<T> Error<T>where
T: Error + 'static,
impl<T> Error<T>where
T: Error + 'static,
sourcepub fn map<F, U>(self, f: F) -> Error<U>where
F: FnOnce(T) -> U,
U: Error + 'static,
pub fn map<F, U>(self, f: F) -> Error<U>where
F: FnOnce(T) -> U,
U: Error + 'static,
Convert the contained T error, if present.
sourcepub fn method(&self) -> &Method
pub fn method(&self) -> &Method
Returns the HTTP Method of the failed request.
Note that the request may not have happened before the error occurred. In this case, this merely indicates what method the resulting API call would have used.
Trait Implementations
sourceimpl<T> Error for Error<T>where
T: Error + 'static,
ErrorKind<T>: Error + 'static,
Self: Debug + Display,
impl<T> Error for Error<T>where
T: Error + 'static,
ErrorKind<T>: Error + 'static,
Self: Debug + Display,
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()
Auto Trait Implementations
impl<T> !RefUnwindSafe for Error<T>
impl<T> Send for Error<T>where
T: Send,
impl<T> Sync for Error<T>where
T: Sync,
impl<T> Unpin for Error<T>where
T: Unpin,
impl<T> !UnwindSafe for Error<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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