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 Write::by_ref #314

Closed
wants to merge 1 commit into from
Closed

Add Write::by_ref #314

wants to merge 1 commit into from

Conversation

yoshuawuyts
Copy link
Contributor

Ref #131, implements Write::by_ref. Thanks!

References

Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
@yoshuawuyts yoshuawuyts added the enhancement New feature or request label Oct 13, 2019
@yoshuawuyts
Copy link
Contributor Author

yoshuawuyts commented Oct 13, 2019

Oh dang yeah; I just remembered the conversation with @dignifiedquire and while this method can be implemented, it cannot be called.

Which is to say: there's no way to disambiguate between Read::by_ref and Write::by_ref because you'd have to write:

WriteExt::by_ref(f)

Which isn't valid. This needs to be an inherent method on AsyncRead and AsyncWrite in order for it to work. We should probably PR futures-io for this.

@ghost
Copy link

ghost commented Oct 14, 2019

We should also add the same method for Read and Stream :)

@yoshuawuyts
Copy link
Contributor Author

@stjepang oh yeah Read already has this, but Stream doesn't -- you're right we should add it! We probably can't merge this PR as-is though; this is something that should be part of futures-core because of the reasons I mentioned above 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant