Initial docs commit
This commit is contained in:
@@ -0,0 +1,334 @@
|
||||
<!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="This structure mimics the API of `std::process::Command` found in the standard library, but replaces functions that create a process with an asynchronous variant. The main provided asynchronous functions are spawn, status, and output."><meta name="keywords" content="rust, rustlang, rust-lang, Command"><title>tokio::process::Command - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></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">☰</div><a href='../../tokio/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct Command</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.arg">arg</a><a href="#method.args">args</a><a href="#method.current_dir">current_dir</a><a href="#method.env">env</a><a href="#method.env_clear">env_clear</a><a href="#method.env_remove">env_remove</a><a href="#method.envs">envs</a><a href="#method.gid">gid</a><a href="#method.kill_on_drop">kill_on_drop</a><a href="#method.new">new</a><a href="#method.output">output</a><a href="#method.pre_exec">pre_exec</a><a href="#method.spawn">spawn</a><a href="#method.status">status</a><a href="#method.stderr">stderr</a><a href="#method.stdin">stdin</a><a href="#method.stdout">stdout</a><a href="#method.uid">uid</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-From%3CCommand%3E">From<Command></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class="location"><a href="../index.html">tokio</a>::<wbr><a href="index.html">process</a></p><div id="sidebar-vars" data-name="Command" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="../index.html">tokio</a>::<wbr><a href="index.html">process</a>::<wbr><a class="struct" href="">Command</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/tokio/process/mod.rs.html#219-222" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Command { /* fields omitted */ }</pre></div><div class="docblock"><p>This structure mimics the API of <a href="https://doc.rust-lang.org/nightly/std/process/struct.Command.html"><code>std::process::Command</code></a> found in the standard library, but
|
||||
replaces functions that create a process with an asynchronous variant. The main provided
|
||||
asynchronous functions are <a href="../../tokio/process/struct.Command.html#method.spawn">spawn</a>, <a href="../../tokio/process/struct.Command.html#method.status">status</a>, and
|
||||
<a href="../../tokio/process/struct.Command.html#method.output">output</a>.</p>
|
||||
<p><code>Command</code> uses asynchronous versions of some <code>std</code> types (for example <a href="../../tokio/process/struct.Child.html"><code>Child</code></a>).</p>
|
||||
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/tokio/process/mod.rs.html#231-802" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.new" class="method"><code>pub fn <a href="#method.new" class="fnname">new</a><S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.OsStr.html" title="struct std::ffi::os_str::OsStr">OsStr</a>>>(program: S) -> <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a></code><a class="srclink" href="../../src/tokio/process/mod.rs.html#261-263" title="goto source code">[src]</a></h4><div class="docblock"><p>Constructs a new <code>Command</code> for launching the program at
|
||||
path <code>program</code>, with the following default configuration:</p>
|
||||
<ul>
|
||||
<li>No arguments to the program</li>
|
||||
<li>Inherit the current process’s environment</li>
|
||||
<li>Inherit the current process’s working directory</li>
|
||||
<li>Inherit stdin/stdout/stderr for <code>spawn</code> or <code>status</code>, but create pipes for <code>output</code></li>
|
||||
</ul>
|
||||
<p>Builder methods are provided to change these defaults and
|
||||
otherwise configure the process.</p>
|
||||
<p>If <code>program</code> is not an absolute path, the <code>PATH</code> will be searched in
|
||||
an OS-defined way.</p>
|
||||
<p>The search path to be used may be controlled by setting the
|
||||
<code>PATH</code> environment variable on the Command,
|
||||
but this has some implementation limitations on Windows
|
||||
(see issue <a href="https://github.com/rust-lang/rust/issues/37519">rust-lang/rust#37519</a>).</p>
|
||||
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
|
||||
<p>Basic usage:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">process</span>::<span class="ident">Command</span>;
|
||||
<span class="kw">let</span> <span class="ident">command</span> <span class="op">=</span> <span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">"sh"</span>);</pre></div>
|
||||
</div><h4 id="method.arg" class="method"><code>pub fn <a href="#method.arg" class="fnname">arg</a><S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.OsStr.html" title="struct std::ffi::os_str::OsStr">OsStr</a>>>(&mut self, arg: S) -> &mut <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a></code><a class="srclink" href="../../src/tokio/process/mod.rs.html#297-300" title="goto source code">[src]</a></h4><div class="docblock"><p>Adds an argument to pass to the program.</p>
|
||||
<p>Only one argument can be passed per use. So instead of:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||||
<span class="ident">tokio</span>::<span class="ident">process</span>::<span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">"sh"</span>)
|
||||
.<span class="ident">arg</span>(<span class="string">"-C /path/to/repo"</span>);</pre></div>
|
||||
<p>usage would be:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||||
<span class="ident">tokio</span>::<span class="ident">process</span>::<span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">"sh"</span>)
|
||||
.<span class="ident">arg</span>(<span class="string">"-C"</span>)
|
||||
.<span class="ident">arg</span>(<span class="string">"/path/to/repo"</span>);</pre></div>
|
||||
<p>To pass multiple arguments see <a href="../../tokio/process/struct.Command.html#method.args"><code>args</code></a>.</p>
|
||||
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
|
||||
<p>Basic usage:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">process</span>::<span class="ident">Command</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="ident">command</span> <span class="op">=</span> <span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">"ls"</span>)
|
||||
.<span class="ident">arg</span>(<span class="string">"-l"</span>)
|
||||
.<span class="ident">arg</span>(<span class="string">"-a"</span>);</pre></div>
|
||||
</div><h4 id="method.args" class="method"><code>pub fn <a href="#method.args" class="fnname">args</a><I, S>(&mut self, args: I) -> &mut <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = S>,<br> S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.OsStr.html" title="struct std::ffi::os_str::OsStr">OsStr</a>>, </span></code><a class="srclink" href="../../src/tokio/process/mod.rs.html#318-325" title="goto source code">[src]</a></h4><div class="docblock"><p>Adds multiple arguments to pass to the program.</p>
|
||||
<p>To pass a single argument see <a href="../../tokio/process/struct.Command.html#method.arg"><code>arg</code></a>.</p>
|
||||
<h1 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h1>
|
||||
<p>Basic usage:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">process</span>::<span class="ident">Command</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="ident">command</span> <span class="op">=</span> <span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">"ls"</span>)
|
||||
.<span class="ident">args</span>(<span class="kw-2">&</span>[<span class="string">"-l"</span>, <span class="string">"-a"</span>]);</pre></div>
|
||||
</div><h4 id="method.env" class="method"><code>pub fn <a href="#method.env" class="fnname">env</a><K, V>(&mut self, key: K, val: V) -> &mut <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a> <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.OsStr.html" title="struct std::ffi::os_str::OsStr">OsStr</a>>,<br> V: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.OsStr.html" title="struct std::ffi::os_str::OsStr">OsStr</a>>, </span></code><a class="srclink" href="../../src/tokio/process/mod.rs.html#342-349" title="goto source code">[src]</a></h4><div class="docblock"><p>Inserts or updates an environment variable mapping.</p>
|
||||
<p>Note that environment variable names are case-insensitive (but case-preserving) on Windows,
|
||||
and case-sensitive on all other platforms.</p>
|
||||
<h1 id="examples-3" class="section-header"><a href="#examples-3">Examples</a></h1>
|
||||
<p>Basic usage:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">process</span>::<span class="ident">Command</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="ident">command</span> <span class="op">=</span> <span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">"ls"</span>)
|
||||
.<span class="ident">env</span>(<span class="string">"PATH"</span>, <span class="string">"/bin"</span>);</pre></div>
|
||||
</div><h4 id="method.envs" class="method"><code>pub fn <a href="#method.envs" class="fnname">envs</a><I, K, V>(&mut self, vars: I) -> &mut <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>K, V<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>,<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.OsStr.html" title="struct std::ffi::os_str::OsStr">OsStr</a>>,<br> V: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.OsStr.html" title="struct std::ffi::os_str::OsStr">OsStr</a>>, </span></code><a class="srclink" href="../../src/tokio/process/mod.rs.html#374-382" title="goto source code">[src]</a></h4><div class="docblock"><p>Adds or updates multiple environment variable mappings.</p>
|
||||
<h1 id="examples-4" class="section-header"><a href="#examples-4">Examples</a></h1>
|
||||
<p>Basic usage:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">process</span>::<span class="ident">Command</span>;
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">process</span>::{<span class="ident">Stdio</span>};
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">env</span>;
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">HashMap</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="ident">filtered_env</span> : <span class="ident">HashMap</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">String</span><span class="op">></span> <span class="op">=</span>
|
||||
<span class="ident">env</span>::<span class="ident">vars</span>().<span class="ident">filter</span>(<span class="op">|</span><span class="kw-2">&</span>(<span class="kw-2">ref</span> <span class="ident">k</span>, <span class="kw">_</span>)<span class="op">|</span>
|
||||
<span class="ident">k</span> <span class="op">=</span><span class="op">=</span> <span class="string">"TERM"</span> <span class="op">|</span><span class="op">|</span> <span class="ident">k</span> <span class="op">=</span><span class="op">=</span> <span class="string">"TZ"</span> <span class="op">|</span><span class="op">|</span> <span class="ident">k</span> <span class="op">=</span><span class="op">=</span> <span class="string">"LANG"</span> <span class="op">|</span><span class="op">|</span> <span class="ident">k</span> <span class="op">=</span><span class="op">=</span> <span class="string">"PATH"</span>
|
||||
).<span class="ident">collect</span>();
|
||||
|
||||
<span class="kw">let</span> <span class="ident">command</span> <span class="op">=</span> <span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">"printenv"</span>)
|
||||
.<span class="ident">stdin</span>(<span class="ident">Stdio</span>::<span class="ident">null</span>())
|
||||
.<span class="ident">stdout</span>(<span class="ident">Stdio</span>::<span class="ident">inherit</span>())
|
||||
.<span class="ident">env_clear</span>()
|
||||
.<span class="ident">envs</span>(<span class="kw-2">&</span><span class="ident">filtered_env</span>);</pre></div>
|
||||
</div><h4 id="method.env_remove" class="method"><code>pub fn <a href="#method.env_remove" class="fnname">env_remove</a><K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.OsStr.html" title="struct std::ffi::os_str::OsStr">OsStr</a>>>(&mut self, key: K) -> &mut <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a></code><a class="srclink" href="../../src/tokio/process/mod.rs.html#396-399" title="goto source code">[src]</a></h4><div class="docblock"><p>Removes an environment variable mapping.</p>
|
||||
<h1 id="examples-5" class="section-header"><a href="#examples-5">Examples</a></h1>
|
||||
<p>Basic usage:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">process</span>::<span class="ident">Command</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="ident">command</span> <span class="op">=</span> <span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">"ls"</span>)
|
||||
.<span class="ident">env_remove</span>(<span class="string">"PATH"</span>);</pre></div>
|
||||
</div><h4 id="method.env_clear" class="method"><code>pub fn <a href="#method.env_clear" class="fnname">env_clear</a>(&mut self) -> &mut <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a></code><a class="srclink" href="../../src/tokio/process/mod.rs.html#413-416" title="goto source code">[src]</a></h4><div class="docblock"><p>Clears the entire environment map for the child process.</p>
|
||||
<h1 id="examples-6" class="section-header"><a href="#examples-6">Examples</a></h1>
|
||||
<p>Basic usage:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">process</span>::<span class="ident">Command</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="ident">command</span> <span class="op">=</span> <span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">"ls"</span>)
|
||||
.<span class="ident">env_clear</span>();</pre></div>
|
||||
</div><h4 id="method.current_dir" class="method"><code>pub fn <a href="#method.current_dir" class="fnname">current_dir</a><P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>>>(&mut self, dir: P) -> &mut <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a></code><a class="srclink" href="../../src/tokio/process/mod.rs.html#440-443" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the working directory for the child process.</p>
|
||||
<h1 id="platform-specific-behavior" class="section-header"><a href="#platform-specific-behavior">Platform-specific behavior</a></h1>
|
||||
<p>If the program path is relative (e.g., <code>"./script.sh"</code>), it’s ambiguous
|
||||
whether it should be interpreted relative to the parent’s working
|
||||
directory or relative to <code>current_dir</code>. The behavior in this case is
|
||||
platform specific and unstable, and it’s recommended to use
|
||||
<a href="../../tokio/fs/fn.canonicalize.html"><code>canonicalize</code></a> to get an absolute program path instead.</p>
|
||||
<h1 id="examples-7" class="section-header"><a href="#examples-7">Examples</a></h1>
|
||||
<p>Basic usage:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">process</span>::<span class="ident">Command</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="ident">command</span> <span class="op">=</span> <span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">"ls"</span>)
|
||||
.<span class="ident">current_dir</span>(<span class="string">"/bin"</span>);</pre></div>
|
||||
</div><h4 id="method.stdin" class="method"><code>pub fn <a href="#method.stdin" class="fnname">stdin</a><T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/process/struct.Stdio.html" title="struct std::process::Stdio">Stdio</a>>>(&mut self, cfg: T) -> &mut <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a></code><a class="srclink" href="../../src/tokio/process/mod.rs.html#464-467" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets configuration for the child process’s standard input (stdin) handle.</p>
|
||||
<p>Defaults to <a href="https://doc.rust-lang.org/nightly/std/process/struct.Stdio.html#method.inherit"><code>inherit</code></a> when used with <code>spawn</code> or <code>status</code>, and
|
||||
defaults to <a href="https://doc.rust-lang.org/nightly/std/process/struct.Stdio.html#method.piped"><code>piped</code></a> when used with <code>output</code>.</p>
|
||||
<h1 id="examples-8" class="section-header"><a href="#examples-8">Examples</a></h1>
|
||||
<p>Basic usage:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">process</span>::{<span class="ident">Stdio</span>};
|
||||
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">process</span>::<span class="ident">Command</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="ident">command</span> <span class="op">=</span> <span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">"ls"</span>)
|
||||
.<span class="ident">stdin</span>(<span class="ident">Stdio</span>::<span class="ident">null</span>());</pre></div>
|
||||
</div><h4 id="method.stdout" class="method"><code>pub fn <a href="#method.stdout" class="fnname">stdout</a><T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/process/struct.Stdio.html" title="struct std::process::Stdio">Stdio</a>>>(&mut self, cfg: T) -> &mut <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a></code><a class="srclink" href="../../src/tokio/process/mod.rs.html#488-491" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets configuration for the child process’s standard output (stdout) handle.</p>
|
||||
<p>Defaults to <a href="https://doc.rust-lang.org/nightly/std/process/struct.Stdio.html#method.inherit"><code>inherit</code></a> when used with <code>spawn</code> or <code>status</code>, and
|
||||
defaults to <a href="https://doc.rust-lang.org/nightly/std/process/struct.Stdio.html#method.piped"><code>piped</code></a> when used with <code>output</code>.</p>
|
||||
<h1 id="examples-9" class="section-header"><a href="#examples-9">Examples</a></h1>
|
||||
<p>Basic usage:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">process</span>::<span class="ident">Command</span>;;
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">process</span>::<span class="ident">Stdio</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="ident">command</span> <span class="op">=</span> <span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">"ls"</span>)
|
||||
.<span class="ident">stdout</span>(<span class="ident">Stdio</span>::<span class="ident">null</span>());</pre></div>
|
||||
</div><h4 id="method.stderr" class="method"><code>pub fn <a href="#method.stderr" class="fnname">stderr</a><T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/process/struct.Stdio.html" title="struct std::process::Stdio">Stdio</a>>>(&mut self, cfg: T) -> &mut <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a></code><a class="srclink" href="../../src/tokio/process/mod.rs.html#512-515" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets configuration for the child process’s standard error (stderr) handle.</p>
|
||||
<p>Defaults to <a href="https://doc.rust-lang.org/nightly/std/process/struct.Stdio.html#method.inherit"><code>inherit</code></a> when used with <code>spawn</code> or <code>status</code>, and
|
||||
defaults to <a href="https://doc.rust-lang.org/nightly/std/process/struct.Stdio.html#method.piped"><code>piped</code></a> when used with <code>output</code>.</p>
|
||||
<h1 id="examples-10" class="section-header"><a href="#examples-10">Examples</a></h1>
|
||||
<p>Basic usage:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">process</span>::<span class="ident">Command</span>;;
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">process</span>::{<span class="ident">Stdio</span>};
|
||||
|
||||
<span class="kw">let</span> <span class="ident">command</span> <span class="op">=</span> <span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">"ls"</span>)
|
||||
.<span class="ident">stderr</span>(<span class="ident">Stdio</span>::<span class="ident">null</span>());</pre></div>
|
||||
</div><h4 id="method.kill_on_drop" class="method"><code>pub fn <a href="#method.kill_on_drop" class="fnname">kill_on_drop</a>(&mut self, kill_on_drop: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> &mut <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a></code><a class="srclink" href="../../src/tokio/process/mod.rs.html#543-546" title="goto source code">[src]</a></h4><div class="docblock"><p>Controls whether a <code>kill</code> operation should be invoked on a spawned child
|
||||
process when its corresponding <code>Child</code> handle is dropped.</p>
|
||||
<p>By default, this value is assumed to be <code>false</code>, meaning the next spawned
|
||||
process will not be killed on drop, similar to the behavior of the standard
|
||||
library.</p>
|
||||
<h1 id="caveats" class="section-header"><a href="#caveats">Caveats</a></h1>
|
||||
<p>On Unix platforms processes must be “reaped” by their parent process after
|
||||
they have exited in order to release all OS resources. A child process which
|
||||
has exited, but has not yet been reaped by its parent is considered a “zombie”
|
||||
process. Such processes continue to count against limits imposed by the system,
|
||||
and having too many zombie processes present can prevent additional processes
|
||||
from being spawned.</p>
|
||||
<p>Although issuing a <code>kill</code> signal to the child process is a synchronous
|
||||
operation, the resulting zombie process cannot be <code>.await</code>ed inside of the
|
||||
destructor to avoid blocking other tasks. The tokio runtime will, on a
|
||||
best-effort basis, attempt to reap and clean up such processes in the
|
||||
background, but makes no additional guarantees are made with regards
|
||||
how quickly or how often this procedure will take place.</p>
|
||||
<p>If stronger guarantees are required, it is recommended to avoid dropping
|
||||
a <a href="../../tokio/process/struct.Child.html" title="Child"><code>Child</code></a> handle where possible, and instead utilize <code>child.wait().await</code>
|
||||
or <code>child.kill().await</code> where possible.</p>
|
||||
</div><h4 id="method.uid" class="method"><code>pub fn <a href="#method.uid" class="fnname">uid</a>(&mut self, id: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> &mut <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a></code><a class="srclink" href="../../src/tokio/process/mod.rs.html#563-566" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the child process’s user ID. This translates to a
|
||||
<code>setuid</code> call in the child process. Failure in the <code>setuid</code>
|
||||
call will cause the spawn to fail.</p>
|
||||
</div><h4 id="method.gid" class="method"><code>pub fn <a href="#method.gid" class="fnname">gid</a>(&mut self, id: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> &mut <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a></code><a class="srclink" href="../../src/tokio/process/mod.rs.html#571-574" title="goto source code">[src]</a></h4><div class="docblock"><p>Similar to <code>uid</code> but sets the group ID of the child process. This has
|
||||
the same semantics as the <code>uid</code> field.</p>
|
||||
</div><h4 id="method.pre_exec" class="method"><code>pub unsafe fn <a href="#method.pre_exec" class="fnname">pre_exec</a><F>(&mut self, f: F) -> &mut <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>() -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static, </span></code><a class="srclink" href="../../src/tokio/process/mod.rs.html#606-612" title="goto source code">[src]</a></h4><div class="docblock"><p>Schedules a closure to be run just before the <code>exec</code> function is
|
||||
invoked.</p>
|
||||
<p>The closure is allowed to return an I/O error whose OS error code will
|
||||
be communicated back to the parent and returned as an error from when
|
||||
the spawn was requested.</p>
|
||||
<p>Multiple closures can be registered and they will be called in order of
|
||||
their registration. If a closure returns <code>Err</code> then no further closures
|
||||
will be called and the spawn operation will immediately return with a
|
||||
failure.</p>
|
||||
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
|
||||
<p>This closure will be run in the context of the child process after a
|
||||
<code>fork</code>. This primarily means that any modifications made to memory on
|
||||
behalf of this closure will <strong>not</strong> be visible to the parent process.
|
||||
This is often a very constrained environment where normal operations
|
||||
like <code>malloc</code> or acquiring a mutex are not guaranteed to work (due to
|
||||
other threads perhaps still running when the <code>fork</code> was run).</p>
|
||||
<p>This also means that all resources such as file descriptors and
|
||||
memory-mapped regions got duplicated. It is your responsibility to make
|
||||
sure that the closure does not violate library invariants by making
|
||||
invalid use of these duplicates.</p>
|
||||
<p>When this closure is run, aspects such as the stdio file descriptors and
|
||||
working directory have successfully been changed, so output to these
|
||||
locations may not appear where intended.</p>
|
||||
</div><h4 id="method.spawn" class="method"><code>pub fn <a href="#method.spawn" class="fnname">spawn</a>(&mut self) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="struct" href="../../tokio/process/struct.Child.html" title="struct tokio::process::Child">Child</a>></code><a class="srclink" href="../../src/tokio/process/mod.rs.html#681-691" title="goto source code">[src]</a></h4><div class="docblock"><p>Executes the command as a child process, returning a handle to it.</p>
|
||||
<p>By default, stdin, stdout and stderr are inherited from the parent.</p>
|
||||
<p>This method will spawn the child process synchronously and return a
|
||||
handle to a future-aware child process. The <code>Child</code> returned implements
|
||||
<code>Future</code> itself to acquire the <code>ExitStatus</code> of the child, and otherwise
|
||||
the <code>Child</code> has methods to acquire handles to the stdin, stdout, and
|
||||
stderr streams.</p>
|
||||
<p>All I/O this child does will be associated with the current default
|
||||
event loop.</p>
|
||||
<h1 id="examples-11" class="section-header"><a href="#examples-11">Examples</a></h1>
|
||||
<p>Basic usage:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">process</span>::<span class="ident">Command</span>;
|
||||
|
||||
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">run_ls</span>() <span class="op">-</span><span class="op">></span> <span class="ident">std</span>::<span class="ident">process</span>::<span class="ident">ExitStatus</span> {
|
||||
<span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">"ls"</span>)
|
||||
.<span class="ident">spawn</span>()
|
||||
.<span class="ident">expect</span>(<span class="string">"ls command failed to start"</span>)
|
||||
.<span class="ident">wait</span>()
|
||||
.<span class="kw">await</span>
|
||||
.<span class="ident">expect</span>(<span class="string">"ls command failed to run"</span>)
|
||||
}</pre></div>
|
||||
<h1 id="caveats-1" class="section-header"><a href="#caveats-1">Caveats</a></h1><h2 id="droppingcancellation" class="section-header"><a href="#droppingcancellation">Dropping/Cancellation</a></h2>
|
||||
<p>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 <code>Child</code> handle has been dropped.</p>
|
||||
<p>The <a href="../../tokio/process/struct.Command.html#method.kill_on_drop"><code>Command::kill_on_drop</code></a> method can be used to modify this behavior
|
||||
and kill the child process if the <code>Child</code> wrapper is dropped before it
|
||||
has exited.</p>
|
||||
<h2 id="unix-processes" class="section-header"><a href="#unix-processes">Unix Processes</a></h2>
|
||||
<p>On Unix platforms processes must be “reaped” by their parent process after
|
||||
they have exited in order to release all OS resources. A child process which
|
||||
has exited, but has not yet been reaped by its parent is considered a “zombie”
|
||||
process. Such processes continue to count against limits imposed by the system,
|
||||
and having too many zombie processes present can prevent additional processes
|
||||
from being spawned.</p>
|
||||
<p>The tokio runtime will, on a best-effort basis, attempt to reap and clean up
|
||||
any process which it has spawned. No additional guarantees are made with regards
|
||||
how quickly or how often this procedure will take place.</p>
|
||||
<p>It is recommended to avoid dropping a <a href="../../tokio/process/struct.Child.html"><code>Child</code></a> process handle before it has been
|
||||
fully <code>await</code>ed if stricter cleanup guarantees are required.</p>
|
||||
<h1 id="errors" class="section-header"><a href="#errors">Errors</a></h1>
|
||||
<p>On Unix platforms this method will fail with <code>std::io::ErrorKind::WouldBlock</code>
|
||||
if the system process limit is reached (which includes other applications
|
||||
running on the system).</p>
|
||||
</div><h4 id="method.status" class="method"><code>pub fn <a href="#method.status" class="fnname">status</a>(&mut self) -> impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/process/struct.ExitStatus.html" title="struct std::process::ExitStatus">ExitStatus</a>>></code><a class="srclink" href="../../src/tokio/process/mod.rs.html#731-746" title="goto source code">[src]</a></h4><div class="docblock"><p>Executes the command as a child process, waiting for it to finish and
|
||||
collecting its exit status.</p>
|
||||
<p>By default, stdin, stdout and stderr are inherited from the parent.
|
||||
If any input/output handles are set to a pipe then they will be immediately
|
||||
closed after the child is spawned.</p>
|
||||
<p>All I/O this child does will be associated with the current default
|
||||
event loop.</p>
|
||||
<p>The destructor of the future returned by this function will kill
|
||||
the child if <a href="../../tokio/process/struct.Command.html#method.kill_on_drop"><code>kill_on_drop</code></a> is set to true.</p>
|
||||
<h1 id="errors-1" class="section-header"><a href="#errors-1">Errors</a></h1>
|
||||
<p>This future will return an error if the child process cannot be spawned
|
||||
or if there is an error while awaiting its status.</p>
|
||||
<p>On Unix platforms this method will fail with <code>std::io::ErrorKind::WouldBlock</code>
|
||||
if the system process limit is reached (which includes other applications
|
||||
running on the system).</p>
|
||||
<h1 id="examples-12" class="section-header"><a href="#examples-12">Examples</a></h1>
|
||||
<p>Basic usage:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">process</span>::<span class="ident">Command</span>;
|
||||
|
||||
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">run_ls</span>() <span class="op">-</span><span class="op">></span> <span class="ident">std</span>::<span class="ident">process</span>::<span class="ident">ExitStatus</span> {
|
||||
<span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">"ls"</span>)
|
||||
.<span class="ident">status</span>()
|
||||
.<span class="kw">await</span>
|
||||
.<span class="ident">expect</span>(<span class="string">"ls command failed to run"</span>)
|
||||
}</pre></div>
|
||||
</div><h4 id="method.output" class="method"><code>pub fn <a href="#method.output" class="fnname">output</a>(&mut self) -> impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/process/struct.Output.html" title="struct std::process::Output">Output</a>>></code><a class="srclink" href="../../src/tokio/process/mod.rs.html#794-801" title="goto source code">[src]</a></h4><div class="docblock"><p>Executes the command as a child process, waiting for it to finish and
|
||||
collecting all of its output.</p>
|
||||
<blockquote>
|
||||
<p><strong>Note</strong>: this method, unlike the standard library, will
|
||||
unconditionally configure the stdout/stderr handles to be pipes, even
|
||||
if they have been previously configured. If this is not desired then
|
||||
the <code>spawn</code> method should be used in combination with the
|
||||
<code>wait_with_output</code> method on child.</p>
|
||||
</blockquote>
|
||||
<p>This method will return a future representing the collection of the
|
||||
child process’s stdout/stderr. It will resolve to
|
||||
the <code>Output</code> type in the standard library, containing <code>stdout</code> and
|
||||
<code>stderr</code> as <code>Vec<u8></code> along with an <code>ExitStatus</code> representing how the
|
||||
process exited.</p>
|
||||
<p>All I/O this child does will be associated with the current default
|
||||
event loop.</p>
|
||||
<p>The destructor of the future returned by this function will kill
|
||||
the child if <a href="../../tokio/process/struct.Command.html#method.kill_on_drop"><code>kill_on_drop</code></a> is set to true.</p>
|
||||
<h1 id="errors-2" class="section-header"><a href="#errors-2">Errors</a></h1>
|
||||
<p>This future will return an error if the child process cannot be spawned
|
||||
or if there is an error while awaiting its status.</p>
|
||||
<p>On Unix platforms this method will fail with <code>std::io::ErrorKind::WouldBlock</code>
|
||||
if the system process limit is reached (which includes other applications
|
||||
running on the system).</p>
|
||||
<h1 id="examples-13" class="section-header"><a href="#examples-13">Examples</a></h1>
|
||||
<p>Basic usage:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">tokio</span>::<span class="ident">process</span>::<span class="ident">Command</span>;
|
||||
|
||||
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">run_ls</span>() {
|
||||
<span class="kw">let</span> <span class="ident">output</span>: <span class="ident">std</span>::<span class="ident">process</span>::<span class="ident">Output</span> <span class="op">=</span> <span class="ident">Command</span>::<span class="ident">new</span>(<span class="string">"ls"</span>)
|
||||
.<span class="ident">output</span>()
|
||||
.<span class="kw">await</span>
|
||||
.<span class="ident">expect</span>(<span class="string">"ls command failed to run"</span>);
|
||||
<span class="macro">println</span><span class="macro">!</span>(<span class="string">"stderr of ls: {:?}"</span>, <span class="ident">output</span>.<span class="ident">stderr</span>);
|
||||
}</pre></div>
|
||||
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../src/tokio/process/mod.rs.html#218" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../src/tokio/process/mod.rs.html#218" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||
</div></div><h3 id="impl-From%3CCommand%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/process/struct.Command.html" title="struct std::process::Command">Command</a>> for <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a></code><a href="#impl-From%3CCommand%3E" class="anchor"></a><a class="srclink" href="../../src/tokio/process/mod.rs.html#804-811" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(std: <a class="struct" href="https://doc.rust-lang.org/nightly/std/process/struct.Command.html" title="struct std::process::Command">StdCommand</a>) -> <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a></code><a class="srclink" href="../../src/tokio/process/mod.rs.html#805-810" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
</div></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a></code><a href="#impl-Send" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a></code><a href="#impl-Sync" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a></code><a href="#impl-Unpin" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../tokio/process/struct.Command.html" title="struct tokio::process::Command">Command</a></code><a href="#impl-UnwindSafe" class="anchor"></a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#207-211" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T<span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'_ mut </a>F</h3><code class="content"><span class="where fmt-newline">impl<'_, F> <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'_ mut </a>F <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <F as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#208" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-218" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T<span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'_ mut </a>F</h3><code class="content"><span class="where fmt-newline">impl<'_, F> <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'_ mut </a>F <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <F as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#215" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-549" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -> T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#546" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
</div></div><h3 id="impl-Into%3CU%3E" class="impl"><code class="in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#534-541" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -> U</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#538" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
</div></div><h3 id="impl-TryFrom%3CU%3E" class="impl"><code class="in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#582-591" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id="method.try_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
</div></div><h3 id="impl-TryInto%3CU%3E" class="impl"><code class="in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#568-577" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id="method.try_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#574" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="tokio"></div>
|
||||
<script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
||||
Reference in New Issue
Block a user