Trait ruma_client::http_client::HttpClient
source · pub trait HttpClient: Sync {
type RequestBody: Default + BufMut + Send;
type ResponseBody: AsRef<[u8]>;
type Error: Send + Unpin;
// Required method
fn send_http_request(
&self,
req: Request<Self::RequestBody>,
) -> impl Future<Output = Result<Response<Self::ResponseBody>, Self::Error>> + Send;
}
Expand description
An HTTP client that can be used to send requests to a Matrix homeserver.
Required Associated Types§
sourcetype RequestBody: Default + BufMut + Send
type RequestBody: Default + BufMut + Send
The type to use for try_into_http_request
.
sourcetype ResponseBody: AsRef<[u8]>
type ResponseBody: AsRef<[u8]>
The type to use for try_from_http_response
.
Required Methods§
sourcefn send_http_request(
&self,
req: Request<Self::RequestBody>,
) -> impl Future<Output = Result<Response<Self::ResponseBody>, Self::Error>> + Send
fn send_http_request( &self, req: Request<Self::RequestBody>, ) -> impl Future<Output = Result<Response<Self::ResponseBody>, Self::Error>> + Send
Send an http::Request
to get back an http::Response
.
Object Safety§
This trait is not object safe.
Implementors§
source§impl HttpClient for Reqwest
Available on crate feature reqwest
only.
impl HttpClient for Reqwest
Available on crate feature
reqwest
only.