read_at_least_at

Function read_at_least_at 

Source
pub fn read_at_least_at(
    f: &File,
    buf: &mut [u8],
    offset: u64,
    needed: usize,
) -> Result<usize>
Expand description

2026-09-25: Fill as much of buf as the file holds from offset, and succeed if at least the first needed bytes arrived. Returns the byte count read. Fewer than needed is an UnexpectedEof error.

For whole-block reads at the end of a file (ngram_cache_fault.rs): a safetensors file is 8 + header + tensors long and nothing pads it to a block, so the block holding its last rows runs past EOF, where read_exact_at would fail although every requested row is in the file.