Type Alias RemoteChild

Source
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: Clone> Child<S>

Source

pub fn session(&self) -> S

Access the SSH session that this remote process was spawned from.

Source§

impl<S> Child<S>

Source

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.

Source

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.

Source

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.

Source

pub fn stdin(&mut self) -> &mut Option<ChildStdin>

Access the handle for reading from the remote child’s standard input (stdin), if requested.

Source

pub fn stdout(&mut self) -> &mut Option<ChildStdout>

Access the handle for reading from the remote child’s standard output (stdout), if requested.

Source

pub fn stderr(&mut self) -> &mut Option<ChildStderr>

Access the handle for reading from the remote child’s standard error (stderr), if requested.

Trait Implementations

Source§

impl<S: Debug> Debug for Child<S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more