hyperium / hyperium/hyperium.github.io
The example doesn't work with latest version 0.14.12
Open
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 34
- Forks
- 71
- Avg merge
- 1h 9m
- Merged PRs (30d)
- 8
Description
The given code on your home page:
use std::{convert::Infallible, net::SocketAddr};
use hyper::{Body, Request, Response, Server};
use hyper::service::{make_service_fn, service_fn};
async fn handle(_: Request<Body>) -> Result<Response<Body>, Infallible> {
Ok(Response::new("Hello, World!".into()))
}
#[tokio::main]
async fn main() {
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
let make_svc = make_service_fn(|_conn| async {
Ok::<_, Infallible>(service_fn(handle))
});
let server = Server::bind(&addr).serve(make_svc);
if let Err(e) = server.await {
eprintln!("server error: {}", e);
}
}
The result:
Compiling http-server v0.1.0 (/Users/chiro/GitHub/rust-playground/http-server)
error[E0432]: unresolved import `hyper::Server`
--> src/main.rs:2:38
|
2 | use hyper::{Body, Request, Response, Server};
| ^^^^^^ no `Server` in the root
error: aborting due to previous error
For more information about this error, try `rustc --explain E0432`.
error: could not compile `http-server`
To learn more, run the command again with --verbose.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Rust code example shown on the project home page and reproduce the unresolved hyper::Server import using version 0.14.12. Update the example so it works with that version, then verify that the displayed code compiles successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100