OutgoingRequest

Trait OutgoingRequest 

Source
pub trait OutgoingRequest: Metadata + Clone {
    type EndpointError: EndpointError;
    type IncomingResponse: IncomingResponse<EndpointError = Self::EndpointError>;

    // Required method
    fn try_into_http_request<T: Default + BufMut + AsRef<[u8]>>(
        self,
        base_url: &str,
        authentication_input: <Self::Authentication as AuthScheme>::Input<'_>,
        path_builder_input: <Self::PathBuilder as PathBuilder>::Input<'_>,
    ) -> Result<Request<T>, IntoHttpError>;
}
Available on crate feature api only.
Expand description

A request type for a Matrix API endpoint, used for sending requests.

Required Associated Types§

Source

type EndpointError: EndpointError

A type capturing the expected error conditions the server can return.

Source

type IncomingResponse: IncomingResponse<EndpointError = Self::EndpointError>

Response type returned when the request is successful.

Required Methods§

Source

fn try_into_http_request<T: Default + BufMut + AsRef<[u8]>>( self, base_url: &str, authentication_input: <Self::Authentication as AuthScheme>::Input<'_>, path_builder_input: <Self::PathBuilder as PathBuilder>::Input<'_>, ) -> Result<Request<T>, IntoHttpError>

Tries to convert this request into an http::Request.

On endpoints with authentication, when adequate information isn’t provided through authentication_input, this could result in an error. It may also fail with a serialization error in case of bugs in Ruma though.

It may also fail if the PathData::make_endpoint_url() implementation returns an error.

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.

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.

Implementors§