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, or implicitly closed by the staged
ProcessHandle::wait_for_completion builder and ProcessHandle::kill, after which it
transitions to the Closed state. Note that some operations (kill) close stdin early in
order to match the behavior of tokio.
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. The staged
ProcessHandle::wait_for_completion builder and ProcessHandle::kill also close
any still-open stdin automatically; call this method when the child must observe EOF
earlier.