Struct tokio::io::Stdin [−][src]
pub struct Stdin { /* fields omitted */ }
Expand description
A handle to the standard input stream of a process.
The handle implements the AsyncRead
trait, but beware that concurrent
reads of Stdin
must be executed with care.
As an additional caveat, reading from the handle may block the calling future indefinitely if there is not enough data available. This makes this handle unsuitable for use in any circumstance where immediate reaction to available data is required, e.g. interactive use or when implementing a subprocess driven by requests on the standard input.
Created by the stdin
function.
Trait Implementations
impl AsyncRead for Stdin
[src]
impl AsyncRead for Stdin
[src]fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize>>
[src]
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize>>
[src]Attempts to read from the AsyncRead
into buf
. Read more
unsafe fn prepare_uninitialized_buffer(
&self,
buf: &mut [MaybeUninit<u8>]
) -> bool
[src]
unsafe fn prepare_uninitialized_buffer(
&self,
buf: &mut [MaybeUninit<u8>]
) -> bool
[src]Prepares an uninitialized buffer to be safe to pass to read
. Returns
true
if the supplied buffer was zeroed out. Read more