-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(server): make Http compatible with TcpServer #1047
Conversation
Currently we don't have super concrete plans to expose This'd be a great trait for specialization to avoid imposing extra requirements, but unfortunately that's not there just yet :(. |
Compile with this PR, still produces an error. It looks to me like the BindServer should pick work via ServerProto. Clearly, the compiler disagrees with me. Should hyper need a BindServer impl? If so why does the ServerProto impl no fulfill the bounds? Is there a way to make the compiler spit out more type inference detail? |
@mattwoodyard It looks like the generalization of tokio's @alexcrichton hm, so I can create a It might be possible to alleviate that if I include an |
@seanmonstar yeah it's true the situation isn't great no matter how you slice it right now. That's where I think that specialization will be best here because you really do want to work with all In the meantime what do you think about with being conservative and removing the method from |
I have no idea what I had done, but a couple rounds of git pull; and cargo update got it building. Works now, with ssl too. Thanks. |
This implements `From<Message> for Request` and `Into<Message> for Response`, allowing an `Http` instance to be used with a `TcpServer` from tokio-proto. Closes #1036 BREAKING CHANGE: This makes `Request.remote_addr` an `Option<SocketAddr>`, instead of `SocketAddr`.
6fbeeb2
to
e04bcc1
Compare
This implements
From<Message> for Request
andInto<Message> for Response
, allowing anHttp
instance to be used with aTcpServer
from tokio-proto.
Closes #1036
BREAKING CHANGE: This makes
Request.remote_addr
anOption<SocketAddr>
, instead ofSocketAddr
.@alexcrichton This would make hyper's
Http
compatible withTcpServer
. Requiring a secondary trait to be able to get aSocketAddr
felt like more of a pain, so instead I've settled on allowing the address to be anOption
. Does it seem likeTcpServer
could gain the ability to collect theSocketAddr
later, such as for 0.2, and we can make use of it then? If so, I can file a tracking bug.