1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-02-21 14:04:49 +01:00

add Service impl for RefCell<S>

This commit is contained in:
Nikolay Kim 2019-11-19 08:45:09 +06:00
parent 5b74c79cf9
commit 3105cde168

View File

@ -198,6 +198,24 @@ where
}
}
impl<S> Service for RefCell<S>
where
S: Service,
{
type Request = S::Request;
type Response = S::Response;
type Error = S::Error;
type Future = S::Future;
fn poll_ready(&mut self, ctx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
self.borrow_mut().poll_ready(ctx)
}
fn call(&mut self, request: Self::Request) -> S::Future {
self.borrow_mut().call(request)
}
}
impl<S> Service for Rc<RefCell<S>>
where
S: Service,