std::ioStandard I/O operations.
Read from stdin and write to stdout or stderr.
import std.io;
fn main() {
io.write("enter your name: ");
let name = io.read_line() ?? "stranger";
io.write("hello, ");
io.write(name);
io.write("\n");
}
read_lineRead one line from standard input.
The call waits without holding a scheduler thread, so other tasks keep
running while input is silent. The trailing \n or \r\n is removed and
invalid UTF-8 becomes U+FFFD. Returns None at end of input; a final line
without a newline is still returned first. A read error traps.
Concurrent reads take lines in the order they started, each line going to exactly one of them. A read that a deadline or an enclosing scope cancels consumes nothing: the next read returns the line that was pending.
writeWrite a string to standard output without a trailing newline.
write_errWrite a string to standard error without a trailing newline.
read_allRead standard input to its end.
Waits like read_line, and a read error traps. Invalid UTF-8 becomes
U+FFFD.