Trait ruma::client::HttpClientExt[][src]

pub trait HttpClientExt: HttpClient {
    fn send_matrix_request<'a, R>(
        &'a self,
        homeserver_url: &str,
        access_token: SendAccessToken<'_>,
        request: R
    ) -> Pin<Box<dyn Future<Output = Result<<R as OutgoingRequest>::IncomingResponse, Error<Self::Error, <R as OutgoingRequest>::EndpointError>>> + 'a, Global>>
    where
        R: 'a + OutgoingRequest
, { ... }
fn send_customized_matrix_request<'a, R, F>(
        &'a self,
        homeserver_url: &str,
        access_token: SendAccessToken<'_>,
        request: R,
        customize: F
    ) -> Pin<Box<dyn Future<Output = Result<<R as OutgoingRequest>::IncomingResponse, Error<Self::Error, <R as OutgoingRequest>::EndpointError>>> + 'a, Global>>
    where
        R: OutgoingRequest + 'a,
        F: FnOnce(&mut Request<Self::RequestBody>) -> Result<(), Error<Self::Error, <R as OutgoingRequest>::EndpointError>> + 'a
, { ... }
fn send_matrix_request_as<'a, R>(
        &'a self,
        homeserver_url: &str,
        access_token: SendAccessToken<'_>,
        user_id: &'a UserId,
        request: R
    ) -> Pin<Box<dyn Future<Output = Result<<R as OutgoingRequest>::IncomingResponse, Error<Self::Error, <R as OutgoingRequest>::EndpointError>>> + 'a, Global>>
    where
        R: 'a + OutgoingRequest
, { ... } }
This is supported on crate feature client only.
Expand description

Convenience functionality on top of HttpClient.

If you want to build your own matrix client type instead of using ruma_client::Client, this trait should make that relatively easy.

Provided methods

Send a strongly-typed matrix request to get back a strongly-typed response.

Turn a strongly-typed matrix request into an http::Request, customize it and send it to get back a strongly-typed response.

Turn a strongly-typed matrix request into an http::Request, add a user_id query parameter to it and send it to get back a strongly-typed response.

This method is meant to be used by application services when interacting with the client-server API.

Implementors