๐ฌThis is a nightly-only experimental API. (
alloc_io #154046)Expand description
An encapsulation of BufReaderโs buffer management logic.
This module factors out the basic functionality of BufReader in order to protect two core
invariants:
filledbytes ofbufare always initializedposis always <=filledSince this module encapsulates the buffer management logic, we can ensure that the rangepos..filledis always a valid index into the initialized region of the buffer. This means that user code which wants to do reads from aBufReaderviabuffer+consumecan do so without encountering any runtime bounds checks.
Re-exportsยง
use core::cmp;๐use core::mem::MaybeUninit;๐use crate::boxed::Box;๐use crate::io;๐Experimental use crate::io::BorrowedBuf;๐Experimental use crate::io::ErrorKind;๐use crate::io::Read;๐
Structsยง
- Buffer ๐
Experimental