matrix-sdk: Fix our HttpClient trait implementation example

master
Damir Jelić 2021-02-01 19:24:29 +01:00
parent 19e9884963
commit f3d4f6aab4
1 changed files with 6 additions and 1 deletions

View File

@ -51,6 +51,7 @@ pub trait HttpSend: AsyncTraitDeps {
/// ``` /// ```
/// use std::convert::TryFrom; /// use std::convert::TryFrom;
/// use matrix_sdk::{HttpSend, async_trait, HttpError}; /// use matrix_sdk::{HttpSend, async_trait, HttpError};
/// # use std::time::Duration;
/// ///
/// #[derive(Debug)] /// #[derive(Debug)]
/// struct Client(reqwest::Client); /// struct Client(reqwest::Client);
@ -67,7 +68,11 @@ pub trait HttpSend: AsyncTraitDeps {
/// ///
/// #[async_trait] /// #[async_trait]
/// impl HttpSend for Client { /// impl HttpSend for Client {
/// async fn send_request(&self, request: http::Request<Vec<u8>>) -> Result<http::Response<Vec<u8>>, HttpError> { /// async fn send_request(
/// &self,
/// request: http::Request<Vec<u8>>,
/// timeout: Option<Duration>,
/// ) -> Result<http::Response<Vec<u8>>, HttpError> {
/// Ok(self /// Ok(self
/// .response_to_http_response( /// .response_to_http_response(
/// self.0 /// self.0