Module io

Source
Description

Byte-oriented IO traits — Read, Write, BufRead, Seek, and the SeekFrom union.

Generic code can be written against (Read src) / (Write sink a | o) today. Concrete impls on capability handles (filesystem files, TCP sockets, Console stdin/stdout) are deferred pending the typed-handle infrastructure; io-copy is a stub that panics until those impls exist. The default in-memory Write target is Str directly — Silo's Str is a mutable owned buffer.

Buffer parameter and return types use Bytes today where the long-term shape is an (Seq U8 _) existential, and error positions use Str where a dedicated IOError union will live. Default method bodies for .read-exact, .read-to-end, .read-to-str, .rewind, .stream-position, .seek-relative, and the BufRead helpers land alongside the capability-handle impls.

Data Types

Unions

SeekFrom

SeekFrom — the offset origin.

Abstractions

Traits

BufRead

BufRead — Read plus buffer-aware operations.

Read

Read — fills a caller-supplied byte buffer from the underlying source.

Seek

Seek — random-access positioning.

Write

Write — unified sink trait parameterised on the input element type a

Functions

Functions

io-copy

io-copy — copy bytes from any Read source to any Write Bytes sink