flix

0.55.0

Reader

trait Reader[t: Type]Source

A trait for types which are resources that can be accessed as bytes.

Signatures

def read(b: Array[Int8, r], r: t): Result[IoError, Int32] \ r + IO with Reader[t] Source

Reads k bytes from the underlying resource and writes them into b.

Returns Ok(k) to signify that k bytes was successfully read and written to b.

Guarantees that 0 <= k < length(b).

Returns Err(e) if some underlying I/O error occurs.