Reader small image

You're reading from  Practical System Programming for Rust Developers

Product typeBook
Published inDec 2020
PublisherPackt
ISBN-139781800560963
Edition1st Edition
Tools
Right arrow
Author (1)
Prabhu Eshwarla
Prabhu Eshwarla
author image
Prabhu Eshwarla

Prabhu Eshwarla has been shipping high-quality, business-critical software to large enterprises and running IT operations for over 25 years. He is also a passionate teacher of complex technologies. Prabhu has worked with Hewlett Packard and has deep experience in software engineering, engineering management, and IT operations. Prabhu is passionate about Rust and blockchain and specializes in distributed systems. He considers coding to be a creative craft, and an excellent tool to create new digital worlds (and experiences) sustained through rigorous software engineering.
Read more about Prabhu Eshwarla

Right arrow

Working with standard input and output

In Linux/Unix, streams are communication channels between a process and its environment. By default, three standard streams are created for every running process: standard input, standard output, and standard error. A stream is a communication channel that has two ends. One end is connected to the process and the other end to another system resource. For example, a standard input can be used by a process to read characters or text from a keyboard or another process. Similarly, a standard output stream can be used by a process to send some characters to the terminal or to a file. In many modern programs, the standard error of a process is connected to a log file, which makes analyzing and debugging errors easier.

The Rust Standard Library provides methods to interact with standard input and output streams. The Stdin struct in the std::io module represents the handle to the input stream of a process. This handle implements the Read trait, which...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Practical System Programming for Rust Developers
Published in: Dec 2020Publisher: PacktISBN-13: 9781800560963

Author (1)

author image
Prabhu Eshwarla

Prabhu Eshwarla has been shipping high-quality, business-critical software to large enterprises and running IT operations for over 25 years. He is also a passionate teacher of complex technologies. Prabhu has worked with Hewlett Packard and has deep experience in software engineering, engineering management, and IT operations. Prabhu is passionate about Rust and blockchain and specializes in distributed systems. He considers coding to be a creative craft, and an excellent tool to create new digital worlds (and experiences) sustained through rigorous software engineering.
Read more about Prabhu Eshwarla