pub enum ErrorBody {
Standard {
kind: ErrorKind,
message: String,
},
Json(Value),
NotJson {
bytes: Bytes,
deserialization_error: Arc<Error>,
},
}
Available on crate feature
api
and (crate features client
or server
) only.Expand description
The body of a Matrix Client API error.
Variants§
Standard
Fields
A JSON body with the fields expected for Client API errors.
Json(Value)
A JSON body with an unexpected structure.
NotJson
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
bytes: Bytes
The raw bytes of the response body.
A response body that is not valid JSON.
Implementations§
§impl ErrorBody
impl ErrorBody
pub 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.
Trait Implementations§
Auto Trait Implementations§
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