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()`lock()` method.

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