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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)