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.
Due to the complexities of using Option with type parameters, I decided to just move the no-op handlers into the crate so that external users can use them without having to re-implement. Released in v0.4.2.
In the current version, we need to pass three handlers to use hudsucker, including
http_handler
,incoming_message_handler
andoutgoing_message_handler
.I think many times the user may not need to handle everything and can use
Option
type, the user only needs to useSome
to specify what needs to be handled and just passNone
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
.