pub struct ApiErrorBody {
pub error: String,
pub resource: Option<String>,
}Expand description
Wire representation of an API error body, serialised as JSON.
All REST endpoints that can fail return this structure as their error
payload. The resource field is omitted from the JSON output when it
is not applicable (null would be misleading for non-resource errors).
Fields§
§error: StringShort, machine-friendly slug describing the error category.
resource: Option<String>Resource name when the error is scoped to a single resource.
Absent from the serialised output when None
(controlled by #[serde(skip_serializing_if)]).
Trait Implementations§
Source§impl Debug for ApiErrorBody
impl Debug for ApiErrorBody
Auto Trait Implementations§
impl Freeze for ApiErrorBody
impl RefUnwindSafe for ApiErrorBody
impl Send for ApiErrorBody
impl Sync for ApiErrorBody
impl Unpin for ApiErrorBody
impl UnsafeUnpin for ApiErrorBody
impl UnwindSafe for ApiErrorBody
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request