Sophie

Sophie

distrib > Mageia > 6 > x86_64 > media > core-updates > by-pkgid > fdedb3cf2140df9b6d419a2338ab1caa > files > 5548

rust-doc-1.25.0-1.mga6.x86_64.rpm

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="rustdoc">
    <meta name="description" content="API documentation for the Rust `Child` struct in crate `std`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, Child">

    <title>std::process::Child - Rust</title>

    <link rel="stylesheet" type="text/css" href="../../normalize.css">
    <link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle">
    
    <link rel="stylesheet" type="text/css" href="../../dark.css">
    <link rel="stylesheet" type="text/css" href="../../main.css" id="themeStyle">
    <script src="../../storage.js"></script>
    

    <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico">
    
</head>
<body class="rustdoc struct">
    <!--[if lte IE 8]>
    <div class="warning">
        This old browser is unsupported and will most likely display funky
        things.
    </div>
    <![endif]-->

    

    <nav class="sidebar">
        <div class="sidebar-menu">&#9776;</div>
        <a href='../../std/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a>
        <p class='location'>Struct Child</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.stdin">stdin</a><a href="#structfield.stdout">stdout</a><a href="#structfield.stderr">stderr</a></div><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.kill">kill</a><a href="#method.id">id</a><a href="#method.wait">wait</a><a href="#method.try_wait">try_wait</a><a href="#method.wait_with_output">wait_with_output</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-AsRawHandle">AsRawHandle</a><a href="#impl-IntoRawHandle">IntoRawHandle</a></div></div><p class='location'><a href='../index.html'>std</a>::<wbr><a href='index.html'>process</a></p><script>window.sidebarCurrent = {name: 'Child', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
    </nav>

    <div class="theme-picker">
        <button id="theme-picker" aria-label="Pick another theme!">
            <img src="../../brush.svg" width="18" alt="Pick another theme!">
        </button>
        <div id="theme-choices"></div>
    </div>
    <script src="../../theme.js"></script>
    <nav class="sub">
        <form class="search-form js-only">
            <div class="search-container">
                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
                       type="search">
            </div>
        </form>
    </nav>

    <section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>std</a>::<wbr><a href='index.html'>process</a>::<wbr><a class="struct" href=''>Child</a></span><span class='out-of-band'><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><span id='render-detail'>
                   <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
                       [<span class='inner'>&#x2212;</span>]
                   </a>
               </span><a class='srclink' href='../../src/std/process.rs.html#167-184' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct Child {
    pub stdin: <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="struct" href="../../std/process/struct.ChildStdin.html" title="struct std::process::ChildStdin">ChildStdin</a>&gt;,
    pub stdout: <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="struct" href="../../std/process/struct.ChildStdout.html" title="struct std::process::ChildStdout">ChildStdout</a>&gt;,
    pub stderr: <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="struct" href="../../std/process/struct.ChildStderr.html" title="struct std::process::ChildStderr">ChildStderr</a>&gt;,
    // some fields omitted
}</pre><div class='docblock'><p>Representation of a running or exited child process.</p>
<p>This structure is used to represent and manage child processes. A child
process is created via the <a href="struct.Command.html"><code>Command</code></a> struct, which configures the
spawning process and can itself be constructed using a builder-style
interface.</p>
<p>There is no implementation of <a href="../../core/ops/trait.Drop.html"><code>Drop</code></a> for child processes,
so if you do not ensure the <code>Child</code> has exited then it will continue to
run, even after the <code>Child</code> handle to the child process has gone out of
scope.</p>
<p>Calling <a href="#method.wait"><code>wait</code></a> (or other functions that wrap around it) will make
the parent process wait until the child has actually exited before
continuing.</p>
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">process</span>::<span class="ident">Command</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">child</span> <span class="op">=</span> <span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">&quot;/bin/cat&quot;</span>)
                        .<span class="ident">arg</span>(<span class="string">&quot;file.txt&quot;</span>)
                        .<span class="ident">spawn</span>()
                        .<span class="ident">expect</span>(<span class="string">&quot;failed to execute child&quot;</span>);

<span class="kw">let</span> <span class="ident">ecode</span> <span class="op">=</span> <span class="ident">child</span>.<span class="ident">wait</span>()
                 .<span class="ident">expect</span>(<span class="string">&quot;failed to wait on child&quot;</span>);

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">ecode</span>.<span class="ident">success</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Aprocess%3A%3ACommand%3B%0A%0Alet%20mut%20child%20%3D%20Command%3A%3Anew(%22%2Fbin%2Fcat%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.arg(%22file.txt%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.spawn()%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.expect(%22failed%20to%20execute%20child%22)%3B%0A%0Alet%20ecode%20%3D%20child.wait()%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.expect(%22failed%20to%20wait%20on%20child%22)%3B%0A%0Aassert!(ecode.success())%3B%0A%7D">Run</a></pre>
</div><h2 id='fields' class='fields small-section-header'>
                       Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.stdin" class="structfield small-section-header">
                           <a href="#structfield.stdin" class="anchor field"></a>
                           <span id="stdin.v" class='invisible'>
                           <code>stdin: <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="struct" href="../../std/process/struct.ChildStdin.html" title="struct std::process::ChildStdin">ChildStdin</a>&gt;</code>
                           </span></span><div class='docblock'><p>The handle for writing to the child's standard input (stdin), if it has
been captured.</p>
</div><span id="structfield.stdout" class="structfield small-section-header">
                           <a href="#structfield.stdout" class="anchor field"></a>
                           <span id="stdout.v" class='invisible'>
                           <code>stdout: <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="struct" href="../../std/process/struct.ChildStdout.html" title="struct std::process::ChildStdout">ChildStdout</a>&gt;</code>
                           </span></span><div class='docblock'><p>The handle for reading from the child's standard output (stdout), if it
has been captured.</p>
</div><span id="structfield.stderr" class="structfield small-section-header">
                           <a href="#structfield.stderr" class="anchor field"></a>
                           <span id="stderr.v" class='invisible'>
                           <code>stderr: <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="struct" href="../../std/process/struct.ChildStderr.html" title="struct std::process::ChildStderr">ChildStderr</a>&gt;</code>
                           </span></span><div class='docblock'><p>The handle for reading from the child's standard error (stderr), if it
has been captured.</p>
</div>
                    <h2 id='methods' class='small-section-header'>
                      Methods<a href='#methods' class='anchor'></a>
                    </h2>
                <h3 id='impl' class='impl'><span class='in-band'><code>impl <a class="struct" href="../../std/process/struct.Child.html" title="struct std::process::Child">Child</a></code><a href='#impl' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/process.rs.html#1083-1256' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.kill' class="method"><span id='kill.v' class='invisible'><code>pub fn <a href='#method.kill' class='fnname'>kill</a>(&amp;mut self) -&gt; <a class="type" href="../../std/io/type.Result.html" title="type std::io::Result">Result</a>&lt;<a class="primitive" href="../primitive.unit.html">()</a>&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/process.rs.html#1102-1104' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Forces the child to exit. This is equivalent to sending a
SIGKILL on unix platforms.</p>
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">process</span>::<span class="ident">Command</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">command</span> <span class="op">=</span> <span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">&quot;yes&quot;</span>);
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Ok</span>(<span class="kw-2">mut</span> <span class="ident">child</span>) <span class="op">=</span> <span class="ident">command</span>.<span class="ident">spawn</span>() {
    <span class="ident">child</span>.<span class="ident">kill</span>().<span class="ident">expect</span>(<span class="string">&quot;command wasn&#39;t running&quot;</span>);
} <span class="kw">else</span> {
    <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;yes command didn&#39;t start&quot;</span>);
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Aprocess%3A%3ACommand%3B%0A%0Alet%20mut%20command%20%3D%20Command%3A%3Anew(%22yes%22)%3B%0Aif%20let%20Ok(mut%20child)%20%3D%20command.spawn()%20%7B%0A%20%20%20%20child.kill().expect(%22command%20wasn't%20running%22)%3B%0A%7D%20else%20%7B%0A%20%20%20%20println!(%22yes%20command%20didn't%20start%22)%3B%0A%7D%0A%7D">Run</a></pre>
</div><h4 id='method.id' class="method"><span id='id.v' class='invisible'><code>pub fn <a href='#method.id' class='fnname'>id</a>(&amp;self) -&gt; <a class="primitive" href="../primitive.u32.html">u32</a></code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.3.0'>1.3.0</div><a class='srclink' href='../../src/std/process.rs.html#1123-1125' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Returns the OS-assigned process identifier associated with this child.</p>
<h1 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">process</span>::<span class="ident">Command</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">command</span> <span class="op">=</span> <span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">&quot;ls&quot;</span>);
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Ok</span>(<span class="ident">child</span>) <span class="op">=</span> <span class="ident">command</span>.<span class="ident">spawn</span>() {
    <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;Child&#39;s id is {}&quot;</span>, <span class="ident">child</span>.<span class="ident">id</span>());
} <span class="kw">else</span> {
    <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;ls command didn&#39;t start&quot;</span>);
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Aprocess%3A%3ACommand%3B%0A%0Alet%20mut%20command%20%3D%20Command%3A%3Anew(%22ls%22)%3B%0Aif%20let%20Ok(child)%20%3D%20command.spawn()%20%7B%0A%20%20%20%20println!(%22Child's%20id%20is%20%7B%7D%22%2C%20child.id())%3B%0A%7D%20else%20%7B%0A%20%20%20%20println!(%22ls%20command%20didn't%20start%22)%3B%0A%7D%0A%7D">Run</a></pre>
</div><h4 id='method.wait' class="method"><span id='wait.v' class='invisible'><code>pub fn <a href='#method.wait' class='fnname'>wait</a>(&amp;mut self) -&gt; <a class="type" href="../../std/io/type.Result.html" title="type std::io::Result">Result</a>&lt;<a class="struct" href="../../std/process/struct.ExitStatus.html" title="struct std::process::ExitStatus">ExitStatus</a>&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/process.rs.html#1152-1155' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Waits for the 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.</p>
<p>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.</p>
<h1 id="examples-3" class="section-header"><a href="#examples-3">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">process</span>::<span class="ident">Command</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">command</span> <span class="op">=</span> <span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">&quot;ls&quot;</span>);
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Ok</span>(<span class="kw-2">mut</span> <span class="ident">child</span>) <span class="op">=</span> <span class="ident">command</span>.<span class="ident">spawn</span>() {
    <span class="ident">child</span>.<span class="ident">wait</span>().<span class="ident">expect</span>(<span class="string">&quot;command wasn&#39;t running&quot;</span>);
    <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;Child has finished its execution!&quot;</span>);
} <span class="kw">else</span> {
    <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;ls command didn&#39;t start&quot;</span>);
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Aprocess%3A%3ACommand%3B%0A%0Alet%20mut%20command%20%3D%20Command%3A%3Anew(%22ls%22)%3B%0Aif%20let%20Ok(mut%20child)%20%3D%20command.spawn()%20%7B%0A%20%20%20%20child.wait().expect(%22command%20wasn't%20running%22)%3B%0A%20%20%20%20println!(%22Child%20has%20finished%20its%20execution!%22)%3B%0A%7D%20else%20%7B%0A%20%20%20%20println!(%22ls%20command%20didn't%20start%22)%3B%0A%7D%0A%7D">Run</a></pre>
</div><h4 id='method.try_wait' class="method"><span id='try_wait.v' class='invisible'><code>pub fn <a href='#method.try_wait' class='fnname'>try_wait</a>(&amp;mut self) -&gt; <a class="type" href="../../std/io/type.Result.html" title="type std::io::Result">Result</a>&lt;<a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="struct" href="../../std/process/struct.ExitStatus.html" title="struct std::process::ExitStatus">ExitStatus</a>&gt;&gt;</code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.18.0'>1.18.0</div><a class='srclink' href='../../src/std/process.rs.html#1192-1194' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Attempts to collect the exit status of the child if it has already
exited.</p>
<p>This function will not block the calling thread and will only advisorily
check to see if the child process has exited or not. If the child has
exited then on Unix the process id is reaped. This function is
guaranteed to repeatedly return a successful exit status so long as the
child has already exited.</p>
<p>If the child has exited, then <code>Ok(Some(status))</code> is returned. If the
exit status is not available at this time then <code>Ok(None)</code> is returned.
If an error occurs, then that error is returned.</p>
<p>Note that unlike <code>wait</code>, this function will not attempt to drop stdin.</p>
<h1 id="examples-4" class="section-header"><a href="#examples-4">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">process</span>::<span class="ident">Command</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">child</span> <span class="op">=</span> <span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">&quot;ls&quot;</span>).<span class="ident">spawn</span>().<span class="ident">unwrap</span>();

<span class="kw">match</span> <span class="ident">child</span>.<span class="ident">try_wait</span>() {
    <span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="ident">status</span>)) <span class="op">=&gt;</span> <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;exited with: {}&quot;</span>, <span class="ident">status</span>),
    <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>) <span class="op">=&gt;</span> {
        <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;status not ready yet, let&#39;s really wait&quot;</span>);
        <span class="kw">let</span> <span class="ident">res</span> <span class="op">=</span> <span class="ident">child</span>.<span class="ident">wait</span>();
        <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;result: {:?}&quot;</span>, <span class="ident">res</span>);
    }
    <span class="prelude-val">Err</span>(<span class="ident">e</span>) <span class="op">=&gt;</span> <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;error attempting to wait: {}&quot;</span>, <span class="ident">e</span>),
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Aprocess%3A%3ACommand%3B%0A%0Alet%20mut%20child%20%3D%20Command%3A%3Anew(%22ls%22).spawn().unwrap()%3B%0A%0Amatch%20child.try_wait()%20%7B%0A%20%20%20%20Ok(Some(status))%20%3D%3E%20println!(%22exited%20with%3A%20%7B%7D%22%2C%20status)%2C%0A%20%20%20%20Ok(None)%20%3D%3E%20%7B%0A%20%20%20%20%20%20%20%20println!(%22status%20not%20ready%20yet%2C%20let's%20really%20wait%22)%3B%0A%20%20%20%20%20%20%20%20let%20res%20%3D%20child.wait()%3B%0A%20%20%20%20%20%20%20%20println!(%22result%3A%20%7B%3A%3F%7D%22%2C%20res)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Err(e)%20%3D%3E%20println!(%22error%20attempting%20to%20wait%3A%20%7B%7D%22%2C%20e)%2C%0A%7D%0A%7D">Run</a></pre>
</div><h4 id='method.wait_with_output' class="method"><span id='wait_with_output.v' class='invisible'><code>pub fn <a href='#method.wait_with_output' class='fnname'>wait_with_output</a>(self) -&gt; <a class="type" href="../../std/io/type.Result.html" title="type std::io::Result">Result</a>&lt;<a class="struct" href="../../std/process/struct.Output.html" title="struct std::process::Output">Output</a>&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/process.rs.html#1229-1255' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Simultaneously waits for the child to exit and collect all remaining
output on the stdout/stderr handles, returning an <code>Output</code>
instance.</p>
<p>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.</p>
<p>By default, stdin, stdout and stderr are inherited from the parent.
In order to capture the output into this <code>Result&lt;Output&gt;</code> it is
necessary to create new pipes between parent and child. Use
<code>stdout(Stdio::piped())</code> or <code>stderr(Stdio::piped())</code>, respectively.</p>
<h1 id="examples-5" class="section-header"><a href="#examples-5">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">process</span>::{<span class="ident">Command</span>, <span class="ident">Stdio</span>};

<span class="kw">let</span> <span class="ident">child</span> <span class="op">=</span> <span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">&quot;/bin/cat&quot;</span>)
    .<span class="ident">arg</span>(<span class="string">&quot;file.txt&quot;</span>)
    .<span class="ident">stdout</span>(<span class="ident">Stdio</span>::<span class="ident">piped</span>())
    .<span class="ident">spawn</span>()
    .<span class="ident">expect</span>(<span class="string">&quot;failed to execute child&quot;</span>);

<span class="kw">let</span> <span class="ident">output</span> <span class="op">=</span> <span class="ident">child</span>
    .<span class="ident">wait_with_output</span>()
    .<span class="ident">expect</span>(<span class="string">&quot;failed to wait on child&quot;</span>);

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">output</span>.<span class="ident">status</span>.<span class="ident">success</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Aprocess%3A%3A%7BCommand%2C%20Stdio%7D%3B%0A%0Alet%20child%20%3D%20Command%3A%3Anew(%22%2Fbin%2Fcat%22)%0A%20%20%20%20.arg(%22file.txt%22)%0A%20%20%20%20.stdout(Stdio%3A%3Apiped())%0A%20%20%20%20.spawn()%0A%20%20%20%20.expect(%22failed%20to%20execute%20child%22)%3B%0A%0Alet%20output%20%3D%20child%0A%20%20%20%20.wait_with_output()%0A%20%20%20%20.expect(%22failed%20to%20wait%20on%20child%22)%3B%0A%0Aassert!(output.status.success())%3B%0A%7D">Run</a></pre>
</div></div>
            <h2 id='implementations' class='small-section-header'>
              Trait Implementations<a href='#implementations' class='anchor'></a>
            </h2>
        <h3 id='impl-Debug' class='impl'><span class='in-band'><code>impl <a class="trait" href="../../std/fmt/trait.Debug.html" title="trait std::fmt::Debug">Debug</a> for <a class="struct" href="../../std/process/struct.Child.html" title="struct std::process::Child">Child</a></code><a href='#impl-Debug' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.16.0'>1.16.0</div><a class='srclink' href='../../src/std/process.rs.html#206-214' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><code>fn <a href='../../std/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="../../std/fmt/struct.Formatter.html" title="struct std::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="../../std/fmt/type.Result.html" title="type std::fmt::Result">Result</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/process.rs.html#207-213' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Formats the value using the given formatter. <a href="../../std/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-AsRawHandle' class='impl'><span class='in-band'><code>impl <a class="trait" href="../../std/os/windows/io/trait.AsRawHandle.html" title="trait std::os::windows::io::AsRawHandle">AsRawHandle</a> for <a class="struct" href="../../std/process/struct.Child.html" title="struct std::process::Child">Child</a></code><a href='#impl-AsRawHandle' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.2.0'>1.2.0</div><a class='srclink' href='../../src/std/sys/windows/ext/process.rs.html#30-34' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.as_raw_handle' class="method"><span id='as_raw_handle.v' class='invisible'><code>fn <a href='../../std/os/windows/io/trait.AsRawHandle.html#tymethod.as_raw_handle' class='fnname'>as_raw_handle</a>(&amp;self) -&gt; <a class="type" href="../../std/os/windows/io/type.RawHandle.html" title="type std::os::windows::io::RawHandle">RawHandle</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/sys/windows/ext/process.rs.html#31-33' title='goto source code'>[src]</a></span></h4>
<div class='stability'><div class='stab portability'>This is supported on <strong>Windows</strong> only.</div></div><div class='docblock'><p>Extracts the raw handle, without taking any ownership.</p>
</div></div><h3 id='impl-IntoRawHandle' class='impl'><span class='in-band'><code>impl <a class="trait" href="../../std/os/windows/io/trait.IntoRawHandle.html" title="trait std::os::windows::io::IntoRawHandle">IntoRawHandle</a> for <a class="struct" href="../../std/process/struct.Child.html" title="struct std::process::Child">Child</a></code><a href='#impl-IntoRawHandle' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.4.0'>1.4.0</div><a class='srclink' href='../../src/std/sys/windows/ext/process.rs.html#37-41' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.into_raw_handle' class="method"><span id='into_raw_handle.v' class='invisible'><code>fn <a href='../../std/os/windows/io/trait.IntoRawHandle.html#tymethod.into_raw_handle' class='fnname'>into_raw_handle</a>(self) -&gt; <a class="type" href="../../std/os/windows/io/type.RawHandle.html" title="type std::os::windows::io::RawHandle">RawHandle</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/sys/windows/ext/process.rs.html#38-40' title='goto source code'>[src]</a></span></h4>
<div class='stability'><div class='stab portability'>This is supported on <strong>Windows</strong> only.</div></div><div class='docblock'><p>Consumes this object, returning the raw underlying handle. <a href="../../std/os/windows/io/trait.IntoRawHandle.html#tymethod.into_raw_handle">Read more</a></p>
</div></div></section>
    <section id='search' class="content hidden"></section>

    <section class="footer"></section>

    <aside id="help" class="hidden">
        <div>
            <h1 class="hidden">Help</h1>

            <div class="shortcuts">
                <h2>Keyboard Shortcuts</h2>

                <dl>
                    <dt><kbd>?</kbd></dt>
                    <dd>Show this help dialog</dd>
                    <dt><kbd>S</kbd></dt>
                    <dd>Focus the search field</dd>
                    <dt><kbd>↑</kbd></dt>
                    <dd>Move up in search results</dd>
                    <dt><kbd>↓</kbd></dt>
                    <dd>Move down in search results</dd>
                    <dt><kbd>↹</kbd></dt>
                    <dd>Switch tab</dd>
                    <dt><kbd>&#9166;</kbd></dt>
                    <dd>Go to active search result</dd>
                    <dt><kbd>+</kbd></dt>
                    <dd>Expand all sections</dd>
                    <dt><kbd>-</kbd></dt>
                    <dd>Collapse all sections</dd>
                </dl>
            </div>

            <div class="infos">
                <h2>Search Tricks</h2>

                <p>
                    Prefix searches with a type followed by a colon (e.g.
                    <code>fn:</code>) to restrict the search to a given type.
                </p>

                <p>
                    Accepted types are: <code>fn</code>, <code>mod</code>,
                    <code>struct</code>, <code>enum</code>,
                    <code>trait</code>, <code>type</code>, <code>macro</code>,
                    and <code>const</code>.
                </p>

                <p>
                    Search functions by type signature (e.g.
                    <code>vec -> usize</code> or <code>* -> vec</code>)
                </p>
            </div>
        </div>
    </aside>

    

    <script>
        window.rootPath = "../../";
        window.currentCrate = "std";
    </script>
    <script src="../../main.js"></script>
    <script defer src="../../search-index.js"></script>
</body>
</html>