-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
io: remove Async{Read,Write}Ext #3005
Comments
What is the rationale for this change? |
@jonhoo The original intent of splitting AsyncRead and AsyncReadExt was that they could be in different crates w/ different levels of stability. As we reach 1.0, both the helpers and the core trait have the same level of stability. |
I'd like to work on this one if I may. |
It's looking like we are going to be unable to move forward on this and will be required to leave the First, moving the fns from Context: |
@carllerche Ow, that's too bad :/ Want me to close the PR? |
I thought we could be saved by implementing For example, this compiles: async fn send_recv_all(
mut read: &mut (dyn AsyncRead + Unpin),
mut write: &mut (dyn AsyncWrite + Unpin),
input: &[u8],
) -> std::io::Result<Vec<u8>> {
(&mut write).write_all(input).await?;
(&mut write).shutdown().await?;
let mut output = Vec::new();
(&mut read).read_to_end(&mut output).await?;
Ok(output)
} @aknuds1 I assume the Americans have gone to bed now, but yeah we will probably have to close the PR because of this. |
@Darksonn Yeah making the same assumption :) |
Ok, given the issues hit and the established convention, we are going to leave this as is. @aknuds1 thanks for your work! Even if it didn’t land it was really helpful to get us to the conclusion. |
All the util functions should be moved to
AsyncRead
andAsyncWrite
.The same should be applied to all other traits defined by Tokio:
AsyncSeek
AsyncBufRead
The text was updated successfully, but these errors were encountered: