Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Status: WIP, not yet ready for merging.
Request: Generally just wanted other eyes on it
Summary of Changes:
async-std
and any other runtime that relies onfutures_io::AsyncRead/Write
.rt::Read
andrt::Write
: These traits serve as thin wrappers aroundtokio::io::AsyncRead/Write
and any type that implementsfutures_io::AsyncRead/Write
. Maintainstokio
as a first class citizen + support for other runtimesReadBuf
Future Implementation forfutures_io::AsyncRead
: Due to differences in API surface betweenfutures_io::AsyncRead
andtokio::io::AsyncRead
, I made a custom impl - (Soundness/Safety guarantees are still up for debate)impl std::future::Future<Output = _>
. Initial attempts to declare them as async fn were unsuccessful, but this allows them to be used across runtimes.cargo run --feature futures --example <example>
orcargo test --feature futures
. The only exception were the documentation tests, which I didn't want to change but don't see why they wouldn't work.[email protected]
, for[dev-dependencies]
we tested withasync-std
andfutures_rustls
.async_std
needed the unstable feature flag forasync-std
fortask::spawn_local
and the atrributes flag forasync_std::main
.webpki-roots
from 0.23.0 -> 0.25.2Troubles
In src/handshake ran into a problem where I couldn't change the trait bounds to
rt::Read/Write
- believe the full solution there would be to implement in full aAsyncRead/Write
interface - similar to what hyper did with their traits here, but I just wanted to get something up and running. Something like hyper's is probably more ideal, and should be the target. ATM I'm implicitly targeting Glommio as io_uring library of choice here since it implsfuture_io
, so easier to work with + they've shown that they're capable of working with hyper here - but if this PR ends up with something similar to Hyper's traits then it'll probably end up with the main library changing to runtime agnostic interfaces and then writing runtime specific compat layers gated by feature flags so extensions would be possible.Want to test with Glommio' since their IO impl
futures_io::AsyncRead/Write
since async-std works okay so far