feat: enable client to be a service without ownership (#1556)
This commit is contained in:
@@ -1577,6 +1577,20 @@ impl tower_service::Service<Request> for Client {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl tower_service::Service<Request> for &'_ Client {
|
||||||
|
type Response = Response;
|
||||||
|
type Error = crate::Error;
|
||||||
|
type Future = Pending;
|
||||||
|
|
||||||
|
fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
||||||
|
Poll::Ready(Ok(()))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn call(&mut self, req: Request) -> Self::Future {
|
||||||
|
self.execute_request(req)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl fmt::Debug for ClientBuilder {
|
impl fmt::Debug for ClientBuilder {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
let mut builder = f.debug_struct("ClientBuilder");
|
let mut builder = f.debug_struct("ClientBuilder");
|
||||||
|
|||||||
Reference in New Issue
Block a user