Hello World Example cargo.toml ?
The hyper hello world example is a .rs file.
Shouldn't it comes with a cargo.toml file so that we can know its dependencies? Just tried that example however service_fn cannot be found in crates.io
Not sure if this answers your question, but the 'examples' directory is a special directory that cargo recognizes for storing examples. To run an example, from the root of the repo, run:
cargo run --example hello
The README is suggesting
See the Hello World example for a toy server using hyper
But IMHO for people who want to have a quick try will be expecting something like https://github.com/nghenglim/hello-async-hyper , which can give a better idea of setting up a project with Hyper as a dependencies
I agree with @nghenglim, examples should be self contained and copy-paste:able.
Just hit this issue as well. Wanted to try hyper, copied the code from the front page. Missing fn main was a trivial fix, but then finding this service_fn crate was kinda hard since it's not on crates.io.