How do I return a service wrapped into MapRequest? #2519
-
SummaryI want to wrap my app creation into a function. The app wraps the router into a layer to enable URI rewriting:
But I can't return the created app, not with this layer neither as a service with
When trying to use this as a return type, the compiler says this:
Am I doing something wrong? Best regards, axum version0.7.4 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I don't recommend attempting to do that. The generics make it very hard (as you've discovered). I recommend organizing your code such that you avoid having to name the type. |
Beta Was this translation helpful? Give feedback.
I don't recommend attempting to do that. The generics make it very hard (as you've discovered). I recommend organizing your code such that you avoid having to name the type.