diff --git a/ruma-client/src/http_client.rs b/ruma-client/src/http_client.rs index ffaca64b..6dc3765f 100644 --- a/ruma-client/src/http_client.rs +++ b/ruma-client/src/http_client.rs @@ -90,3 +90,27 @@ pub trait HttpClientExt: HttpClient { #[async_trait] impl HttpClientExt for T {} + +#[doc(hidden)] +#[derive(Debug)] +pub struct Dummy; + +#[async_trait] +impl HttpClient for Dummy { + type RequestBody = Vec; + type ResponseBody = Vec; + type Error = (); + + async fn send_http_request( + &self, + _req: http::Request, + ) -> Result, Self::Error> { + unimplemented!("this client only exists to allow doctests to compile") + } +} + +impl DefaultConstructibleHttpClient for Dummy { + fn default() -> Self { + Dummy + } +}