tower-h2 icon indicating copy to clipboard operation
tower-h2 copied to clipboard

Decouple server::Error from MakeService

Open mzabaluev opened this issue 6 years ago • 1 comments

When server::Error is used in a generic way, but with a particular specialization of its MakeService type parameter, the type parameters and trait bounds of the specialization are included into the signature of the specialized server::Error, even though they may have no bearing on the actual variant error types.

Redefine server::Error with two generic type parameters that receive associated types Error and MakeError of a MakeService impl, sans the explicit trait bound. To reduce verbosity in the common case when both parameters get the same type, the second parameter defaults to the type of the first.

Resolves #50.

mzabaluev avatar Jan 17 '19 09:01 mzabaluev

@carllerche do you have any opinions on this?

LucioFranco avatar Jan 19 '19 21:01 LucioFranco