Skip to content

AsyncReader

1 min read

Import: import system.io;

Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.

AsyncReader

Awaitable byte input with the same EOF and size rules as Reader.

public interface AsyncReader

read_async

Reads up to max_bytes with cooperative cancellation. Cancellation does not restore bytes already consumed by the underlying operation.

async unique fun read_async(
    max_bytes: int,
    token: Option<CancellationToken> = Option.None
): Result<byte[], IoError>