Skip to content

Commit de6b6f8

Browse files
committed
Add a diagram of ReadBuf layout
1 parent 12a9ced commit de6b6f8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

text/0000-read-buf.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,13 @@ impl Read for TcpStream {
252252
/// buffer that has been logically filled with data, a region that has been initialized at some point but not yet
253253
/// logically filled, and a region at the end that is fully uninitialized. The filled region is guaranteed to be a
254254
/// subset of the initialized region.
255+
///
256+
/// In summary, the contents of the buffer can be visualized as:
257+
/// ```not_rust
258+
/// [ capacity ]
259+
/// [ filled | unfilled ]
260+
/// [ initialized | uninitialized ]
261+
/// ```
255262
pub struct ReadBuf<'a> {
256263
buf: &'a mut [MaybeUninit<u8>],
257264
filled: usize,

0 commit comments

Comments
 (0)