-
Notifications
You must be signed in to change notification settings - Fork 18
Type parameter of server::Error can make its usage cumbersome #50
Comments
@mzabaluev I am a bit lost on the carrying the baggage around do you by chance have any code samples I could look at? |
@LucioFranco here's my workaround illustrating the problem. Note the type parameter and the bounds on the |
@mzabaluev I somewhat see but the places that those bounds should exist is not very high? From your PR it seems that you are just bringing the errors up one level instead of leaving them to be generic on the |
It also could be that I have not really run into the issue of type baggage as well in my own experiences 😄 |
As |
server::Error
is generic with aMakeService
type parameter, providing associated error types for content of variantsService
andNewService
. If the service factory type used by the application is itself generic and imposes trait bounds on its parameters, code usingserver::Error
has to carry all that baggage over, even though the actual service error types may not require it at all. The generic parameters of the service type also percolate into error types that containserver::Error
, making theirDebug
impls problematic to derive due to the likely phantom data type parameters.Can this error type be decoupled from the signature of a
MakeService
type?The text was updated successfully, but these errors were encountered: