We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
ReadBuf::buf*
1 parent 41ad4d9 commit 0d5bd5bCopy full SHA for 0d5bd5b
library/std/src/io/readbuf.rs
@@ -246,4 +246,25 @@ impl<'a> ReadBuf<'a> {
246
pub fn initialized_len(&self) -> usize {
247
self.initialized
248
}
249
+
250
+ /// Returns the buffer
251
+ #[inline]
252
+ pub fn buf(&self) -> &[MaybeUninit<u8>] {
253
+ &*self.buf
254
+ }
255
256
257
+ ///
258
+ /// # Safety
259
+ /// You must not write unitialized bytes to positions less than `self.initialized_len()`
260
261
+ pub unsafe fn buf_mut(&mut self) -> &mut [MaybeUninit<u8>] {
262
+ self.buf
263
264
265
266
267
+ pub fn into_buf(self) -> &'a mut [MaybeUninit<u8>] {
268
269
270
0 commit comments