Module pio

Module pio 

Source
Expand description

2026-09-25: Positional file reads and writes at an explicit offset: FileExt::read_at/write_at on unix, seek_read/seek_write on Windows. Bounds checks and record layout stay with the callers (backend/posix.rs, expert_pack_fs.rs, expert_tier.rs, ngram_cache_fault.rs).

Owner: storage (tier). Invariants: a transfer shorter than requested is retried from where it stopped; a zero-byte transfer ends the loop.

Functionsยง

read_at_least_at
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.
read_exact_at
2026-09-25: Fill buf from offset. A zero-byte read before buf is full is an UnexpectedEof error, so the tail of buf is never left stale.
write_all_at
2026-09-25: Write all of buf at offset. A write of zero bytes is a WriteZero error.