Trait ruma::api::EndpointError

source ·
pub trait EndpointError: OutgoingResponse + Error + Sized + Send + 'static {
    // Required method
    fn from_http_response<T>(response: Response<T>) -> Self
       where T: AsRef<[u8]>;
Available on crate feature api only.
Expand description

Gives users the ability to define their own serializable / deserializable errors.

Required Methods§


fn from_http_response<T>(response: Response<T>) -> Selfwhere T: AsRef<[u8]>,

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.