Closed ovidiu-ionescu closed 1 year ago
You can either use futures::future::Either
to encode both return variants, or you can use Pin<Box<dyn Future<...>>>
and box both response futures. Here's an example that boxes the response future: https://github.com/linkerd/linkerd2-proxy/blob/0814a154ba8c8cc7af394ac3fa6f940bd01755ae/linkerd/stack/src/fail_on_error.rs#LL30-L69C2
I managed to get it working by taking inspiration from the linkerd source.
Thanks!
I am trying to write a layer for hyper that would resolve the static requests for swagger objects. I tried using the log example but this part I can not get to compile:
The compilation error is:
I could not find any example for achieving this. Is there any solution?