deploy: de38ae62916547ad097c066f94a32e9ba7790eeb

This commit is contained in:
NotAShelf 2025-02-05 00:10:33 +00:00
commit 9a86359447
28502 changed files with 1261284 additions and 0 deletions

1
tokio_macros/all.html Normal file
View file

@ -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-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.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-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="tokio_macros" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../tokio_macros/index.html">tokio_<wbr>macros</a><span class="version">2.4.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h3><a href="#attributes">Crate Items</a></h3><ul class="block"><li><a href="#attributes" title="Attribute Macros">Attribute Macros</a></li></ul></section><div id="rustdoc-modnav"></div></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="attributes">Attribute Macros</h3><ul class="all-items"><li><a href="attr.main.html">main</a></li><li><a href="attr.main_fail.html">main_fail</a></li><li><a href="attr.main_rt.html">main_rt</a></li><li><a href="attr.test.html">test</a></li><li><a href="attr.test_fail.html">test_fail</a></li><li><a href="attr.test_rt.html">test_rt</a></li></ul></section></div></main></body></html>

154
tokio_macros/attr.main.html Normal file
View file

@ -0,0 +1,154 @@
<!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="Marks async function to be executed by the selected runtime. This macro helps set up a `Runtime` without requiring the user to use Runtime or Builder directly."><title>main in tokio_macros - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.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-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="tokio_macros" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc attr"><!--[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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../tokio_macros/index.html">tokio_<wbr>macros</a><span class="version">2.4.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">main</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#non-worker-async-function" title="Non-worker async function">Non-worker async function</a></li><li><a href="#multi-threaded-runtime" title="Multi-threaded runtime">Multi-threaded runtime</a></li><li><a href="#current-thread-runtime" title="Current thread runtime">Current thread runtime</a><ul><li><a href="#function-arguments" title="Function arguments:">Function arguments:</a></li><li><a href="#usage" title="Usage">Usage</a></li></ul></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate tokio_<wbr>macros</a></h2></div></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"><span class="rustdoc-breadcrumbs"><a href="index.html">tokio_macros</a></span><h1>Attribute Macro <span class="attr">main</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/tokio_macros/lib.rs.html#252-254">Source</a> </span></div><pre class="rust item-decl"><code>#[main]</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Marks async function to be executed by the selected runtime. This macro
helps set up a <code>Runtime</code> without requiring the user to use
<a href="../tokio/runtime/struct.Runtime.html">Runtime</a> or
<a href="../tokio/runtime/struct.Builder.html">Builder</a> directly.</p>
<p>Note: This macro is designed to be simplistic and targets applications that
do not require a complex setup. If the provided functionality is not
sufficient, you may be interested in using
<a href="../tokio/runtime/struct.Builder.html">Builder</a>, which provides a more
powerful interface.</p>
<p>Note: This macro can be used on any function and not just the <code>main</code>
function. Using it on a non-main function makes the function behave as if it
was synchronous by starting a new runtime each time it is called. If the
function is called often, it is preferable to create the runtime using the
runtime builder so the runtime can be reused across calls.</p>
<h2 id="non-worker-async-function"><a class="doc-anchor" href="#non-worker-async-function">§</a>Non-worker async function</h2>
<p>Note that the async function marked with this macro does not run as a
worker. The expectation is that other tasks are spawned by the function here.
Awaiting on other futures from the function provided here will not
perform as fast as those spawned as workers.</p>
<h2 id="multi-threaded-runtime"><a class="doc-anchor" href="#multi-threaded-runtime">§</a>Multi-threaded runtime</h2>
<p>To use the multi-threaded runtime, the macro can be configured using</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[tokio::main(flavor = <span class="string">"multi_thread"</span>, worker_threads = <span class="number">10</span>)]</span></code></pre></div>
<p>The <code>worker_threads</code> option configures the number of worker threads, and
defaults to the number of cpus on the system. This is the default flavor.</p>
<p>Note: The multi-threaded runtime requires the <code>rt-multi-thread</code> feature
flag.</p>
<h2 id="current-thread-runtime"><a class="doc-anchor" href="#current-thread-runtime">§</a>Current thread runtime</h2>
<p>To use the single-threaded runtime known as the <code>current_thread</code> runtime,
the macro can be configured using</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[tokio::main(flavor = <span class="string">"current_thread"</span>)]</span></code></pre></div>
<h3 id="function-arguments"><a class="doc-anchor" href="#function-arguments">§</a>Function arguments:</h3>
<p>Arguments are allowed for any functions aside from <code>main</code> which is special</p>
<h3 id="usage"><a class="doc-anchor" href="#usage">§</a>Usage</h3><h4 id="using-the-multi-thread-runtime"><a class="doc-anchor" href="#using-the-multi-thread-runtime">§</a>Using the multi-thread runtime</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[tokio::main]
</span><span class="kw">async fn </span>main() {
<span class="macro">println!</span>(<span class="string">"Hello world"</span>);
}</code></pre></div>
<p>Equivalent code not using <code>#[tokio::main]</code></p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">fn </span>main() {
tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()
.unwrap()
.block_on(<span class="kw">async </span>{
<span class="macro">println!</span>(<span class="string">"Hello world"</span>);
})
}</code></pre></div>
<h4 id="using-current-thread-runtime"><a class="doc-anchor" href="#using-current-thread-runtime">§</a>Using current thread runtime</h4>
<p>The basic scheduler is single-threaded.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[tokio::main(flavor = <span class="string">"current_thread"</span>)]
</span><span class="kw">async fn </span>main() {
<span class="macro">println!</span>(<span class="string">"Hello world"</span>);
}</code></pre></div>
<p>Equivalent code not using <code>#[tokio::main]</code></p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">fn </span>main() {
tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()
.unwrap()
.block_on(<span class="kw">async </span>{
<span class="macro">println!</span>(<span class="string">"Hello world"</span>);
})
}</code></pre></div>
<h4 id="set-number-of-worker-threads"><a class="doc-anchor" href="#set-number-of-worker-threads">§</a>Set number of worker threads</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[tokio::main(worker_threads = <span class="number">2</span>)]
</span><span class="kw">async fn </span>main() {
<span class="macro">println!</span>(<span class="string">"Hello world"</span>);
}</code></pre></div>
<p>Equivalent code not using <code>#[tokio::main]</code></p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">fn </span>main() {
tokio::runtime::Builder::new_multi_thread()
.worker_threads(<span class="number">2</span>)
.enable_all()
.build()
.unwrap()
.block_on(<span class="kw">async </span>{
<span class="macro">println!</span>(<span class="string">"Hello world"</span>);
})
}</code></pre></div>
<h4 id="configure-the-runtime-to-start-with-time-paused"><a class="doc-anchor" href="#configure-the-runtime-to-start-with-time-paused">§</a>Configure the runtime to start with time paused</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[tokio::main(flavor = <span class="string">"current_thread"</span>, start_paused = <span class="bool-val">true</span>)]
</span><span class="kw">async fn </span>main() {
<span class="macro">println!</span>(<span class="string">"Hello world"</span>);
}</code></pre></div>
<p>Equivalent code not using <code>#[tokio::main]</code></p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">fn </span>main() {
tokio::runtime::Builder::new_current_thread()
.enable_all()
.start_paused(<span class="bool-val">true</span>)
.build()
.unwrap()
.block_on(<span class="kw">async </span>{
<span class="macro">println!</span>(<span class="string">"Hello world"</span>);
})
}</code></pre></div>
<p>Note that <code>start_paused</code> requires the <code>test-util</code> feature to be enabled.</p>
<h4 id="rename-package"><a class="doc-anchor" href="#rename-package">§</a>Rename package</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio <span class="kw">as </span>tokio1;
<span class="attr">#[tokio1::main(<span class="kw">crate </span>= <span class="string">"tokio1"</span>)]
</span><span class="kw">async fn </span>main() {
<span class="macro">println!</span>(<span class="string">"Hello world"</span>);
}</code></pre></div>
<p>Equivalent code not using <code>#[tokio::main]</code></p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio <span class="kw">as </span>tokio1;
<span class="kw">fn </span>main() {
tokio1::runtime::Builder::new_multi_thread()
.enable_all()
.build()
.unwrap()
.block_on(<span class="kw">async </span>{
<span class="macro">println!</span>(<span class="string">"Hello world"</span>);
})
}</code></pre></div>
<h4 id="configure-unhandled-panic-behavior"><a class="doc-anchor" href="#configure-unhandled-panic-behavior">§</a>Configure unhandled panic behavior</h4>
<p>Available options are <code>shutdown_runtime</code> and <code>ignore</code>. For more details, see
<a href="../tokio/runtime/struct.Builder.html#method.unhandled_panic"><code>Builder::unhandled_panic</code></a>.</p>
<p>This option is only compatible with the <code>current_thread</code> runtime.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[cfg(tokio_unstable)]
#[tokio::main(flavor = <span class="string">"current_thread"</span>, unhandled_panic = <span class="string">"shutdown_runtime"</span>)]
</span><span class="kw">async fn </span>main() {
<span class="kw">let _ </span>= tokio::spawn(<span class="kw">async </span>{
<span class="macro">panic!</span>(<span class="string">"This panic will shutdown the runtime."</span>);
}).<span class="kw">await</span>;
}</code></pre></div>
<p>Equivalent code not using <code>#[tokio::main]</code></p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[cfg(tokio_unstable)]
</span><span class="kw">fn </span>main() {
tokio::runtime::Builder::new_current_thread()
.enable_all()
.unhandled_panic(UnhandledPanic::ShutdownRuntime)
.build()
.unwrap()
.block_on(<span class="kw">async </span>{
<span class="kw">let _ </span>= tokio::spawn(<span class="kw">async </span>{
<span class="macro">panic!</span>(<span class="string">"This panic will shutdown the runtime."</span>);
}).<span class="kw">await</span>;
})
}</code></pre></div>
<p><strong>Note</strong>: This option depends on Tokios <a href="../tokio/index.html#unstable-features">unstable API</a>. See <a href="../tokio/index.html#unstable-features">the
documentation on unstable features</a> for details on how to enable
Tokios unstable features.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,2 @@
<!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="Always fails with the error message below."><title>main_fail in tokio_macros - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.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-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="tokio_macros" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc attr"><!--[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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../tokio_macros/index.html">tokio_<wbr>macros</a><span class="version">2.4.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></div></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"><span class="rustdoc-breadcrumbs"><a href="index.html">tokio_macros</a></span><h1>Attribute Macro <span class="attr">main_fail</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/tokio_macros/lib.rs.html#544-551">Source</a> </span></div><pre class="rust item-decl"><code>#[main_fail]</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Always fails with the error message below.</p>
<div class="example-wrap"><pre class="language-text"><code>The #[tokio::main] macro requires rt or rt-multi-thread.</code></pre></div></div></details></section></div></main></body></html>

