mirror of
https://github.com/TrueLayer/reqwest-middleware.git
synced 2024-12-29 04:57:27 -08:00
implement AsRef for ClientMiddleware. This grants access to the inner reqwest client
This commit is contained in:
parent
f310cb8604
commit
92c666ec3e
1 changed files with 9 additions and 0 deletions
|
@ -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 {
|
mod service {
|
||||||
use std::{
|
use std::{
|
||||||
future::Future,
|
future::Future,
|
||||||
|
|
Loading…
Reference in a new issue