[Feature] Use type Option for handler
zu1k opened this issue · 2 comments
In the current version, we need to pass three handlers to use hudsucker, including http_handler
, incoming_message_handler
and outgoing_message_handler
.
I think many times the user may not need to handle everything and can use Option
type, the user only needs to use Some
to specify what needs to be handled and just pass None
for things that are not of concern.
This would require the hudsucker to determine if the request or response is need to be handled by the user function, but I believe it would be more user friendly and flexible for crate users. And in this way, the example does not need an additional NoopHandler
.
I do agree that the handlers should probably be optional, I will try and get this done in a few days.