View file

@ -0,0 +1,42 @@
<!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="Marks async function to be executed by selected runtime. This macro helps set up a `Runtime` without requiring the user to use Runtime or Builder directly."><title>main_rt in tokio_macros - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.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-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="tokio_macros" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc attr"><!--[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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../tokio_macros/index.html">tokio_<wbr>macros</a><span class="version">2.4.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">main_rt</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#function-arguments" title="Function arguments:">Function arguments:</a></li><li><a href="#usage" title="Usage">Usage</a><ul><li><a href="#using-default" title="Using default">Using default</a></li><li><a href="#rename-package" title="Rename package">Rename package</a></li></ul></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate tokio_<wbr>macros</a></h2></div></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"><span class="rustdoc-breadcrumbs"><a href="index.html">tokio_macros</a></span><h1>Attribute Macro <span class="attr">main_rt</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/tokio_macros/lib.rs.html#316-318">Source</a> </span></div><pre class="rust item-decl"><code>#[main_rt]</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Marks async function to be executed by selected runtime. This macro helps set up a <code>Runtime</code>
without requiring the user to use <a href="../tokio/runtime/struct.Runtime.html">Runtime</a> or
<a href="../tokio/runtime/struct.Builder.html">Builder</a> directly.</p>
<h3 id="function-arguments"><a class="doc-anchor" href="#function-arguments">§</a>Function arguments:</h3>
<p>Arguments are allowed for any functions aside from <code>main</code> which is special</p>
<h3 id="usage"><a class="doc-anchor" href="#usage">§</a>Usage</h3><h4 id="using-default"><a class="doc-anchor" href="#using-default">§</a>Using default</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[tokio::main(flavor = <span class="string">"current_thread"</span>)]
</span><span class="kw">async fn </span>main() {
<span class="macro">println!</span>(<span class="string">"Hello world"</span>);
}</code></pre></div>
<p>Equivalent code not using <code>#[tokio::main]</code></p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">fn </span>main() {
tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()
.unwrap()
.block_on(<span class="kw">async </span>{
<span class="macro">println!</span>(<span class="string">"Hello world"</span>);
})
}</code></pre></div>
<h4 id="rename-package"><a class="doc-anchor" href="#rename-package">§</a>Rename package</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio <span class="kw">as </span>tokio1;
<span class="attr">#[tokio1::main(<span class="kw">crate </span>= <span class="string">"tokio1"</span>)]
</span><span class="kw">async fn </span>main() {
<span class="macro">println!</span>(<span class="string">"Hello world"</span>);
}</code></pre></div>
<p>Equivalent code not using <code>#[tokio::main]</code></p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio <span class="kw">as </span>tokio1;
<span class="kw">fn </span>main() {
tokio1::runtime::Builder::new_multi_thread()
.enable_all()
.build()
.unwrap()
.block_on(<span class="kw">async </span>{
<span class="macro">println!</span>(<span class="string">"Hello world"</span>);
})
}</code></pre></div>
</div></details></section></div></main></body></html>

