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 async BufWriter #1608

Merged
merged 1 commit into from
May 17, 2019
Merged

Add async BufWriter #1608

merged 1 commit into from
May 17, 2019

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented May 15, 2019

Closes #1519


#[test]
fn maybe_pending_buf_writer_seek() {
// FIXME: when https://github.com/rust-lang-nursery/futures-rs/issues/1510 fixed,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that AsyncSeek has been merged, this can probably be fixed, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I tried locally, it still didn't work...

Copy link
Member

@Nemo157 Nemo157 May 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yeah, the choice currently is to have a Vec<u8> which is AsyncWrite and extends as needed or Cursor<Vec<u8>> which is AsyncWrite + AsyncSeek but doesn't extend as needed; #1510 is about whether we can have a type that implements both without having to drop the genericness of the current Cursor implementation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I threw together a test commit and this can definitely be done via specialization: 7997066, if only it were close to stabilization.

@cramertj cramertj merged commit 033a90b into rust-lang:master May 17, 2019
@taiki-e taiki-e deleted the io-buf_writer branch May 17, 2019 06:12
@taiki-e
Copy link
Member Author

taiki-e commented May 17, 2019

This seems to be my 104th commit to this repository.
Thanks to the maintainers who have reviewed my many PRs.

@cramertj
Copy link
Member

\o/

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.

AsyncBufReader / AsyncBufWriter
3 participants