Stdin

public struct Stdin { /* private fields */ }

Readable over the process's standard input (file descriptor 0).

Construct via Stdin() or the stdin() accessor. Stateless — every instance shares the same descriptor; concurrent readers race on the same pipe.

Representation

Zero-sized — operations dispatch directly on libc.STDIN().

Initializers

public init()

Builds a stdin handle.

ImplementsReadable

Methods

public mutating func read(into: ArraySlice[UInt8]) -> Result[Int64, IoError]

Calls read(2) on STDIN_FILENO. Returns 0 on EOF (e.g. after the user types Ctrl-D in a terminal).

Defined in lang/std/io/stdio.ks