[−][src]Struct async_std::io::Stdin
A handle to the standard input of the current process.
This reader is created by the stdin
function. See its documentation for
more.
Note: Windows Portability Consideration
When operating in a console, the Windows implementation of this stream does not support non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return an error.
Implementations
impl Stdin
[src][−]
pub async fn read_line<'_, '_>(&'_ self, buf: &'_ mut String) -> Result<usize>
[src][−]
Reads a line of input into the specified buffer.
Examples
use async_std::io; let stdin = io::stdin(); let mut line = String::new(); stdin.read_line(&mut line).await?;
pub async fn lock<'_>(&'_ self) -> StdinLock<'static>
[src][−]
This is supported on
unstable
only.Locks this handle to the standard input stream, returning a readable guard.
The lock is released when the returned lock goes out of scope. The returned guard also implements the Read trait for accessing the underlying data.
Examples
use async_std::io; use async_std::prelude::*; let mut buffer = String::new(); let stdin = io::stdin(); let mut handle = stdin.lock().await; handle.read_to_string(&mut buffer).await?;
Trait Implementations
impl AsRawFd for Stdin
[src][+]
impl AsRawHandle for Stdin
[src][+]
impl Debug for Stdin
[src][+]
impl Read for Stdin
[src][+]
Auto Trait Implementations
impl RefUnwindSafe for Stdin
impl Send for Stdin
impl Sync for Stdin
impl Unpin for Stdin
impl UnwindSafe for Stdin
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,