Trait matrix_sdk_base::ruma::api::IncomingRequest
source · pub trait IncomingRequest: Sized {
type EndpointError: EndpointError;
type OutgoingResponse: OutgoingResponse;
const METADATA: Metadata;
// Required method
fn try_from_http_request<B, S>(
req: Request<B>,
path_args: &[S],
) -> Result<Self, FromHttpRequestError>
where B: AsRef<[u8]>,
S: AsRef<str>;
}
Available on crate feature
api
only.Expand description
A request type for a Matrix API endpoint, used for receiving requests.
Required Associated Types§
sourcetype EndpointError: EndpointError
type EndpointError: EndpointError
A type capturing the error conditions that can be returned in the response.
sourcetype OutgoingResponse: OutgoingResponse
type OutgoingResponse: OutgoingResponse
Response type to return when the request is successful.
Required Associated Constants§
Required Methods§
sourcefn try_from_http_request<B, S>(
req: Request<B>,
path_args: &[S],
) -> Result<Self, FromHttpRequestError>
fn try_from_http_request<B, S>( req: Request<B>, path_args: &[S], ) -> Result<Self, FromHttpRequestError>
Tries to turn the given http::Request
into this request type,
together with the corresponding path arguments.
Note: The strings in path_args need to be percent-decoded.
Object Safety§
This trait is not object safe.