Skip to main content

read_exact_or_eof

Function read_exact_or_eof 

Source
fn read_exact_or_eof(file: &mut impl Read, buf: &mut [u8]) -> Result<bool>
Expand description

true if the buffer was filled, false on a clean EOF before any byte.

Read::read_exact cannot distinguish “the segment ends here” from “the segment ends in the middle of a frame”, and those are a normal end and a tear respectively.