You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
It is impossible to write an implementation of hyper::rt::Read because ReadBufCursor cannot be written to safely.
Describe the solution you'd like
Have a method that initializes the read buffer by zeroing it and then returning an &mut [u8] that can be filled safely. E.g. this.
Describe alternatives you've considered
N/A
The text was updated successfully, but these errors were encountered:
Yea, I purposefully stuck with the smallest API possible, so that an overly eager method wouldn't restrict it's internal design. I'm happy to have proposals for new methods to add.
You're specifically asking for a way to access the slice as &mut [u8], instead of the &mut [MaybeUninit<u8>], right?
Yes, that would be best. See my implementation where I have to use unsafe code to read into the buffer. If I could pass a &mut [u8] to the underlying reader I would be able to mark this crate as forbid(unsafe_code).
notgull
added a commit
to forkgull/hyper
that referenced
this issue
Jan 5, 2024
Is your feature request related to a problem? Please describe.
It is impossible to write an implementation of
hyper::rt::Read
becauseReadBufCursor
cannot be written to safely.Describe the solution you'd like
Have a method that initializes the read buffer by zeroing it and then returning an
&mut [u8]
that can be filled safely. E.g. this.Describe alternatives you've considered
N/A
The text was updated successfully, but these errors were encountered: