ReadExactly
Completes a byte read through bounded sequential short operations. Stops on error, validates every reported count and preserves the already transferred prefix. Zero-length input performs no source operation. No allocation, synchronization or hidden flush is introduced.
Module std.io
import std.io;Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.
ReadExactly
pub fn ReadExactly<S>(Source: mut S&, Output: mut byte[]) -> Result<void, IoError>
where S: ReaderCompletes a byte read through bounded sequential short operations. Stops on error, validates every reported count and preserves the already transferred prefix. Zero-length input performs no source operation. No allocation, synchronization or hidden flush is introduced. S: Concrete mutable Reader stream. Source: Borrowed mutable stream for this synchronous operation. Output: Borrowed mut bytes for the complete transfer. Return: Ok only at requested length; error carries proven transferred prefix. Warning: Provider operations may block; source views may not escape the call.