[−][src]Struct tokio::process::Child
feature="process"
only.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.
Caveats
Similar to the behavior to the standard library, and unlike the futures
paradigm of dropping-implies-cancellation, a spawned process will, by
default, continue to execute even after the Child
handle has been dropped.
The Command::kill_on_drop
method can be used to modify this behavior
and kill the child process if the Child
wrapper is dropped before it
has exited.
Methods
impl Child
[src]
pub fn id(&self) -> u32
[src]
feature="process"
only.Returns the OS-assigned process identifier associated with this child.
pub fn kill(&mut self) -> Result<()>
[src]
feature="process"
only.Forces the child to exit.
This is equivalent to sending a SIGKILL on unix platforms.
pub fn stdin(&mut self) -> &mut Option<ChildStdin>
[src]
feature="process"
only.Returns a handle for writing to the child's stdin, if it has been captured.
pub fn stdout(&mut self) -> &mut Option<ChildStdout>
[src]
feature="process"
only.Returns a handle for reading from the child's stdout, if it has been captured.
pub fn stderr(&mut self) -> &mut Option<ChildStderr>
[src]
feature="process"
only.Returns a handle for reading from the child's stderr, if it has been captured.
pub async fn wait_with_output(__arg0: Self) -> Result<Output>
[src]
feature="process"
only.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
.
Trait Implementations
Auto Trait Implementations
impl Send for Child
impl Sync for Child
impl Unpin for Child
impl !UnwindSafe for Child
impl !RefUnwindSafe for Child
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<F, T, E> TryFuture for F where
F: Future<Output = Result<T, E>> + ?Sized,
[src]
F: Future<Output = Result<T, E>> + ?Sized,