Skip to main content

Module io

Module io 

Source
Expand description

Generic input/output primitives.

The Engine provides the mechanisms for streams, pipes, and interactive screens; it does not assign them operating-system meaning. The Shell layer routes command stdin/stdout/stderr through these primitives, the OS commands consume and produce them, and the Terminal layer plugs its screen in as an output.

The Terminal interface is an Engine primitive for the same reason Input and Output are: a rectangular screen, a cursor, and a key stream are generic abstractions usable by editors, games, and any other stateful application — not operating-system concepts. Concrete rendering (ANSI parsing, screen buffers) lives above the Engine.

§Notes

  • Pipe is an in-memory, effectively unbounded channel. It exists to coordinate sequential virtual command execution (producer finishes, then consumer reads); it is not a host OS pipe and does not claim host concurrency semantics. The Shell runtime layer decides how commands are scheduled.
  • Streams are Send + Sync so the Shell may move them between command invocations.

Structs§

BytesInput
An input over a fixed byte buffer (for example a script body).
BytesOutput
An output that accumulates bytes in memory (used by tests and the non-interactive shell).
EmptyInput
An input that is always at end of stream.
KeyEvent
A single structured key press.
Pipe
An in-memory pipe for virtual command coordination.
SinkOutput
An output that discards everything (the virtual /dev/null).
Size
The dimensions of a screen, in rows and columns.
StringInput
A line-oriented input over static text.

Enums§

InputError
Errors produced by an Input stream.
InputMode
The input mode of a terminal.
Key
A keyboard key, independent of modifiers.
OutputError
Errors produced by an Output stream.

Traits§

Input
A readable byte stream.
Output
A writable byte stream.
Terminal
The interactive terminal facade consumed by interactive programs.