pub struct ErrorResponse {
pub schema_version: &'static str,
pub ok: bool,
pub kind: &'static str,
pub error: ErrorDetail,
}Expand description
Top-level envelope for error responses.
Fields§
§schema_version: &'static str§ok: bool§kind: &'static str§error: ErrorDetailImplementations§
Source§impl ErrorResponse
impl ErrorResponse
Sourcepub fn new(
code: impl Into<String>,
message: impl Into<String>,
retryable: bool,
) -> Self
pub fn new( code: impl Into<String>, message: impl Into<String>, retryable: bool, ) -> Self
Create an error response.
retryable should be true only when a transient condition (e.g. I/O
contention, temporary unavailability) caused the failure and the caller
is expected to succeed on a subsequent attempt without changing the
request. Use false for permanent failures such as “job not found” or
internal logic errors.
pub fn print(&self)
Trait Implementations§
Source§impl Debug for ErrorResponse
impl Debug for ErrorResponse
Source§impl Deserialize<'static> for ErrorResponse
impl Deserialize<'static> for ErrorResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'static>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'static>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ErrorResponse
impl RefUnwindSafe for ErrorResponse
impl Send for ErrorResponse
impl Sync for ErrorResponse
impl Unpin for ErrorResponse
impl UnsafeUnpin for ErrorResponse
impl UnwindSafe for ErrorResponse
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