Trait ruma_api::OutgoingRequest[][src]

pub trait OutgoingRequest: Sized {
    type EndpointError: EndpointError;
    type IncomingResponse: IncomingResponse<EndpointError = Self::EndpointError>;

    const METADATA: Metadata;

    fn try_into_http_request<T: Default + BufMut>(
        self,
        base_url: &str,
        access_token: SendAccessToken<'_>
    ) -> Result<Request<T>, IntoHttpError>; }
Expand description

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

Associated Types

type EndpointError: EndpointError[src]

Expand description

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

type IncomingResponse: IncomingResponse<EndpointError = Self::EndpointError>[src]

Expand description

Response type returned when the request is successful.

Associated Constants

const METADATA: Metadata[src]

Expand description

Metadata about the endpoint.

Required methods

fn try_into_http_request<T: Default + BufMut>(
    self,
    base_url: &str,
    access_token: SendAccessToken<'_>
) -> Result<Request<T>, IntoHttpError>
[src]

Expand description

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

This method should only fail when called on endpoints that require authentication. It may also fail with a serialization error in case of bugs in Ruma though.

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.

Implementors