Replies: 1 comment 2 replies
-
Server services look the same in v1. You can either put data on a struct, and implement let service = service_fn(move |req| {
handle(context.clone(), addr, req)
});
let fut = builder.serve_connection(io, svc); |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Version
Hyper 1
Description
In Hyper 0.14, you could create a service that passed data to the connection service. This example in the old documentation explained how:
It's the last example in the old documentation: https://docs.rs/hyper/0.14.27/hyper/server/index.html#examples
This seems impossible to achieve now because
serve_connection
takes a service that receivesRequest<ReqBody>
.I expected to find an example or explanation on how to accomplish this with the new stable version, but it seems just gone.
How can I accomplish this in Hyper 1?
Beta Was this translation helpful? Give feedback.
All reactions