#[non_exhaustive]pub struct ApiError {
pub message: String,
pub kind: ErrorKind,
pub code: Option<String>,
pub status: u16,
pub request_id: Option<String>,
pub details: Option<Value>,
pub method: String,
pub path: String,
pub retry_after: Option<Duration>,
}Expand description
An error returned by the API as a non-2xx HTTP response.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.message: StringA human-readable description, normalized from the API’s error body.
kind: ErrorKindThe classification derived from ApiError::status.
code: Option<String>A machine-readable error code returned by the API, when present.
status: u16The HTTP response status code.
request_id: Option<String>A server request id, read from the response headers. Useful for support.
details: Option<Value>The raw parsed error body, for advanced inspection.
method: StringThe HTTP method of the failing request.
path: StringThe path of the failing request.
retry_after: Option<Duration>The server-requested cooldown parsed from the Retry-After header on a
429 response.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ApiError
impl RefUnwindSafe for ApiError
impl Send for ApiError
impl Sync for ApiError
impl Unpin for ApiError
impl UnsafeUnpin for ApiError
impl UnwindSafe for ApiError
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