Skip to main content

read_full

Function read_full 

Source
pub fn read_full(reader: &mut impl Read, buf: &mut [u8]) -> Result<usize>
Expand description

Read as many bytes as possible into buf, retrying on partial reads. Ensures the full buffer is filled (or EOF reached), avoiding the probe-read overhead of read_to_end. Fast path: regular file reads usually return the full buffer on the first call.