138
tokio_macros/attr.test.html Normal file
View file

@ -0,0 +1,138 @@
<!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="Marks async function to be executed by runtime, suitable to test environment. This macro helps set up a `Runtime` without requiring the user to use Runtime or Builder directly."><title>test in tokio_macros - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.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-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="tokio_macros" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc attr"><!--[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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../tokio_macros/index.html">tokio_<wbr>macros</a><span class="version">2.4.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">test</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#multi-threaded-runtime" title="Multi-threaded runtime">Multi-threaded runtime</a></li><li><a href="#current-thread-runtime" title="Current thread runtime">Current thread runtime</a><ul><li><a href="#usage" title="Usage">Usage</a></li></ul></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate tokio_<wbr>macros</a></h2></div></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"><span class="rustdoc-breadcrumbs"><a href="index.html">tokio_macros</a></span><h1>Attribute Macro <span class="attr">test</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/tokio_macros/lib.rs.html#520-522">Source</a> </span></div><pre class="rust item-decl"><code>#[test]</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Marks async function to be executed by runtime, suitable to test environment.
This macro helps set up a <code>Runtime</code> without requiring the user to use
<a href="../tokio/runtime/struct.Runtime.html">Runtime</a> or
<a href="../tokio/runtime/struct.Builder.html">Builder</a> directly.</p>
<p>Note: This macro is designed to be simplistic and targets applications that
do not require a complex setup. If the provided functionality is not
sufficient, you may be interested in using
<a href="../tokio/runtime/struct.Builder.html">Builder</a>, which provides a more
powerful interface.</p>
<h2 id="multi-threaded-runtime"><a class="doc-anchor" href="#multi-threaded-runtime">§</a>Multi-threaded runtime</h2>
<p>To use the multi-threaded runtime, the macro can be configured using</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[tokio::test(flavor = <span class="string">"multi_thread"</span>, worker_threads = <span class="number">1</span>)]
</span><span class="kw">async fn </span>my_test() {
<span class="macro">assert!</span>(<span class="bool-val">true</span>);
}</code></pre></div>
<p>The <code>worker_threads</code> option configures the number of worker threads, and
defaults to the number of cpus on the system.</p>
<p>Note: The multi-threaded runtime requires the <code>rt-multi-thread</code> feature
flag.</p>
<h2 id="current-thread-runtime"><a class="doc-anchor" href="#current-thread-runtime">§</a>Current thread runtime</h2>
<p>The default test runtime is single-threaded. Each test gets a
separate current-thread runtime.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[tokio::test]
</span><span class="kw">async fn </span>my_test() {
<span class="macro">assert!</span>(<span class="bool-val">true</span>);
}</code></pre></div>
<h3 id="usage"><a class="doc-anchor" href="#usage">§</a>Usage</h3><h4 id="using-the-multi-thread-runtime"><a class="doc-anchor" href="#using-the-multi-thread-runtime">§</a>Using the multi-thread runtime</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[tokio::test(flavor = <span class="string">"multi_thread"</span>)]
</span><span class="kw">async fn </span>my_test() {
<span class="macro">assert!</span>(<span class="bool-val">true</span>);
}</code></pre></div>
<p>Equivalent code not using <code>#[tokio::test]</code></p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[test]
</span><span class="kw">fn </span>my_test() {
tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()
.unwrap()
.block_on(<span class="kw">async </span>{
<span class="macro">assert!</span>(<span class="bool-val">true</span>);
})
}</code></pre></div>
<h4 id="using-current-thread-runtime"><a class="doc-anchor" href="#using-current-thread-runtime">§</a>Using current thread runtime</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[tokio::test]
</span><span class="kw">async fn </span>my_test() {
<span class="macro">assert!</span>(<span class="bool-val">true</span>);
}</code></pre></div>
<p>Equivalent code not using <code>#[tokio::test]</code></p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[test]
</span><span class="kw">fn </span>my_test() {
tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()
.unwrap()
.block_on(<span class="kw">async </span>{
<span class="macro">assert!</span>(<span class="bool-val">true</span>);
})
}</code></pre></div>
<h4 id="set-number-of-worker-threads"><a class="doc-anchor" href="#set-number-of-worker-threads">§</a>Set number of worker threads</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[tokio::test(flavor = <span class="string">"multi_thread"</span>, worker_threads = <span class="number">2</span>)]
</span><span class="kw">async fn </span>my_test() {
<span class="macro">assert!</span>(<span class="bool-val">true</span>);
}</code></pre></div>
<p>Equivalent code not using <code>#[tokio::test]</code></p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[test]
</span><span class="kw">fn </span>my_test() {
tokio::runtime::Builder::new_multi_thread()
.worker_threads(<span class="number">2</span>)
.enable_all()
.build()
.unwrap()
.block_on(<span class="kw">async </span>{
<span class="macro">assert!</span>(<span class="bool-val">true</span>);
})
}</code></pre></div>
<h4 id="configure-the-runtime-to-start-with-time-paused"><a class="doc-anchor" href="#configure-the-runtime-to-start-with-time-paused">§</a>Configure the runtime to start with time paused</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[tokio::test(start_paused = <span class="bool-val">true</span>)]
</span><span class="kw">async fn </span>my_test() {
<span class="macro">assert!</span>(<span class="bool-val">true</span>);
}</code></pre></div>
<p>Equivalent code not using <code>#[tokio::test]</code></p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[test]
</span><span class="kw">fn </span>my_test() {
tokio::runtime::Builder::new_current_thread()
.enable_all()
.start_paused(<span class="bool-val">true</span>)
.build()
.unwrap()
.block_on(<span class="kw">async </span>{
<span class="macro">assert!</span>(<span class="bool-val">true</span>);
})
}</code></pre></div>
<p>Note that <code>start_paused</code> requires the <code>test-util</code> feature to be enabled.</p>
<h4 id="rename-package"><a class="doc-anchor" href="#rename-package">§</a>Rename package</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio <span class="kw">as </span>tokio1;
<span class="attr">#[tokio1::test(<span class="kw">crate </span>= <span class="string">"tokio1"</span>)]
</span><span class="kw">async fn </span>my_test() {
<span class="macro">println!</span>(<span class="string">"Hello world"</span>);
}</code></pre></div>
<h4 id="configure-unhandled-panic-behavior"><a class="doc-anchor" href="#configure-unhandled-panic-behavior">§</a>Configure unhandled panic behavior</h4>
<p>Available options are <code>shutdown_runtime</code> and <code>ignore</code>. For more details, see
<a href="../tokio/runtime/struct.Builder.html#method.unhandled_panic"><code>Builder::unhandled_panic</code></a>.</p>
<p>This option is only compatible with the <code>current_thread</code> runtime.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[cfg(tokio_unstable)]
#[tokio::test(flavor = <span class="string">"current_thread"</span>, unhandled_panic = <span class="string">"shutdown_runtime"</span>)]
</span><span class="kw">async fn </span>my_test() {
<span class="kw">let _ </span>= tokio::spawn(<span class="kw">async </span>{
<span class="macro">panic!</span>(<span class="string">"This panic will shutdown the runtime."</span>);
}).<span class="kw">await</span>;
}</code></pre></div>
<p>Equivalent code not using <code>#[tokio::test]</code></p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[cfg(tokio_unstable)]
#[test]
</span><span class="kw">fn </span>my_test() {
tokio::runtime::Builder::new_current_thread()
.enable_all()
.unhandled_panic(UnhandledPanic::ShutdownRuntime)
.build()
.unwrap()
.block_on(<span class="kw">async </span>{
<span class="kw">let _ </span>= tokio::spawn(<span class="kw">async </span>{
<span class="macro">panic!</span>(<span class="string">"This panic will shutdown the runtime."</span>);
}).<span class="kw">await</span>;
})
}</code></pre></div>
<p><strong>Note</strong>: This option depends on Tokios <a href="../tokio/index.html#unstable-features">unstable API</a>. See <a href="../tokio/index.html#unstable-features">the
documentation on unstable features</a> for details on how to enable
Tokios unstable features.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,2 @@
<!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="Always fails with the error message below."><title>test_fail in tokio_macros - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.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-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="tokio_macros" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc attr"><!--[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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../tokio_macros/index.html">tokio_<wbr>macros</a><span class="version">2.4.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></div></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"><span class="rustdoc-breadcrumbs"><a href="index.html">tokio_macros</a></span><h1>Attribute Macro <span class="attr">test_fail</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/tokio_macros/lib.rs.html#558-565">Source</a> </span></div><pre class="rust item-decl"><code>#[test_fail]</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Always fails with the error message below.</p>
<div class="example-wrap"><pre class="language-text"><code>The #[tokio::test] macro requires rt or rt-multi-thread.</code></pre></div></div></details></section></div></main></body></html>

