Skip to content
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

Add AsyncWrite implementation for IntoAsyncRead #1734

Merged
merged 1 commit into from
Jul 19, 2019

Conversation

najamelan
Copy link
Contributor

This implements AsyncWrite for IntoAsyncRead when the inner stream implements it,
forwarding all method calls.

This allows working on Types that keep both impls, and allows framing
them with codecs where those require both traits (like tokio codec).

r? @cramertj

@cramertj
Copy link
Member

This seems like a fine change to me, but did you mean to have a different commit message? The commit message and PR name seem to suggest a different thing than what is implemented here.

@najamelan
Copy link
Contributor Author

@cramertj We can change the commit message to whatever you like. From the user perspective it's like you have a Type which implements AsyncWrite and when you call into_async_read, you lose the AsyncWrite functionality. That's why I called it like this. This doesn't actually provide any new functionality, just makes the inner AsyncWrite available on the wrapper to avoid losing the functionality, and to be able to work with API's that require both. Especially since IntoAsyncRead will consume the inner stream.

Which part does not correspond to the code? I'm a bit confused. It looks like the first paragraph describes the implementation exactly.

@taiki-e
Copy link
Member

taiki-e commented Jul 18, 2019

"Add AsyncWrite implementation for IntoAsyncRead" or "impl AsyncWrite for IntoAsyncRead" seems good commit message to me. (refs: #1575, #1503)

@najamelan najamelan force-pushed the feature/into_async_read_write branch from 2b8110c to 1d3cf61 Compare July 18, 2019 15:04
This implements AsyncWrite for IntoAsyncRead when the inner stream implements it,
forwarding all method calls.

This allows working on Types that keep both impls, and allows framing
them with codecs where those require both traits (like tokio codec).
@najamelan najamelan force-pushed the feature/into_async_read_write branch from 5485db7 to 0932c59 Compare July 18, 2019 15:20
@najamelan najamelan changed the title Don't drop AsyncWrite in IntoAsyncRead Add AsyncWrite implementation for IntoAsyncRead Jul 19, 2019
@najamelan
Copy link
Contributor Author

I changed the pull request title and the commit message.

@cramertj cramertj merged commit 9a056ea into rust-lang:master Jul 19, 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.

3 participants