Replies: 1 comment 1 reply
-
Because async fn hello(req: http::Request) -> http::Response {} and async fn bye(req: http::Request) -> http::Response {} are of different types despite the fact that the signatures look the same. You are forced to use trait objects instead, and that's why you need to box the handlers. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
https://github.com/routerify/routerify/blob/master/src/route/mod.rs#L89
Beta Was this translation helpful? Give feedback.
All reactions