-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fefbd20
commit 4e69cad
Showing
2,640 changed files
with
144,557 additions
and
36,914 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!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="List of all items in this crate"><title>List of all items in this crate</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-d10b2a06af903387.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="async_process" data-themes="" data-resource-suffix="" data-rustdoc-version="1.82.0-nightly (8b3870784 2024-08-07)" data-channel="nightly" data-search-js="search-ef54e092fea9c776.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-118b08c4c78b968e.js"></script><script defer src="../static.files/main-04a29ac50d05d0b1.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="icon" href="https://raw.githubusercontent.com/smol-rs/smol/master/assets/images/logo_fullsize_transparent.png"></head><body class="rustdoc mod sys"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../async_process/index.html"><img src="https://raw.githubusercontent.com/smol-rs/smol/master/assets/images/logo_fullsize_transparent.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../async_process/index.html"><img src="https://raw.githubusercontent.com/smol-rs/smol/master/assets/images/logo_fullsize_transparent.png" alt="logo"></a><h2><a href="../async_process/index.html">async_<wbr>process</a><span class="version">2.2.3</span></h2></div><div class="sidebar-elems"><section><ul class="block"><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li></ul></section></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><h1>List of all items</h1><h3 id="structs">Structs</h3><ul class="all-items"><li><a href="struct.Child.html">Child</a></li><li><a href="struct.ChildStderr.html">ChildStderr</a></li><li><a href="struct.ChildStdin.html">ChildStdin</a></li><li><a href="struct.ChildStdout.html">ChildStdout</a></li><li><a href="struct.Command.html">Command</a></li></ul><h3 id="traits">Traits</h3><ul class="all-items"><li><a href="unix/trait.CommandExt.html">unix::CommandExt</a></li></ul><h3 id="functions">Functions</h3><ul class="all-items"><li><a href="fn.driver.html">driver</a></li></ul></section></div></main></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!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="Runs the driver for the asynchronous processes."><title>driver in async_process - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-d10b2a06af903387.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="async_process" data-themes="" data-resource-suffix="" data-rustdoc-version="1.82.0-nightly (8b3870784 2024-08-07)" data-channel="nightly" data-search-js="search-ef54e092fea9c776.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-118b08c4c78b968e.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-04a29ac50d05d0b1.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="icon" href="https://raw.githubusercontent.com/smol-rs/smol/master/assets/images/logo_fullsize_transparent.png"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../async_process/index.html"><img src="https://raw.githubusercontent.com/smol-rs/smol/master/assets/images/logo_fullsize_transparent.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../async_process/index.html"><img src="https://raw.githubusercontent.com/smol-rs/smol/master/assets/images/logo_fullsize_transparent.png" alt="logo"></a><h2><a href="../async_process/index.html">async_<wbr>process</a><span class="version">2.2.3</span></h2></div><div class="sidebar-elems"></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="index.html">async_process</a>::<wbr><a class="fn" href="#">driver</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../src/async_process/lib.rs.html#717-742">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub fn driver() -> 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="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Runs the driver for the asynchronous processes.</p> | ||
<p>This future takes control of global structures related to driving <a href="struct.Child.html" title="struct async_process::Child"><code>Child</code></a>ren and reaping | ||
zombie processes. These responsibilities include listening for the <code>SIGCHLD</code> signal and | ||
making sure zombie processes are successfully waited on.</p> | ||
<p>If multiple tasks run <code>driver()</code> at once, only one will actually drive the reaper; the other | ||
ones will just sleep. If a task that is driving the reaper is dropped, a previously sleeping | ||
task will take over. If all tasks driving the reaper are dropped, the “async-process” thread | ||
will be spawned. The “async-process” thread just blocks on this future and will automatically | ||
be spawned if no tasks are driving the reaper once a <a href="struct.Child.html" title="struct async_process::Child"><code>Child</code></a> is created.</p> | ||
<p>This future will never complete. It is intended to be ran on a background task in your | ||
executor of choice.</p> | ||
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2> | ||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>async_executor::Executor; | ||
<span class="kw">use </span>async_process::{driver, Command}; | ||
|
||
<span class="comment">// Create an executor and run on it. | ||
</span><span class="kw">let </span>ex = Executor::new(); | ||
ex.run(<span class="kw">async </span>{ | ||
<span class="comment">// Run the driver future in the background. | ||
</span>ex.spawn(driver()).detach(); | ||
|
||
<span class="comment">// Run a command. | ||
</span>Command::new(<span class="string">"ls"</span>).output().<span class="kw">await</span>.ok(); | ||
}).<span class="kw">await</span>;</code></pre></div> | ||
</div></details></section></div></main></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!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="Async interface for working with processes."><title>async_process - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-d10b2a06af903387.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="async_process" data-themes="" data-resource-suffix="" data-rustdoc-version="1.82.0-nightly (8b3870784 2024-08-07)" data-channel="nightly" data-search-js="search-ef54e092fea9c776.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-118b08c4c78b968e.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-04a29ac50d05d0b1.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="icon" href="https://raw.githubusercontent.com/smol-rs/smol/master/assets/images/logo_fullsize_transparent.png"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../async_process/index.html"><img src="https://raw.githubusercontent.com/smol-rs/smol/master/assets/images/logo_fullsize_transparent.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../async_process/index.html"><img src="https://raw.githubusercontent.com/smol-rs/smol/master/assets/images/logo_fullsize_transparent.png" alt="logo"></a><h2><a href="../async_process/index.html">async_<wbr>process</a><span class="version">2.2.3</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section><ul class="block"><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></section></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Crate <a class="mod" href="#">async_process</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../src/async_process/lib.rs.html#1-1242">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Async interface for working with processes.</p> | ||
<p>This crate is an async version of <a href="https://doc.rust-lang.org/nightly/std/process/index.html" title="mod std::process"><code>std::process</code></a>.</p> | ||
<h2 id="implementation"><a class="doc-anchor" href="#implementation">§</a>Implementation</h2> | ||
<p>A background thread named “async-process” is lazily created on first use, which waits for | ||
spawned child processes to exit and then calls the <code>wait()</code> syscall to clean up the “zombie” | ||
processes. This is unlike the <code>process</code> API in the standard library, where dropping a running | ||
<code>Child</code> leaks its resources.</p> | ||
<p>This crate uses <a href="https://docs.rs/async-io"><code>async-io</code></a> for async I/O on Unix-like systems and <a href="https://docs.rs/blocking"><code>blocking</code></a> for async I/O | ||
on Windows.</p> | ||
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2> | ||
<p>Spawn a process and collect its output:</p> | ||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>async_process::Command; | ||
|
||
<span class="kw">let </span>out = Command::new(<span class="string">"echo"</span>).arg(<span class="string">"hello"</span>).arg(<span class="string">"world"</span>).output().<span class="kw">await</span><span class="question-mark">?</span>; | ||
<span class="macro">assert_eq!</span>(out.stdout, <span class="string">b"hello world\n"</span>);</code></pre></div> | ||
<p>Read the output line-by-line as it gets produced:</p> | ||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>async_process::{Command, Stdio}; | ||
<span class="kw">use </span>futures_lite::{io::BufReader, prelude::<span class="kw-2">*</span>}; | ||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>child = Command::new(<span class="string">"find"</span>) | ||
.arg(<span class="string">"."</span>) | ||
.stdout(Stdio::piped()) | ||
.spawn()<span class="question-mark">?</span>; | ||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>lines = BufReader::new(child.stdout.take().unwrap()).lines(); | ||
|
||
<span class="kw">while let </span><span class="prelude-val">Some</span>(line) = lines.next().<span class="kw">await </span>{ | ||
<span class="macro">println!</span>(<span class="string">"{}"</span>, line<span class="question-mark">?</span>); | ||
}</code></pre></div> | ||
</div></details><h2 id="reexports" class="section-header">Re-exports<a href="#reexports" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name" id="reexport.ExitStatus"><code>pub use std::process::<a class="struct" href="https://doc.rust-lang.org/nightly/std/process/struct.ExitStatus.html" title="struct std::process::ExitStatus">ExitStatus</a>;</code></div></li><li><div class="item-name" id="reexport.Output"><code>pub use std::process::<a class="struct" href="https://doc.rust-lang.org/nightly/std/process/struct.Output.html" title="struct std::process::Output">Output</a>;</code></div></li><li><div class="item-name" id="reexport.Stdio"><code>pub use std::process::<a class="struct" href="https://doc.rust-lang.org/nightly/std/process/struct.Stdio.html" title="struct std::process::Stdio">Stdio</a>;</code></div></li></ul><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="mod" href="unix/index.html" title="mod async_process::unix">unix</a></div><div class="desc docblock-short">Unix-specific extensions.</div></li></ul><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.Child.html" title="struct async_process::Child">Child</a></div><div class="desc docblock-short">A spawned child process.</div></li><li><div class="item-name"><a class="struct" href="struct.ChildStderr.html" title="struct async_process::ChildStderr">Child<wbr>Stderr</a></div><div class="desc docblock-short">A handle to a child process’s standard error (stderr).</div></li><li><div class="item-name"><a class="struct" href="struct.ChildStdin.html" title="struct async_process::ChildStdin">Child<wbr>Stdin</a></div><div class="desc docblock-short">A handle to a child process’s standard input (stdin).</div></li><li><div class="item-name"><a class="struct" href="struct.ChildStdout.html" title="struct async_process::ChildStdout">Child<wbr>Stdout</a></div><div class="desc docblock-short">A handle to a child process’s standard output (stdout).</div></li><li><div class="item-name"><a class="struct" href="struct.Command.html" title="struct async_process::Command">Command</a></div><div class="desc docblock-short">A builder for spawning processes.</div></li></ul><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="fn" href="fn.driver.html" title="fn async_process::driver">driver</a></div><div class="desc docblock-short">Runs the driver for the asynchronous processes.</div></li></ul></section></div></main></body></html> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.