pub trait EndpointError:
OutgoingResponse
+ StdError
+ Sized
+ Send
+ 'static {
// Required method
fn try_from_http_response<T: AsRef<[u8]>>(
response: Response<T>,
) -> Result<Self, DeserializationError>;
}
Expand description
Gives users the ability to define their own serializable / deserializable errors.
Required Methods§
Sourcefn try_from_http_response<T: AsRef<[u8]>>(
response: Response<T>,
) -> Result<Self, DeserializationError>
fn try_from_http_response<T: AsRef<[u8]>>( response: Response<T>, ) -> Result<Self, DeserializationError>
Tries to construct Self
from an http::Response
.
This will always return Err
variant when no error
field is defined in
the ruma_api
macro.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.