-
-
Notifications
You must be signed in to change notification settings - Fork 821
Description
Is your feature request related to a problem? Please describe.
It would be nice if there was a way to easily generate the query string for a given route based on the Params struct that view uses to deserialize the query string, to prevent both typos and accidentally using keys that might not exist, especially while refactoring.
Describe the solution you'd like
Either on Params or in a new trait matching it I'd like to have a to_map method returning a ParamsMap, the opposite of the Params::from_map method, which would then let the user call ParamsMap::to_query_string to build an appropriate query string for linking the user to.
Describe alternatives you've considered
Manually constructing the ParamsMap which is what I'm doing now, but it easily leads to mistakes that are only caught at runtime when exercising that code path.