pub enum Stdin {
Open(ChildStdin),
Closed,
}Expand description
Represents the stdin stream of a child process.
stdin is always configured as piped, so it starts as Open with a ChildStdin handle
that can be used to write data to the process. It can be explicitly closed by calling
Stdin::close, after which it transitions to the Closed state.
Variants§
Implementations§
Source§impl Stdin
impl Stdin
Sourcepub fn as_mut(&mut self) -> Option<&mut ChildStdin>
pub fn as_mut(&mut self) -> Option<&mut ChildStdin>
Returns a mutable reference to the underlying ChildStdin if open, or None if closed.
Sourcepub fn close(&mut self)
pub fn close(&mut self)
Closes stdin by dropping the underlying ChildStdin handle.
This sends EOF to the child process. After calling this method, this stdin
will be in the Closed state and no further writes will be possible.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Stdin
impl RefUnwindSafe for Stdin
impl Send for Stdin
impl Sync for Stdin
impl Unpin for Stdin
impl UnwindSafe for Stdin
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more