Skip to content

Update to std-future#39

Merged
seanmonstar merged 6 commits into
hyperium:masterfrom
95th:master
Jul 23, 2019
Merged

Update to std-future#39
seanmonstar merged 6 commits into
hyperium:masterfrom
95th:master

Conversation

@95th

@95th 95th commented Jul 14, 2019

Copy link
Copy Markdown
Contributor

Closes #38.

Uses tokio-tls

@sfackler

Copy link
Copy Markdown

It seems like this should just wrap tokio-tls to avoid re-implementing all of that stuff.

@jakubadamw

Copy link
Copy Markdown

I've a got a WIP branch here: https://github.com/jakubadamw/hyper-tls/tree/tokio-tls. It is, however, blocked on a small change to tokio-tls that would make TlsStream a Send type again, as it was accidentally made non-Send during the move to std::futures.

@jakubadamw

jakubadamw commented Jul 18, 2019

Copy link
Copy Markdown

tokio_tls::TlsStream will be made Send again after tokio-rs/tokio#1317.

@95th, if you don't mind, when that's merged in, I'll pick up my branch, cherry-pick your fixes to examples and create a PR. OK?

@95th

95th commented Jul 19, 2019

Copy link
Copy Markdown
Contributor Author

@jakubadamw By all means, please go ahead.

@jakubadamw

jakubadamw commented Jul 19, 2019

Copy link
Copy Markdown

@95th, I rebased my branch against yours but I got stuck on just one remaining error in my changes. It seems I need to read up more carefully on Pin and Unpin before I can solve it, so if you feel like picking up my branch and taking a look, I will not mind either!

This is what I'm getting:

error[E0599]: no method named `poll` found for type `std::pin::Pin<&mut std::boxed::Box<(dyn core::future::future::Future<Output = std::result::Result<(stream::MaybeHttpsStream<T>, hyper::client::connect::Connected), std::io::Error>> + std::marker::Send + 'static)>>` in the current scope
   --> src\client.rs:134:31
    |
134 |         Pin::new(&mut self.0).poll(cx)
    |                               ^^^^
    |
    = note: the method `poll` exists but the following trait bounds were not satisfied:
            `std::boxed::Box<(dyn core::future::future::Future<Output = std::result::Result<(stream::MaybeHttpsStream<T>, hyper::client::connect::Connected), std::io::Error>> + std::marker::Send + 'static)> : core::future::future::Future`

Adding an Unpin bound to BoxFut doesn't quite help as then it complains about the GenFuture returned by TlsConnector::connect() (as that's an async fn) not being Unpin.

@95th

95th commented Jul 20, 2019

Copy link
Copy Markdown
Contributor Author

@jakubadamw I fixed that issue and made a PR to your repo. Do you want to create a separate PR or do you want to merge your changes in this PR itself?

@jakubadamw

jakubadamw commented Jul 20, 2019

Copy link
Copy Markdown

@95th, great, thanks! Please go ahead and just carry all over to this PR. :)

Oh, and if it turns out to be necessary, feel free to just squash away my commit.

@95th

95th commented Jul 20, 2019

Copy link
Copy Markdown
Contributor Author

@jakubadamw Done. Thanks

Comment thread Cargo.toml Outdated
Comment thread src/stream.rs Outdated
Comment thread Cargo.toml Outdated

@seanmonstar seanmonstar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thanks!

@seanmonstar seanmonstar merged commit 2e4e212 into hyperium:master Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update to std-futures

4 participants