pub struct ErrorBody {
pub code: String,
pub details: String,
pub error_type: Option<String>,
pub kind: ResourceKind,
pub status: i16,
pub warnings: Option<Vec<String>>,
}
Expand description
Error response body.
See more info in Scryfall API official documentation about the error object.
Fields§
§code: String
§details: String
§error_type: Option<String>
§kind: ResourceKind
§status: i16
§warnings: Option<Vec<String>>
Implementations§
Source§impl ErrorBody
impl ErrorBody
Sourcepub fn from_reqwest_error(e: Error) -> Self
pub fn from_reqwest_error(e: Error) -> Self
Transforms an reqwest::Error to ErrorBody
These errors will include for example connection errors, or json decoding errors.
A default specific error body is defined for these kind of errors:
{
"code": "CLIENT_ERR",
"details": Actual description from reqwest error,
"kind": "error",
"status": 599
}
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ErrorBody
impl<'de> Deserialize<'de> for ErrorBody
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
Source§impl Error for ErrorBody
impl Error for ErrorBody
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()
impl StructuralPartialEq for ErrorBody
Auto Trait Implementations§
impl Freeze for ErrorBody
impl RefUnwindSafe for ErrorBody
impl Send for ErrorBody
impl Sync for ErrorBody
impl Unpin for ErrorBody
impl UnwindSafe for ErrorBody
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