std.sys.Stdin
class pub Stdin
The standard input stream.
Static methods
new
Show source codeHide source code
fn pub static new(process: ref ChildProcess) -> Stdin {
Stdin(process)
}
fn pub static new(process: ref ChildProcess) -> Stdin
Instance methods
flush
Show source codeHide source code
fn pub mut flush -> Result[Nil, Error] {
match inko_child_process_stdin_flush(_INKO.process, @process.raw) {
case { @tag = 1, @value = _ } -> Result.Ok(nil)
case { @tag = _, @value = e } -> Result.Error(Error.from_os_error(e))
}
}
fn pub mut flush -> Result[Nil, Error]
Flushes any pending writes.
Show source codeHide source code
fn pub mut print(string: String) -> Result[Nil, Error] {
write_string(string).then(fn (_) { write_string('\n') })
}
fn pub mut print(string: String) -> Result[Nil, Error]
Writes the entirety of string
to the underlying stream, followed by
writing a Unix newline to the stream.
write_bytes
Show source codeHide source code
fn pub mut write_bytes(bytes: ref ByteArray) -> Result[Nil, Error] {
write_all_internal(bytes.to_pointer, bytes.size)
}
fn pub mut write_bytes(bytes: ref ByteArray) -> Result[Nil, Error]
Writes the entirety of bytes
to the underlying stream.
Types implementing this method must guarantee that upon returning from this
method, either all of the data is written and a Ok(Nil)
is returned, or
an Error(Error)
is returned.
write_string
Show source codeHide source code
fn pub mut write_string(string: String) -> Result[Nil, Error] {
write_all_internal(string.to_pointer, string.size)
}
fn pub mut write_string(string: String) -> Result[Nil, Error]
Writes the entirety of string
to the underlying stream.
See Write.write_bytes
for more details.
Implemented traits
Drop
impl Drop for Stdin
Write
impl Write for Stdin