Slide 17
Slide 17 text
Without tower-async, you must implement this complex trait by yourself.
impl Service> for JWTVerification
where
S: Service, Response = hyper::Response> + Clone + Send + 'static,
S::Future: Send + 'static,
{
type Response = S::Response;
type Error = S::Error;
type Future = futures::future::BoxFuture<'static, Result>;
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> {
self.inner.poll_ready(cx)
}
fn call(&mut self, mut req: hyper::Request) -> Self::Future {
let clone = self.inner.clone();
let mut inner = std::mem::replace(&mut self.inner, clone);
// ...
// ...
todo!();