Function std::io::stdin [] [src]

pub fn stdin() -> Stdin

Creates a new handle to the global standard input stream of this process.

The handle returned refers to a globally shared buffer between all threads. Access is synchronized and can be explicitly controlled with the lock() method.

The Read trait is implemented for the returned value but the BufRead trait is not due to the global nature of the standard input stream. The locked version, StdinLock, implements both Read and BufRead, however.