-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Context<S>, generic over IO #171
Conversation
* Update wrapper macros to support generic arg(s), not just lifetimes * Make Context generic over the underlying IO
Why is this needed? You need a non-static stream? |
More detail here: #3 (comment) but the general gist is that |
Having Context generic over IO is also in review: #163 That review also provides async support ported from:#127 @MabezDev let me know if first PR above covers what you need and if you spot anything. |
Are you sure you want this?, you will need send for hyper support for example, async also benefits.
Correct, if you have an example where this becomes a problem I can try and help migrate that to some stricter bounds.
They also help in general with integration with other libraries like hyper. |
Yes, we definitely want the stream to be
Thanks! It seems the first commit of that PR would do the job nicely; solves the That PR has been a in review for a while. Provided the |
Alternatively, I can port across the relevant changes and make a new PR (also take a stab and refactoring the |
Sorry for the ninja edit.
Do you have an example where changes are useful for / what breaks on your side if io is required to be send as it is right now? |
The main reason I want to remove the explicit bounds, is because rust-native-tls does not have them, only
Could you explain how this helps? If hyper requires explicit trait bounds for |
e03e46f
to
a28ceb1
Compare
Makes sense, I'll look into adding that into my PR and just require that object is static. |
Closing in favour of #163 |
@MabezDev please also update here once you have the rust-native-tls PR raised or crate available somewhere. I was looking at doing that but will put that on hold for now since you've already started on it. |
@MabezDev started doing the native-tls work as well, some very WIP code if you're curious: https://github.com/AdrianCX/rust-native-tls/tree/acruceru/rust-mbedtls This pretty much plugs in place with tokio-native-tls (need to update some error messages for though) |
Sorry for the delay in getting back to you. My attempt was based on the original PR: sfackler/rust-native-tls#142, just a straight rewrite using Whilst my PR works, not all tests pass and I'm running low on cycles to work on this. I'll get to finishing this eventually, but perhaps you'd like to take the lead from here on out? Happy to review the PR whenever it's ready, just ping me :) |
This is a MVP implementation of my proposal in #3 (comment).
This does seem to work with my (not yet published) PR in
rust-native-tls
, and I can run some examples.Notes
Context<S>
implementation is sound, butHandshakeContext
I am a lot more unsure of. Particularly theUnsafeFrom
cast in the Sni Callback.HandshakeContext
doesn't use the io field, but its definitely not correct.HandshakeContext
generic is probably the correct way to do it, but doing that also adds a lot of complications with the callbacks.I welcome any feedback :)