Struct tokio_process::Child [] [src]

pub struct Child { /* fields omitted */ }

Representation of a child process spawned onto an event loop.

This type is also a future which will yield the ExitStatus of the underlying child process. A Child here also provides access to information like the OS-assigned identifier and the stdio streams.

Note: The behavior of drop on a child in this crate is different than the behavior of the standard library. If a tokio_process::Child is dropped before the process finishes then the process will be terminated. In the standard library, however, the process continues executing. This is done because futures in general take drop as a sign of cancellation, and this Child is itself a future. If you'd like to run a process in the background, though, you may use the forget method.

Methods

impl Child
[src]

Returns the OS-assigned process identifier associated with this child.

Forces the child to exit.

This is equivalent to sending a SIGKILL on unix platforms.

Returns a handle for writing to the child's stdin, if it has been captured

Returns a handle for writing to the child's stdout, if it has been captured

Returns a handle for writing to the child's stderr, if it has been captured

Returns a future that will resolve to an Output, containing the exit status, stdout, and stderr of the child process.

The returned future will simultaneously waits for the 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 Output it is necessary to create new pipes between parent and child. Use stdout(Stdio::piped()) or stderr(Stdio::piped()), respectively, when creating a Command.

Drop this Child without killing the underlying process.

Normally a Child is killed if it's still alive when dropped, but this method will ensure that the child may continue running once the Child instance is dropped.

Trait Implementations

impl Future for Child
[src]

The type of value that this future will resolved with if it is successful. Read more

The type of error that this future will resolve with if it fails in a normal fashion. Read more

Query this future to see if its value has become available, registering interest if it is not. Read more

Block the current thread until this future is resolved. Read more

Convenience function for turning this future into a trait object which is also Send. Read more

Map this future's result to a different type, returning a new future of the resulting type. Read more

Map this future's error to a different error, returning a new future. Read more

Map this future's error to any error implementing From for this future's Error, returning a new future. Read more

Chain on a computation for when a future finished, passing the result of the future to the provided closure f. Read more

Execute another future after this one has resolved successfully. Read more

Execute another future if this one resolves with an error. Read more

Waits for either one of two futures to complete. Read more

Waits for either one of two differently-typed futures to complete. Read more

Joins the result of two futures, waiting for them both to complete. Read more

Same as join, but with more futures.

Same as join, but with more futures.

Same as join, but with more futures.

Convert this future into a single element stream. Read more

Flatten the execution of this future when the successful result of this future is itself another future. Read more

Flatten the execution of this future when the successful result of this future is a stream. Read more

Fuse a future such that poll will never again be called once it has completed. Read more

Catches unwinding panics while polling the future. Read more

Create a cloneable handle to this future where all handles will resolve to the same result. Read more

impl Drop for Child
[src]

A method called when the value goes out of scope. Read more