Lyricdev
GitHub

class ConsoleWriter

pub class ConsoleWriter :: [Writer]

Conforms to Writer.

One of the console's output streams as a Writer (stdout(), stderr()). What it takes goes into the same buffer as print's; a flush that fails throws — a pipe nobody reads is BrokenPipe. Not Closeable: the console is not the program's to close.

Methods

pub mut fn write(from: Slice<uint8>): int throws IoError

Writes all of from into the buffer, flushed wherever a flush is due, and returns its length.

Errors

Throws IoError where a due flush fails.

pub mut fn flush(): void throws IoError

Writes out what the stream holds now.

Errors

Throws IoError where the write fails — BrokenPipe for a pipe nobody reads.