implement AsRef for ClientMiddleware. This grants access to the inner reqwest client

This commit is contained in:
Miguel Hernández 2024-12-24 09:00:56 +01:00
parent f310cb8604
commit 92c666ec3e
No known key found for this signature in database

View file

@ -247,6 +247,15 @@ impl fmt::Debug for ClientWithMiddleware {
}
}
// Implementing AsRef<Client> for ClientWithMiddleware.
//
// This allows to use ClientWithMiddleware as a reqwest::Client.
impl AsRef<Client> for ClientWithMiddleware {
fn as_ref(&self) -> &Client {
&self.inner
}
}
mod service {
use std::{
future::Future,