pub struct ErrorBody {
pub error: String,
pub code: ParalockErrorCode,
}Expand description
The JSON body of a maker error response: { "error": message, "code": code }.
Fields§
§error: StringMessage.
code: ParalockErrorCodeCode.
Implementations§
Source§impl ErrorBody
impl ErrorBody
Sourcepub fn from_response(status: u16, body: &str) -> ParalockError
pub fn from_response(status: u16, body: &str) -> ParalockError
Parses an error response body the way the TypeScript HTTP client does: an unknown or missing code becomes
unavailable, a missing message becomes HTTP <status>, and messages are cut to 300 UTF-16 units. Never fails.
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
impl Eq for ErrorBody
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 UnsafeUnpin 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