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

Should SinkExt::send_all take stream by value #2214

Closed
taiki-e opened this issue Sep 20, 2020 · 1 comment · Fixed by #2340
Closed

Should SinkExt::send_all take stream by value #2214

taiki-e opened this issue Sep 20, 2020 · 1 comment · Fixed by #2340
Labels
A-sink Area: futures::sink C-feature-request

Comments

@taiki-e
Copy link
Member

taiki-e commented Sep 20, 2020

send_all exhausts given stream, so it's probably ok to consume stream. This allows removing the stream's Unpin requirement. Also, since &mut impl Stream + Unpin implements Stream, code using the current version will also work.

It will complete once both the stream is exhausted, the sink has received all items, and the sink has been flushed.

@taiki-e
Copy link
Member Author

taiki-e commented Sep 20, 2020

Unfortunately, St has ?Sized bounds, so this is a breaking change.

St: ?Sized + TryStream,

@taiki-e taiki-e added the A-sink Area: futures::sink label Dec 17, 2020
@taiki-e taiki-e added this to the futures-0.4 milestone Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sink Area: futures::sink C-feature-request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant