pub type RemoteChild<'a> = Child<&'a Session>;
Expand description
Convenience Child
alias when working with a session reference.
Aliased Type§
struct RemoteChild<'a> { /* private fields */ }
Implementations
Source§impl<S> Child<S>
impl<S> Child<S>
Sourcepub async fn disconnect(self) -> Result<()>
pub async fn disconnect(self) -> Result<()>
Disconnect from this given remote child process.
Note that disconnecting does not kill the remote process, it merely kills the local handle to that remote process.
Sourcepub async fn wait(self) -> Result<ExitStatus, Error>
pub async fn wait(self) -> Result<ExitStatus, Error>
Waits for the remote child to exit completely, returning the status that it exited with.
This function will continue to have the same return value after it has been called at least once.
The stdin handle to the child process, if any, will be closed before waiting. This helps avoid deadlock: it ensures that the child does not block waiting for input from the parent, while the parent waits for the child to exit.
Sourcepub async fn wait_with_output(self) -> Result<Output, Error>
pub async fn wait_with_output(self) -> Result<Output, Error>
Simultaneously waits for the remote child to exit and collect all remaining output on the
stdout/stderr handles, returning an Output
instance.
The stdin handle to the child process, if any, will be closed before waiting. This helps avoid deadlock: it ensures that the child does not block waiting for input from the parent, while the parent waits for the child to exit.
By default, stdin, stdout and stderr are inherited from the parent. In order to capture the
output into this Result<Output>
it is necessary to create new pipes between parent and
child. Use stdout(Stdio::piped())
or stderr(Stdio::piped())
, respectively.
Sourcepub fn stdin(&mut self) -> &mut Option<ChildStdin>
pub fn stdin(&mut self) -> &mut Option<ChildStdin>
Access the handle for reading from the remote child’s standard input (stdin), if requested.
Sourcepub fn stdout(&mut self) -> &mut Option<ChildStdout>
pub fn stdout(&mut self) -> &mut Option<ChildStdout>
Access the handle for reading from the remote child’s standard output (stdout), if requested.
Sourcepub fn stderr(&mut self) -> &mut Option<ChildStderr>
pub fn stderr(&mut self) -> &mut Option<ChildStderr>
Access the handle for reading from the remote child’s standard error (stderr), if requested.