hyperium / hyperium/hyper

Examples on `hyper::client::connect` do not compile

Open
#2,147 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-client A-docs E-easy
Dominant language
Rust
Stars
16.3k
Forks
1.8k
Avg merge
1d 22h
Merged PRs (30d)
14

Description

I'm trying to replicate the example with service_fn in https://docs.rs/hyper/0.13.3/hyper/client/connect/index.html, but I'm unable to get this example to compile:

let connector = service_fn(|_: http::Uri| async {
    tokio::net::TcpStream::connect("127.0.0.1:1337")
});
let mut client = hyper::Client::builder().build(connector);

Here's a minimal reproduction: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=2a85ed2fb9b1025826e81243f72c9fc0.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the hyper::client::connect example at the linked docs.rs page and run the linked Rust Playground reproduction first. Compare the example with the compiler output; done when the documented service_fn example compiles on the stated edition and toolchain.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.