Open antoine-de opened 8 years ago
@antoine-de I definitely like this, and I think that this can be done together with rewriting rustless to use Serde library, which is on roadmap. I'll try to implement this next week.
great!
I'm not completely fluent in rustless for the moment, but don't hesitate to tell me if I can land a hand (i'm on #iron on irc, name antoine_de if you want)
i think as serde now landed in rustless, we could add this feature more easily now?
Hi,
Don't you think it would be nice to have the possibility to type the handler parameters more ?
I really like the way rustless checks and coerces a handler parameters, but it seems they are only used to check the parameters, but in the handler, the parameters must be casted again to their right type.
It might be clearer with an example :wink::
I think it would be nice to give a struct representing the parameters:
and then use it it in the parameter checking phase and in the handler.
we might use them like this (only a proposal):
It would be really great if there was a magical way to build a MyParams from the parameters, but we could maybe add code (or a macro ?) in the typed_params method to build it.
If you like the idea, I can try to work on this, but my rust level is a bit low for the moment :confused: