-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
io: add AsyncReadExt::read_buf
#3003
Conversation
ready!(Pin::new(me.reader).poll_read(cx, &mut buf)?); | ||
|
||
// Ensure the pointer does not change from under us | ||
assert_eq!(ptr, buf.filled().as_ptr()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This the right way to ensure safety?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used std::ptr::eq
elsewhere, but it should be the same.
5e19213
to
c44c959
Compare
Brings back `read_buf` from 0.2. This will be stabilized as part of 1.0.
c44c959
to
aceccf9
Compare
If this means that bytes v1 will be released before tokio v1, I have no objection to adding these APIs. |
@taiki-e we are aiming to release bytes 1.0 w/ tokio 1.0. I would suggest watching the changes on that repo to track the direction. |
Co-authored-by: Alice Ryhl <[email protected]>
Brings back
read_buf
from 0.2. This will be stabilized as part of 1.0.I need to add tests still.