ReadBytes
Collects a complete byte stream into explicit owned storage. Reserves before each read so valid partial provider progress remains owned on failure. Short reads continue until successful zero-byte EOF. Counts are checked before indexing; source failure never discards the already consumed prefix. Geometric storage growth may retain spare capacity beyond the read scratch.
Module std.io
import std.io;Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.
ReadBytes
pub fn ReadBytes<S>(Source: mut S&) -> Result<Vector<byte>, StreamReadError> where S: ReaderCollects a complete byte stream into explicit owned storage. Reserves before each read so valid partial provider progress remains owned on failure. Short reads continue until successful zero-byte EOF. Counts are checked before indexing; source failure never discards the already consumed prefix. Geometric storage growth may retain spare capacity beyond the read scratch. S: Structural Reader source type. Source: Borrowed mutable stream, retained through completion. Return: owned bytes or failure owning every proven consumed byte. Warning: May allocate and block; consumes until EOF without a fixed total-size bound.