Struct Stdin
pub struct Stdin { /* private fields */ }
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.
This handle is best used for non-interactive uses, such as when a file
is piped into the application. For technical reasons, stdin is
implemented by using an ordinary blocking read on a separate thread, and
it is impossible to cancel that read. This can make shutdown of the
runtime hang until the user presses enter.
For interactive uses, it is recommended to spawn a thread dedicated to user input and use blocking IO directly in that thread.
Created by the stdin function.
Trait Implementations
impl AsFd for Stdin
fn as_fd(&self) -> BorrowedFd<'_>
impl AsRawFd for Stdin
fn as_raw_fd(&self) -> RawFd
impl AsyncRead for Stdin
fn poll_read(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll<Result<()>>
impl Debug for Stdin
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl Freeze for Stdin
impl RefUnwindSafe for Stdin
impl Send for Stdin
impl Sync for Stdin
impl Unpin for Stdin
impl UnsafeUnpin for Stdin
impl UnwindSafe for Stdin
Blanket Implementations
impl<R> AsyncReadExt for Stdin
where
R: AsyncRead + ?Sized,
impl<T> Any for Stdin
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Stdin
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Stdin
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for Stdin
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into<U> for Stdin
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Stdin
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Stdin
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>