-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(server): add Server::serve_service
This adds `Server::serve_service` which is a convenience for doing ```rust Server::bind(&addr).serve(make_service_fn(|_| async move { Ok::<_, Infallible>(service_fn(handler)) })); ``` That now becomes ```rust Server::bind(&addr).serve_service(service_fn(handler)); ``` It basically copies [`tower::make::Shared`][] into Hyper so users don't need to add another dependency to do this. Fixes #2154 [`tower::make::Shared`]: https://docs.rs/tower/0.4.7/tower/make/struct.Shared.html
- Loading branch information
1 parent
d1d2f32
commit 4931c8b
Showing
4 changed files
with
116 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters