Open camelop opened 3 years ago
Managed to work around this [at a slight performance penalty] by returning a BoxedFilter<(warp::reply::Response,)>
from the route constructor and doing a {...}.map(Reply::into_response).boxed()
:)
Managed to work around this [at a slight performance penalty] by returning a
BoxedFilter<(warp::reply::Response,)>
from the route constructor and doing a{...}.map(Reply::into_response).boxed()
:)
Thanks a lot for providing the solution and happy new year!
While in our internal project development we are doing some similar workarounds, the change of just making the trait public might be more direct and does not harm the purpose of defensive programming. I would probably send a PR myself on this later and hopefully, the dev team can also help with this.
Fix for this problem? https://github.com/seanmonstar/warp/issues/944
@chpio they are seeking to accept routes while I am seeking to return routes, but indeed making a public Route
(s
?) abstraction fixes both without/instead of making IsReject
public.
I could PR, but it's unclear to me which is the better long term evolution public surface area change.
Is your feature request related to a problem? Please describe. In our application, we construct different routes and start TLS server in different places, the resulting code looks like:
However, we want to simplify the code by constructing a separate function that looks like:
Then we can simplify the code in the beginning to be
But we cannot do that because "trait
IsReject
is private" sowarp_serve
cannot compile.Describe the solution you'd like A clear and concise description of what you want to happen: Make
IsReject
a public trait.Describe alternatives you've considered: N/A
Additional context: N/A