Function read_header_blocking
fn read_header_blocking(
reader: &mut impl Read,
) -> Result<Result<Header, HeaderError>>Expand description
Reads and decodes the header from the start of reader.
The outer Result is a genuine I/O failure, which must propagate. The
inner one reports whether the header itself could be interpreted: a short
read (EOF before a full header) is folded into
HeaderError::TooShort, since from the caller’s perspective a
too-short file and an explicitly truncated header are the same problem.