std.sys.Stdin
type pub inline Stdin
The standard input stream of a child process.
Instance methods
flush
Show source codeHide source code
fn pub mut flush -> Result[Nil, Error] {
Result.Ok(nil)
}
fn pub mut flush -> Result[Nil, Error]
Flushes any pending writes to the file system.
Flushing writes is a potentially expensive operation, and unnecessarily calling this method may degrade performance.
When flushing data to disk it's important to remember that the actual behaviour may vary based on the type of file system, operating system and storage hardware that's used. In particular, it's possible for one of these components to say "Yup, I totally flushed the data, you're all good!" when in fact they have not fully flushed the data.
Show source codeHide source code
fn pub mut print[B: Bytes](bytes: ref B) -> Result[Nil, E] {
try write(bytes)
write('\n')
}
fn pub mut print[B: Bytes](bytes: ref B) -> Result[Nil, E]
Writes the entirety of bytes
to the underlying stream, followed by
a Unix newline.
write
Show source codeHide source code
fn pub mut write[B: Bytes](bytes: ref B) -> Result[Nil, Error] {
write_all_internal(bytes.pointer, bytes.size)
}
fn pub mut write[B: Bytes](bytes: ref B) -> 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
is returned.
Implemented traits
Drop
impl Drop for Stdin
Write
impl Write[Error] for Stdin