Skip to content

Examples on hyper::client::connect do not compile #2147

@davidbarsky

Description

@davidbarsky

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-clientArea: client.A-docsArea: documentation.E-easyEffort: easy. A task that would be a great starting point for a new contributor.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions