pub enum ErrorBody {
Standard(StandardErrorBody),
Json(Value),
NotJson {
bytes: Bytes,
deserialization_error: Arc<Error>,
},
}Available on crate feature
api only.Expand description
The body of a Matrix API endpoint error.
Variants§
Standard(StandardErrorBody)
A JSON body with the fields expected for Matrix endpoints errors.
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 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