pub enum RequestError {
Transport(Box<dyn Error + Send + Sync>),
Api(Box<ProblemError>),
Unreadable {
status: u16,
detail: String,
},
Unwritable {
detail: String,
},
}Expand description
Everything a generated method answers instead of what it was asked for.
Variants§
Transport(Box<dyn Error + Send + Sync>)
The request never reached the API, or its answer never came back.
Api(Box<ProblemError>)
The API answered a failure, and described it.
Held behind a pointer, so that every method answers a small error whatever the document declares a failure body to carry.
Unreadable
The API answered something this crate cannot read.
Fields
Unwritable
The body of the request could not be written.
Implementations§
Source§impl RequestError
impl RequestError
Sourcepub fn unwritable(cause: Error) -> Self
pub fn unwritable(cause: Error) -> Self
Reports a request body this crate could not write.
Sourcepub fn unreadable(status: u16, payload: &[u8], cause: &Error) -> Self
pub fn unreadable(status: u16, payload: &[u8], cause: &Error) -> Self
Reports an answer this crate could not read.
Trait Implementations§
Source§impl Debug for RequestError
impl Debug for RequestError
Source§impl Display for RequestError
impl Display for RequestError
Source§impl Error for RequestError
impl Error for RequestError
1.30.0 · 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 RequestError
impl !UnwindSafe for RequestError
impl Freeze for RequestError
impl Send for RequestError
impl Sync for RequestError
impl Unpin for RequestError
impl UnsafeUnpin for RequestError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more