pub enum ErrorKind {
HttpResponse {
status: StatusCode,
error_code: Option<String>,
},
Io,
DataConversion,
Credential,
MockFramework,
Other,
}
Expand description
The kind of error
The classification of error is intentionally fairly coarse.
Variants§
HttpResponse
An HTTP status code that was not expected
Io
An error performing IO
DataConversion
An error converting data
Credential
An error getting an API credential token
MockFramework
An error having to do with the mock framework
Other
A catch all for other kinds of errors
Implementations§
source§impl ErrorKind
impl ErrorKind
pub fn into_error(self) -> Error
pub fn http_response( status: StatusCode, error_code: Option<String>, ) -> ErrorKind
sourcepub fn http_response_from_parts(
status: StatusCode,
headers: &Headers,
body: &[u8],
) -> ErrorKind
pub fn http_response_from_parts( status: StatusCode, headers: &Headers, body: &[u8], ) -> ErrorKind
Constructs an ErrorKind::HttpResponse
with given status code. The error code is taken from
the header headers::ERROR_CODE
if present; otherwise, it is taken from the body.
Trait Implementations§
impl Eq for ErrorKind
impl StructuralPartialEq for ErrorKind
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnwindSafe for ErrorKind
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.