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 a safe way to fill a ReadBuf #3515

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

notgull
Copy link

@notgull notgull commented Jan 5, 2024

Closes #3509

Closes hyperium#3509

Signed-off-by: John Nunley <dev@notgull.net>
Signed-off-by: John Nunley <dev@notgull.net>
@seanmonstar
Copy link
Member

Thanks for the PR!

My initial thoughts were that we could provide a couple methods like in BorrowedCursor. Looking through them, it occurs to me that the only "basic" safe way to write data is to like append(&[u8]). Otherwise, even if you can safely access all initialized_mut(), it would still be unsafe to state an arbitrary number of bytes have been written.

@seanmonstar seanmonstar added the S-waiting-on-author Status: waiting on the author to provide more info, or make changes. label Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: waiting on the author to provide more info, or make changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the ability to safely read into ReadBuf
2 participants