pub trait OutgoingRequest: Metadata + Clone {
type Body: OutgoingBody;
type EndpointError: EndpointError;
type IncomingResponse: IncomingResponse<EndpointError = Self::EndpointError>;
// Required method
fn try_into_http_request_inner(
self,
base_url: &str,
path_builder_input: <Self::PathBuilder as PathBuilder>::Input<'_>,
) -> Result<Request<Self::Body>, IntoHttpError>;
}Available on crate feature
api only.Expand description
A request type for a Matrix API endpoint, used for sending requests.
Required Associated Types§
Sourcetype Body: OutgoingBody
type Body: OutgoingBody
HTTP body type pre-serialization.
Sourcetype EndpointError: EndpointError
type EndpointError: EndpointError
A type capturing the expected error conditions the server can return.
Sourcetype IncomingResponse: IncomingResponse<EndpointError = Self::EndpointError>
type IncomingResponse: IncomingResponse<EndpointError = Self::EndpointError>
Response type returned when the request is successful.
Required Methods§
Sourcefn try_into_http_request_inner(
self,
base_url: &str,
path_builder_input: <Self::PathBuilder as PathBuilder>::Input<'_>,
) -> Result<Request<Self::Body>, IntoHttpError>
fn try_into_http_request_inner( self, base_url: &str, path_builder_input: <Self::PathBuilder as PathBuilder>::Input<'_>, ) -> Result<Request<Self::Body>, IntoHttpError>
Tries to convert this request into an http::Request.
The endpoints path will be appended to the given base_url, for example
https://matrix.org. Since all paths begin with a slash, it is not necessary for the
base_url to have a trailing slash. If it has one however, it will be ignored.
§Errors
This method can return an error in the following cases:
- On endpoints that have several versions for the path, when there are no supported versions
for the endpoint, i.e. when
PathBuilder::make_endpoint_url()returns an error. - If the request serialization fails, which should only happen in case of bugs in Ruma.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".