pub enum ErrorBody {
Standard {
kind: ErrorKind,
message: String,
},
Json(Value),
NotJson {
bytes: Bytes,
deserialization_error: Arc<Error>,
},
}
Expand description
The body of a Matrix Client API error.
Variants§
Standard
A JSON body with the fields expected for Client API errors.
Fields
Json(Value)
A JSON body with an unexpected structure.
NotJson
A response body that is not valid JSON.
Implementations§
Source§impl ErrorBody
impl ErrorBody
Sourcepub fn into_error(self, status_code: StatusCode) -> Error
pub fn into_error(self, status_code: StatusCode) -> Error
Convert the ErrorBody into an Error by adding the http status code.
This is equivalent to calling Error::new(status_code, self)
.
Trait Implementations§
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