pub struct ApiError {
pub code: String,
pub feature: Option<String>,
pub message: String,
pub request_id: Option<String>,
pub details: Option<Box<ErrorDetails>>,
}Expand description
HTTP error body used by LoonFS APIs.
Fields§
§code: StringStable machine-readable reason from the ErrorCode
registry.
Carried as a string so clients keep working when a newer server
introduces a code they do not know; use
ErrorCode::parse for typed access.
feature: Option<String>For not_supported errors, the capability-document feature key the
client should reconcile against.
message: StringHuman-readable error message.
request_id: Option<String>Correlation id the server assigned to the failed request; the same
value is sent as the x-request-id response header.
details: Option<Box<ErrorDetails>>Structured context for the code, present when the failure carries machine-usable identity (API spec, “Standard error contract”). Boxed so the rare detailed error does not widen every error-carrying result.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ApiError
impl<'de> Deserialize<'de> for ApiError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ApiError
impl StructuralPartialEq for ApiError
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