ReadBytesAsync
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.
ReadBytesAsync
pub async fn ReadBytesAsync<S>(Source: mut S&, Token: CancellationToken) -> Task<Result<Vector<byte>, StreamReadError>> where S: AsyncReaderCollects 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 AsyncReader source type. Source: Borrowed mutable stream, retained through completion. Token: Cancellation observation copied into sequential child reads. Return: Task yielding owned bytes or failure owning every proven consumed byte. Warning: May allocate and suspend; consumes until EOF without a fixed total-size bound.
ReadBytesAsync
pub fn ReadBytesAsync<S>(Source: mut S&) -> Task<Result<Vector<byte>, StreamReadError>> where S: AsyncReaderSupplies the omitted arguments to ReadBytesAsync. Note: Defaults: Token = CancellationToken(). S: Same generic argument and constraints as the full operation. Source: Same input, ownership and lifetime contract as the full operation. Return: Exact full-operation result; no additional async frame is created.