View file

@ -0,0 +1,7 @@
<!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="Marks async function to be executed by runtime, suitable to test environment"><title>test_rt in tokio_macros - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.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-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="tokio_macros" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc attr"><!--[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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../tokio_macros/index.html">tokio_<wbr>macros</a><span class="version">2.4.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">test_rt</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#usage" title="Usage">Usage</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate tokio_<wbr>macros</a></h2></div></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"><span class="rustdoc-breadcrumbs"><a href="index.html">tokio_macros</a></span><h1>Attribute Macro <span class="attr">test_rt</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/tokio_macros/lib.rs.html#535-537">Source</a> </span></div><pre class="rust item-decl"><code>#[test_rt]</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Marks async function to be executed by runtime, suitable to test environment</p>
<h3 id="usage"><a class="doc-anchor" href="#usage">§</a>Usage</h3>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[tokio::test]
</span><span class="kw">async fn </span>my_test() {
<span class="macro">assert!</span>(<span class="bool-val">true</span>);
}</code></pre></div>
</div></details></section></div></main></body></html>

10
tokio_macros/index.html Normal file
View file

@ -0,0 +1,10 @@
<!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="Macros for use with Tokio"><title>tokio_macros - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.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-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="tokio_macros" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../tokio_macros/index.html">tokio_<wbr>macros</a><span class="version">2.4.0</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#attributes">Crate Items</a></h3><ul class="block"><li><a href="#attributes" title="Attribute Macros">Attribute Macros</a></li></ul></section><div id="rustdoc-modnav"></div></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 <span>tokio_macros</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/tokio_macros/lib.rs.html#1-581">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Macros for use with Tokio</p>
</div></details><h2 id="attributes" class="section-header">Attribute Macros<a href="#attributes" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="attr" href="attr.main.html" title="attr tokio_macros::main">main</a></div><div class="desc docblock-short">Marks async function to be executed by the selected runtime. This macro
helps set up a <code>Runtime</code> without requiring the user to use
<a href="../tokio/runtime/struct.Runtime.html">Runtime</a> or
<a href="../tokio/runtime/struct.Builder.html">Builder</a> directly.</div></li><li><div class="item-name"><a class="attr" href="attr.main_fail.html" title="attr tokio_macros::main_fail">main_<wbr>fail</a></div><div class="desc docblock-short">Always fails with the error message below.</div></li><li><div class="item-name"><a class="attr" href="attr.main_rt.html" title="attr tokio_macros::main_rt">main_rt</a></div><div class="desc docblock-short">Marks async function to be executed by selected runtime. This macro helps set up a <code>Runtime</code>
without requiring the user to use <a href="../tokio/runtime/struct.Runtime.html">Runtime</a> or
<a href="../tokio/runtime/struct.Builder.html">Builder</a> directly.</div></li><li><div class="item-name"><a class="attr" href="attr.test.html" title="attr tokio_macros::test">test</a></div><div class="desc docblock-short">Marks async function to be executed by runtime, suitable to test environment.
This macro helps set up a <code>Runtime</code> without requiring the user to use
<a href="../tokio/runtime/struct.Runtime.html">Runtime</a> or
<a href="../tokio/runtime/struct.Builder.html">Builder</a> directly.</div></li><li><div class="item-name"><a class="attr" href="attr.test_fail.html" title="attr tokio_macros::test_fail">test_<wbr>fail</a></div><div class="desc docblock-short">Always fails with the error message below.</div></li><li><div class="item-name"><a class="attr" href="attr.test_rt.html" title="attr tokio_macros::test_rt">test_rt</a></div><div class="desc docblock-short">Marks async function to be executed by runtime, suitable to test environment</div></li></ul></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"attr":["main","main_fail","main_rt","test","test_fail","test_rt"]};