pub struct ApiError {
pub status: u16,
pub problem: Problem,
pub headers: HashMap<String, String>,
}Expand description
A non-2xx response, with the parsed problem document attached.
Fields§
§status: u16§problem: Problem§headers: HashMap<String, String>Selected response headers (lower-cased names).
Implementations§
Source§impl ApiError
impl ApiError
pub fn kind(&self) -> ApiErrorKind
Sourcepub fn correlation_id(&self) -> Option<&str>
pub fn correlation_id(&self) -> Option<&str>
Request identifier for support tickets.
Sourcepub fn retry_after_seconds(&self) -> Option<f64>
pub fn retry_after_seconds(&self) -> Option<f64>
Seconds the server asked the client to wait, from Retry-After.
Sourcepub fn rate_limit_remaining(&self) -> Option<i64>
pub fn rate_limit_remaining(&self) -> Option<i64>
Remaining requests in the current rate-limit window.
pub fn is_retryable(&self) -> bool
Trait Implementations§
Source§impl Error for ApiError
impl Error for ApiError
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 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