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

BufRead::fill_buf() is missing #763

Open
gtsiam opened this issue May 3, 2020 · 3 comments
Open

BufRead::fill_buf() is missing #763

gtsiam opened this issue May 3, 2020 · 3 comments

Comments

@gtsiam
Copy link

gtsiam commented May 3, 2020

I'm trying to read binary data from a Read with BufReader, but there is no BufRead::fill_buf() function, only BufRead::poll_fill_buf(). Looking back at the history, it seems the original fill_buf() was removed in commit edfa235, by @stjepang ("Re-export IO traits from futures" for version 0.99.7).

From the 0.99.7 release notes: "io traits are now re-exports of futures-rs types, allowing them to be implemented"; but that doesn't seem to imply any such removals, so is there something I'm missing?

For now I'm (trying to) implement my own future type for this, but do I need to / should I have to?
Any help would be greatly appreciated.

@taiki-e
Copy link
Contributor

taiki-e commented May 3, 2020

Looking back at the history, it seems the original fill_buf() was removed in commit edfa235

removed because unsound.

@gtsiam
Copy link
Author

gtsiam commented May 3, 2020

Could you explain what you mean by unsound? I'll admit I'm relatively new to Rust.

@taiki-e
Copy link
Contributor

taiki-e commented May 3, 2020

removed because unsound.

I mean "original fill_buf implementation (#176) has a soundness hole (worst kind of bug)" (I'm sorry if the comment was difficult to understand.)

See #176 (comment) for details on the bug.

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

No branches or pull requests

2 participants