URL routing in the style of rust's pattern matching.
route_match!;
Advantages
Performance
TODO: measure and discuss. It should be good, right? :)
- We only scan the URL once for parsing & matching
- Everything can be allocated on the stack
Dependency Injection
There is no need for a dependency injection framework because you can simply inject the right dependencies into your endpoint blocks:
route_match!;
The same applies to any other sort of middleware: logging, timing, etc. These are all trivial to implement and compose with the URL map.
Disadvantages
Reverse routing is not possible
I can't think of a way of achieving this while maintaining the other advantages and I don't think the trade-off is worth it.