mirror of
https://github.com/NotAShelf/mpvrc.git
synced 2026-04-18 00:38:14 +00:00
deploy: de38ae62916547ad097c066f94a32e9ba7790eeb
This commit is contained in:
commit
9a86359447
28502 changed files with 1261284 additions and 0 deletions
154
tokio/time/enum.MissedTickBehavior.html
Normal file
154
tokio/time/enum.MissedTickBehavior.html
Normal file
File diff suppressed because one or more lines are too long
2
tokio/time/error/index.html
Normal file
2
tokio/time/error/index.html
Normal 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="Time error types."><title>tokio::time::error - 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" 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 mod"><!--[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/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module error</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In tokio::<wbr>time</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</a>::<wbr><a href="../index.html">time</a></span><h1>Module <span>error</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/time/error.rs.html#1-123">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Time error types.</p>
|
||||
</div></details><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.Elapsed.html" title="struct tokio::time::error::Elapsed">Elapsed</a></div><div class="desc docblock-short">Errors returned by <code>Timeout</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.Error.html" title="struct tokio::time::error::Error">Error</a></div><div class="desc docblock-short">Errors encountered by the timer implementation.</div></li></ul></section></div></main></body></html>
|
||||
1
tokio/time/error/sidebar-items.js
Normal file
1
tokio/time/error/sidebar-items.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
window.SIDEBAR_ITEMS = {"struct":["Elapsed","Error"]};
|
||||
16
tokio/time/error/struct.Elapsed.html
Normal file
16
tokio/time/error/struct.Elapsed.html
Normal file
File diff suppressed because one or more lines are too long
40
tokio/time/error/struct.Error.html
Normal file
40
tokio/time/error/struct.Error.html
Normal file
File diff suppressed because one or more lines are too long
48
tokio/time/fn.interval.html
Normal file
48
tokio/time/fn.interval.html
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<!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="Creates new `Interval` that yields with interval of `period`. The first tick completes immediately. The default `MissedTickBehavior` is `Burst`, but this can be configured by calling `set_missed_tick_behavior`."><title>interval in tokio::time - 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" 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 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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">interval</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>time</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</a>::<wbr><a href="index.html">time</a></span><h1>Function <span class="fn">interval</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/time/interval.rs.html#73-76">Source</a> </span></div><pre class="rust item-decl"><code>pub fn interval(period: <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>) -> <a class="struct" href="struct.Interval.html" title="struct tokio::time::Interval">Interval</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates new <a href="struct.Interval.html" title="struct tokio::time::Interval"><code>Interval</code></a> that yields with interval of <code>period</code>. The first
|
||||
tick completes immediately. The default <a href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior"><code>MissedTickBehavior</code></a> is
|
||||
<a href="enum.MissedTickBehavior.html#variant.Burst" title="variant tokio::time::MissedTickBehavior::Burst"><code>Burst</code></a>, but this can be configured
|
||||
by calling <a href="struct.Interval.html#method.set_missed_tick_behavior" title="method tokio::time::Interval::set_missed_tick_behavior"><code>set_missed_tick_behavior</code></a>.</p>
|
||||
<p>An interval will tick indefinitely. At any time, the <a href="struct.Interval.html" title="struct tokio::time::Interval"><code>Interval</code></a> value can
|
||||
be dropped. This cancels the interval.</p>
|
||||
<p>This function is equivalent to
|
||||
<a href="fn.interval_at.html" title="fn tokio::time::interval_at"><code>interval_at(Instant::now(), period)</code></a>.</p>
|
||||
<h2 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h2>
|
||||
<p>This function panics if <code>period</code> is zero.</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>tokio::time::{<span class="self">self</span>, Duration};
|
||||
|
||||
<span class="attr">#[tokio::main]
|
||||
</span><span class="kw">async fn </span>main() {
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>interval = time::interval(Duration::from_millis(<span class="number">10</span>));
|
||||
|
||||
interval.tick().<span class="kw">await</span>; <span class="comment">// ticks immediately
|
||||
</span>interval.tick().<span class="kw">await</span>; <span class="comment">// ticks after 10ms
|
||||
</span>interval.tick().<span class="kw">await</span>; <span class="comment">// ticks after 10ms
|
||||
|
||||
// approximately 20ms have elapsed.
|
||||
</span>}</code></pre></div>
|
||||
<p>A simple example using <code>interval</code> to execute a task every two seconds.</p>
|
||||
<p>The difference between <code>interval</code> and <a href="fn.sleep.html" title="fn tokio::time::sleep"><code>sleep</code></a> is that an <a href="struct.Interval.html" title="struct tokio::time::Interval"><code>Interval</code></a>
|
||||
measures the time since the last tick, which means that <a href="struct.Interval.html#method.tick" title="method tokio::time::Interval::tick"><code>.tick().await</code></a>
|
||||
may wait for a shorter time than the duration specified for the interval
|
||||
if some time has passed between calls to <a href="struct.Interval.html#method.tick" title="method tokio::time::Interval::tick"><code>.tick().await</code></a>.</p>
|
||||
<p>If the tick in the example below was replaced with <a href="fn.sleep.html" title="fn tokio::time::sleep"><code>sleep</code></a>, the task
|
||||
would only be executed once every three seconds, and not every two
|
||||
seconds.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::time;
|
||||
|
||||
<span class="kw">async fn </span>task_that_takes_a_second() {
|
||||
<span class="macro">println!</span>(<span class="string">"hello"</span>);
|
||||
time::sleep(time::Duration::from_secs(<span class="number">1</span>)).<span class="kw">await
|
||||
</span>}
|
||||
|
||||
<span class="attr">#[tokio::main]
|
||||
</span><span class="kw">async fn </span>main() {
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>interval = time::interval(time::Duration::from_secs(<span class="number">2</span>));
|
||||
<span class="kw">for </span>_i <span class="kw">in </span><span class="number">0</span>..<span class="number">5 </span>{
|
||||
interval.tick().<span class="kw">await</span>;
|
||||
task_that_takes_a_second().<span class="kw">await</span>;
|
||||
}
|
||||
}</code></pre></div>
|
||||
</div></details></section></div></main></body></html>
|
||||
23
tokio/time/fn.interval_at.html
Normal file
23
tokio/time/fn.interval_at.html
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<!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="Creates new `Interval` that yields with interval of `period` with the first tick completing at `start`. The default `MissedTickBehavior` is `Burst`, but this can be configured by calling `set_missed_tick_behavior`."><title>interval_at in tokio::time - 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" 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 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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">interval_<wbr>at</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>time</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</a>::<wbr><a href="index.html">time</a></span><h1>Function <span class="fn">interval_at</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/time/interval.rs.html#108-111">Source</a> </span></div><pre class="rust item-decl"><code>pub fn interval_at(start: <a class="struct" href="struct.Instant.html" title="struct tokio::time::Instant">Instant</a>, period: <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>) -> <a class="struct" href="struct.Interval.html" title="struct tokio::time::Interval">Interval</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates new <a href="struct.Interval.html" title="struct tokio::time::Interval"><code>Interval</code></a> that yields with interval of <code>period</code> with the
|
||||
first tick completing at <code>start</code>. The default <a href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior"><code>MissedTickBehavior</code></a> is
|
||||
<a href="enum.MissedTickBehavior.html#variant.Burst" title="variant tokio::time::MissedTickBehavior::Burst"><code>Burst</code></a>, but this can be configured
|
||||
by calling <a href="struct.Interval.html#method.set_missed_tick_behavior" title="method tokio::time::Interval::set_missed_tick_behavior"><code>set_missed_tick_behavior</code></a>.</p>
|
||||
<p>An interval will tick indefinitely. At any time, the <a href="struct.Interval.html" title="struct tokio::time::Interval"><code>Interval</code></a> value can
|
||||
be dropped. This cancels the interval.</p>
|
||||
<h2 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h2>
|
||||
<p>This function panics if <code>period</code> is zero.</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>tokio::time::{interval_at, Duration, Instant};
|
||||
|
||||
<span class="attr">#[tokio::main]
|
||||
</span><span class="kw">async fn </span>main() {
|
||||
<span class="kw">let </span>start = Instant::now() + Duration::from_millis(<span class="number">50</span>);
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>interval = interval_at(start, Duration::from_millis(<span class="number">10</span>));
|
||||
|
||||
interval.tick().<span class="kw">await</span>; <span class="comment">// ticks after 50ms
|
||||
</span>interval.tick().<span class="kw">await</span>; <span class="comment">// ticks after 10ms
|
||||
</span>interval.tick().<span class="kw">await</span>; <span class="comment">// ticks after 10ms
|
||||
|
||||
// approximately 70ms have elapsed.
|
||||
</span>}</code></pre></div>
|
||||
</div></details></section></div></main></body></html>
|
||||
36
tokio/time/fn.sleep.html
Normal file
36
tokio/time/fn.sleep.html
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<!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="Waits until `duration` has elapsed."><title>sleep in tokio::time - 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" 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 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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">sleep</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#cancellation" title="Cancellation">Cancellation</a></li><li><a href="#examples" title="Examples">Examples</a></li><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>time</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</a>::<wbr><a href="index.html">time</a></span><h1>Function <span class="fn">sleep</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/time/sleep.rs.html#125-132">Source</a> </span></div><pre class="rust item-decl"><code>pub fn sleep(duration: <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>) -> <a class="struct" href="struct.Sleep.html" title="struct tokio::time::Sleep">Sleep</a> <a href="#" class="tooltip" data-notable-ty="Sleep">ⓘ</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Waits until <code>duration</code> has elapsed.</p>
|
||||
<p>Equivalent to <code>sleep_until(Instant::now() + duration)</code>. An asynchronous
|
||||
analog to <code>std::thread::sleep</code>.</p>
|
||||
<p>No work is performed while awaiting on the sleep future to complete. <code>Sleep</code>
|
||||
operates at millisecond granularity and should not be used for tasks that
|
||||
require high-resolution timers. The implementation is platform specific,
|
||||
and some platforms (specifically Windows) will provide timers with a
|
||||
larger resolution than 1 ms.</p>
|
||||
<p>To run something regularly on a schedule, see <a href="fn.interval.html" title="fn tokio::time::interval"><code>interval</code></a>.</p>
|
||||
<p>The maximum duration for a sleep is 68719476734 milliseconds (approximately 2.2 years).</p>
|
||||
<h2 id="cancellation"><a class="doc-anchor" href="#cancellation">§</a>Cancellation</h2>
|
||||
<p>Canceling a sleep instance is done by dropping the returned future. No additional
|
||||
cleanup work is required.</p>
|
||||
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
|
||||
<p>Wait 100ms and print “100 ms have elapsed”.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::time::{sleep, Duration};
|
||||
|
||||
<span class="attr">#[tokio::main]
|
||||
</span><span class="kw">async fn </span>main() {
|
||||
sleep(Duration::from_millis(<span class="number">100</span>)).<span class="kw">await</span>;
|
||||
<span class="macro">println!</span>(<span class="string">"100 ms have elapsed"</span>);
|
||||
}</code></pre></div>
|
||||
<p>See the documentation for the <a href="struct.Sleep.html" title="struct tokio::time::Sleep"><code>Sleep</code></a> type for more examples.</p>
|
||||
<h2 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h2>
|
||||
<p>This function panics if there is no current timer set.</p>
|
||||
<p>It can be triggered when <a href="../runtime/struct.Builder.html#method.enable_time" title="method tokio::runtime::Builder::enable_time"><code>Builder::enable_time</code></a> or
|
||||
<a href="../runtime/struct.Builder.html#method.enable_all" title="method tokio::runtime::Builder::enable_all"><code>Builder::enable_all</code></a> are not included in the builder.</p>
|
||||
<p>It can also panic whenever a timer is created outside of a
|
||||
Tokio runtime. That is why <code>rt.block_on(sleep(...))</code> will panic,
|
||||
since the function is executed outside of the runtime.
|
||||
Whereas <code>rt.block_on(async {sleep(...).await})</code> doesn’t panic.
|
||||
And this is because wrapping the function on an async makes it lazy,
|
||||
and so gets executed inside the runtime successfully without
|
||||
panicking.</p>
|
||||
</div></details><script type="text/json" id="notable-traits-data">{"Sleep":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Sleep.html\" title=\"struct tokio::time::Sleep\">Sleep</a></code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.84.1/core/future/future/trait.Future.html\" title=\"trait core::future::future::Future\">Future</a> for <a class=\"struct\" href=\"struct.Sleep.html\" title=\"struct tokio::time::Sleep\">Sleep</a></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.84.1/core/future/future/trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = <a class=\"primitive\" href=\"https://doc.rust-lang.org/1.84.1/std/primitive.unit.html\">()</a>;</div>"}</script></section></div></main></body></html>
|
||||
31
tokio/time/fn.sleep_until.html
Normal file
31
tokio/time/fn.sleep_until.html
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<!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="Waits until `deadline` is reached."><title>sleep_until in tokio::time - 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" 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 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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">sleep_<wbr>until</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#cancellation" title="Cancellation">Cancellation</a></li><li><a href="#examples" title="Examples">Examples</a></li><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>time</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</a>::<wbr><a href="index.html">time</a></span><h1>Function <span class="fn">sleep_until</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/time/sleep.rs.html#62-64">Source</a> </span></div><pre class="rust item-decl"><code>pub fn sleep_until(deadline: <a class="struct" href="struct.Instant.html" title="struct tokio::time::Instant">Instant</a>) -> <a class="struct" href="struct.Sleep.html" title="struct tokio::time::Sleep">Sleep</a> <a href="#" class="tooltip" data-notable-ty="Sleep">ⓘ</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Waits until <code>deadline</code> is reached.</p>
|
||||
<p>No work is performed while awaiting on the sleep future to complete. <code>Sleep</code>
|
||||
operates at millisecond granularity and should not be used for tasks that
|
||||
require high-resolution timers.</p>
|
||||
<p>To run something regularly on a schedule, see <a href="fn.interval.html" title="fn tokio::time::interval"><code>interval</code></a>.</p>
|
||||
<h2 id="cancellation"><a class="doc-anchor" href="#cancellation">§</a>Cancellation</h2>
|
||||
<p>Canceling a sleep instance is done by dropping the returned future. No additional
|
||||
cleanup work is required.</p>
|
||||
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
|
||||
<p>Wait 100ms and print “100 ms have elapsed”.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::time::{sleep_until, Instant, Duration};
|
||||
|
||||
<span class="attr">#[tokio::main]
|
||||
</span><span class="kw">async fn </span>main() {
|
||||
sleep_until(Instant::now() + Duration::from_millis(<span class="number">100</span>)).<span class="kw">await</span>;
|
||||
<span class="macro">println!</span>(<span class="string">"100 ms have elapsed"</span>);
|
||||
}</code></pre></div>
|
||||
<p>See the documentation for the <a href="struct.Sleep.html" title="struct tokio::time::Sleep"><code>Sleep</code></a> type for more examples.</p>
|
||||
<h2 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h2>
|
||||
<p>This function panics if there is no current timer set.</p>
|
||||
<p>It can be triggered when <a href="../runtime/struct.Builder.html#method.enable_time" title="method tokio::runtime::Builder::enable_time"><code>Builder::enable_time</code></a> or
|
||||
<a href="../runtime/struct.Builder.html#method.enable_all" title="method tokio::runtime::Builder::enable_all"><code>Builder::enable_all</code></a> are not included in the builder.</p>
|
||||
<p>It can also panic whenever a timer is created outside of a
|
||||
Tokio runtime. That is why <code>rt.block_on(sleep(...))</code> will panic,
|
||||
since the function is executed outside of the runtime.
|
||||
Whereas <code>rt.block_on(async {sleep(...).await})</code> doesn’t panic.
|
||||
And this is because wrapping the function on an async makes it lazy,
|
||||
and so gets executed inside the runtime successfully without
|
||||
panicking.</p>
|
||||
</div></details><script type="text/json" id="notable-traits-data">{"Sleep":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Sleep.html\" title=\"struct tokio::time::Sleep\">Sleep</a></code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.84.1/core/future/future/trait.Future.html\" title=\"trait core::future::future::Future\">Future</a> for <a class=\"struct\" href=\"struct.Sleep.html\" title=\"struct tokio::time::Sleep\">Sleep</a></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.84.1/core/future/future/trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = <a class=\"primitive\" href=\"https://doc.rust-lang.org/1.84.1/std/primitive.unit.html\">()</a>;</div>"}</script></section></div></main></body></html>
|
||||
44
tokio/time/fn.timeout.html
Normal file
44
tokio/time/fn.timeout.html
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<!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="Requires a `Future` to complete before the specified duration has elapsed."><title>timeout in tokio::time - 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" 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 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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">timeout</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#cancellation" title="Cancellation">Cancellation</a></li><li><a href="#examples" title="Examples">Examples</a></li><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>time</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</a>::<wbr><a href="index.html">time</a></span><h1>Function <span class="fn">timeout</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/time/timeout.rs.html#86-98">Source</a> </span></div><pre class="rust item-decl"><code>pub fn timeout<F>(duration: <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>, future: F) -> <a class="struct" href="struct.Timeout.html" title="struct tokio::time::Timeout">Timeout</a><F::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/core/future/into_future/trait.IntoFuture.html#associatedtype.IntoFuture" title="type core::future::into_future::IntoFuture::IntoFuture">IntoFuture</a>> <a href="#" class="tooltip" data-notable-ty="Timeout<F::IntoFuture>">ⓘ</a><div class="where">where
|
||||
F: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/future/into_future/trait.IntoFuture.html" title="trait core::future::into_future::IntoFuture">IntoFuture</a>,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Requires a <code>Future</code> to complete before the specified duration has elapsed.</p>
|
||||
<p>If the future completes before the duration has elapsed, then the completed
|
||||
value is returned. Otherwise, an error is returned and the future is
|
||||
canceled.</p>
|
||||
<p>Note that the timeout is checked before polling the future, so if the future
|
||||
does not yield during execution then it is possible for the future to complete
|
||||
and exceed the timeout <em>without</em> returning an error.</p>
|
||||
<p>This function returns a future whose return type is <a href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result"><code>Result</code></a><code><T,</code><a href="error/struct.Elapsed.html" title="struct tokio::time::error::Elapsed"><code>Elapsed</code></a><code>></code>, where <code>T</code> is the
|
||||
return type of the provided future.</p>
|
||||
<p>If the provided future completes immediately, then the future returned from
|
||||
this function is guaranteed to complete immediately with an <a href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html#variant.Ok" title="variant core::result::Result::Ok"><code>Ok</code></a> variant
|
||||
no matter the provided duration.</p>
|
||||
<h2 id="cancellation"><a class="doc-anchor" href="#cancellation">§</a>Cancellation</h2>
|
||||
<p>Cancelling a timeout is done by dropping the future. No additional cleanup
|
||||
or other work is required.</p>
|
||||
<p>The original future may be obtained by calling <a href="struct.Timeout.html#method.into_inner" title="method tokio::time::Timeout::into_inner"><code>Timeout::into_inner</code></a>. This
|
||||
consumes the <code>Timeout</code>.</p>
|
||||
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
|
||||
<p>Create a new <code>Timeout</code> set to expire in 10 milliseconds.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::time::timeout;
|
||||
<span class="kw">use </span>tokio::sync::oneshot;
|
||||
|
||||
<span class="kw">use </span>std::time::Duration;
|
||||
|
||||
<span class="kw">let </span>(tx, rx) = oneshot::channel();
|
||||
|
||||
<span class="comment">// Wrap the future with a `Timeout` set to expire in 10 milliseconds.
|
||||
</span><span class="kw">if let </span><span class="prelude-val">Err</span>(<span class="kw">_</span>) = timeout(Duration::from_millis(<span class="number">10</span>), rx).<span class="kw">await </span>{
|
||||
<span class="macro">println!</span>(<span class="string">"did not receive value within 10 ms"</span>);
|
||||
}</code></pre></div>
|
||||
<h2 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h2>
|
||||
<p>This function panics if there is no current timer set.</p>
|
||||
<p>It can be triggered when <a href="../runtime/struct.Builder.html#method.enable_time" title="method tokio::runtime::Builder::enable_time"><code>Builder::enable_time</code></a> or
|
||||
<a href="../runtime/struct.Builder.html#method.enable_all" title="method tokio::runtime::Builder::enable_all"><code>Builder::enable_all</code></a> are not included in the builder.</p>
|
||||
<p>It can also panic whenever a timer is created outside of a
|
||||
Tokio runtime. That is why <code>rt.block_on(sleep(...))</code> will panic,
|
||||
since the function is executed outside of the runtime.
|
||||
Whereas <code>rt.block_on(async {sleep(...).await})</code> doesn’t panic.
|
||||
And this is because wrapping the function on an async makes it lazy,
|
||||
and so gets executed inside the runtime successfully without
|
||||
panicking.</p>
|
||||
</div></details><script type="text/json" id="notable-traits-data">{"Timeout<F::IntoFuture>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Timeout.html\" title=\"struct tokio::time::Timeout\">Timeout</a><T></code></h3><pre><code><div class=\"where\">impl<T> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.84.1/core/future/future/trait.Future.html\" title=\"trait core::future::future::Future\">Future</a> for <a class=\"struct\" href=\"struct.Timeout.html\" title=\"struct tokio::time::Timeout\">Timeout</a><T><div class=\"where\">where\n T: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.84.1/core/future/future/trait.Future.html\" title=\"trait core::future::future::Future\">Future</a>,</div></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.84.1/core/future/future/trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = <a class=\"enum\" href=\"https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html\" title=\"enum core::result::Result\">Result</a><T::<a class=\"associatedtype\" href=\"https://doc.rust-lang.org/1.84.1/core/future/future/trait.Future.html#associatedtype.Output\" title=\"type core::future::future::Future::Output\">Output</a>, <a class=\"struct\" href=\"error/struct.Elapsed.html\" title=\"struct tokio::time::error::Elapsed\">Elapsed</a>>;</div>"}</script></section></div></main></body></html>
|
||||
30
tokio/time/fn.timeout_at.html
Normal file
30
tokio/time/fn.timeout_at.html
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<!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="Requires a `Future` to complete before the specified instant in time."><title>timeout_at in tokio::time - 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" 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 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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tokio/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">timeout_<wbr>at</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#cancellation" title="Cancellation">Cancellation</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tokio::<wbr>time</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</a>::<wbr><a href="index.html">time</a></span><h1>Function <span class="fn">timeout_at</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/time/timeout.rs.html#145-155">Source</a> </span></div><pre class="rust item-decl"><code>pub fn timeout_at<F>(deadline: <a class="struct" href="struct.Instant.html" title="struct tokio::time::Instant">Instant</a>, future: F) -> <a class="struct" href="struct.Timeout.html" title="struct tokio::time::Timeout">Timeout</a><F::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/core/future/into_future/trait.IntoFuture.html#associatedtype.IntoFuture" title="type core::future::into_future::IntoFuture::IntoFuture">IntoFuture</a>> <a href="#" class="tooltip" data-notable-ty="Timeout<F::IntoFuture>">ⓘ</a><div class="where">where
|
||||
F: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/future/into_future/trait.IntoFuture.html" title="trait core::future::into_future::IntoFuture">IntoFuture</a>,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Requires a <code>Future</code> to complete before the specified instant in time.</p>
|
||||
<p>If the future completes before the instant is reached, then the completed
|
||||
value is returned. Otherwise, an error is returned.</p>
|
||||
<p>This function returns a future whose return type is <a href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result"><code>Result</code></a><code><T,</code><a href="error/struct.Elapsed.html" title="struct tokio::time::error::Elapsed"><code>Elapsed</code></a><code>></code>, where <code>T</code> is the
|
||||
return type of the provided future.</p>
|
||||
<p>If the provided future completes immediately, then the future returned from
|
||||
this function is guaranteed to complete immediately with an <a href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html#variant.Ok" title="variant core::result::Result::Ok"><code>Ok</code></a> variant
|
||||
no matter the provided deadline.</p>
|
||||
<h2 id="cancellation"><a class="doc-anchor" href="#cancellation">§</a>Cancellation</h2>
|
||||
<p>Cancelling a timeout is done by dropping the future. No additional cleanup
|
||||
or other work is required.</p>
|
||||
<p>The original future may be obtained by calling <a href="struct.Timeout.html#method.into_inner" title="method tokio::time::Timeout::into_inner"><code>Timeout::into_inner</code></a>. This
|
||||
consumes the <code>Timeout</code>.</p>
|
||||
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
|
||||
<p>Create a new <code>Timeout</code> set to expire in 10 milliseconds.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::time::{Instant, timeout_at};
|
||||
<span class="kw">use </span>tokio::sync::oneshot;
|
||||
|
||||
<span class="kw">use </span>std::time::Duration;
|
||||
|
||||
<span class="kw">let </span>(tx, rx) = oneshot::channel();
|
||||
|
||||
<span class="comment">// Wrap the future with a `Timeout` set to expire 10 milliseconds into the
|
||||
// future.
|
||||
</span><span class="kw">if let </span><span class="prelude-val">Err</span>(<span class="kw">_</span>) = timeout_at(Instant::now() + Duration::from_millis(<span class="number">10</span>), rx).<span class="kw">await </span>{
|
||||
<span class="macro">println!</span>(<span class="string">"did not receive value within 10 ms"</span>);
|
||||
}</code></pre></div>
|
||||
</div></details><script type="text/json" id="notable-traits-data">{"Timeout<F::IntoFuture>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Timeout.html\" title=\"struct tokio::time::Timeout\">Timeout</a><T></code></h3><pre><code><div class=\"where\">impl<T> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.84.1/core/future/future/trait.Future.html\" title=\"trait core::future::future::Future\">Future</a> for <a class=\"struct\" href=\"struct.Timeout.html\" title=\"struct tokio::time::Timeout\">Timeout</a><T><div class=\"where\">where\n T: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.84.1/core/future/future/trait.Future.html\" title=\"trait core::future::future::Future\">Future</a>,</div></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.84.1/core/future/future/trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = <a class=\"enum\" href=\"https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html\" title=\"enum core::result::Result\">Result</a><T::<a class=\"associatedtype\" href=\"https://doc.rust-lang.org/1.84.1/core/future/future/trait.Future.html#associatedtype.Output\" title=\"type core::future::future::Future::Output\">Output</a>, <a class=\"struct\" href=\"error/struct.Elapsed.html\" title=\"struct tokio::time::error::Elapsed\">Elapsed</a>>;</div>"}</script></section></div></main></body></html>
|
||||
78
tokio/time/index.html
Normal file
78
tokio/time/index.html
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
<!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="Utilities for tracking time."><title>tokio::time - 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" 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 mod"><!--[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/index.html">tokio</a><span class="version">1.42.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module time</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul><h3><a href="#reexports">Module Items</a></h3><ul class="block"><li><a href="#reexports" title="Re-exports">Re-exports</a></li><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate tokio</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</a></span><h1>Module <span>time</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/time/mod.rs.html#1-110">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Utilities for tracking time.</p>
|
||||
<p>This module provides a number of types for executing code after a set period
|
||||
of time.</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p><a href="fn.sleep.html" title="fn tokio::time::sleep"><code>Sleep</code></a> is a future that does no work and completes at a specific <a href="struct.Instant.html" title="struct tokio::time::Instant"><code>Instant</code></a>
|
||||
in time.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><a href="fn.interval.html" title="fn tokio::time::interval"><code>Interval</code></a> is a stream yielding a value at a fixed period. It is
|
||||
initialized with a <a href="https://doc.rust-lang.org/1.84.1/core/time/struct.Duration.html" title="struct core::time::Duration"><code>Duration</code></a> and repeatedly yields each time the duration
|
||||
elapses.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><a href="struct.Timeout.html" title="struct tokio::time::Timeout"><code>Timeout</code></a>: Wraps a future or stream, setting an upper bound to the amount
|
||||
of time it is allowed to execute. If the future or stream does not
|
||||
complete in time, then it is canceled and an error is returned.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>These types are sufficient for handling a large number of scenarios
|
||||
involving time.</p>
|
||||
<p>These types must be used from within the context of the <a href="../runtime/struct.Runtime.html" title="struct tokio::runtime::Runtime"><code>Runtime</code></a>.</p>
|
||||
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
|
||||
<p>Wait 100ms and print “100 ms have elapsed”</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::time::Duration;
|
||||
<span class="kw">use </span>tokio::time::sleep;
|
||||
|
||||
<span class="attr">#[tokio::main]
|
||||
</span><span class="kw">async fn </span>main() {
|
||||
sleep(Duration::from_millis(<span class="number">100</span>)).<span class="kw">await</span>;
|
||||
<span class="macro">println!</span>(<span class="string">"100 ms have elapsed"</span>);
|
||||
}</code></pre></div>
|
||||
<p>Require that an operation takes no more than 1s.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::time::{timeout, Duration};
|
||||
|
||||
<span class="kw">async fn </span>long_future() {
|
||||
<span class="comment">// do work here
|
||||
</span>}
|
||||
|
||||
<span class="kw">let </span>res = timeout(Duration::from_secs(<span class="number">1</span>), long_future()).<span class="kw">await</span>;
|
||||
|
||||
<span class="kw">if </span>res.is_err() {
|
||||
<span class="macro">println!</span>(<span class="string">"operation timed out"</span>);
|
||||
}</code></pre></div>
|
||||
<p>A simple example using <a href="fn.interval.html" title="fn tokio::time::interval"><code>interval</code></a> to execute a task every two seconds.</p>
|
||||
<p>The difference between <a href="fn.interval.html" title="fn tokio::time::interval"><code>interval</code></a> and <a href="fn.sleep.html" title="fn tokio::time::sleep"><code>sleep</code></a> is that an <a href="fn.interval.html" title="fn tokio::time::interval"><code>interval</code></a>
|
||||
measures the time since the last tick, which means that <code>.tick().await</code> may
|
||||
wait for a shorter time than the duration specified for the interval
|
||||
if some time has passed between calls to <code>.tick().await</code>.</p>
|
||||
<p>If the tick in the example below was replaced with <a href="fn.sleep.html" title="fn tokio::time::sleep"><code>sleep</code></a>, the task
|
||||
would only be executed once every three seconds, and not every two
|
||||
seconds.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::time;
|
||||
|
||||
<span class="kw">async fn </span>task_that_takes_a_second() {
|
||||
<span class="macro">println!</span>(<span class="string">"hello"</span>);
|
||||
time::sleep(time::Duration::from_secs(<span class="number">1</span>)).<span class="kw">await
|
||||
</span>}
|
||||
|
||||
<span class="attr">#[tokio::main]
|
||||
</span><span class="kw">async fn </span>main() {
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>interval = time::interval(time::Duration::from_secs(<span class="number">2</span>));
|
||||
<span class="kw">for </span>_i <span class="kw">in </span><span class="number">0</span>..<span class="number">5 </span>{
|
||||
interval.tick().<span class="kw">await</span>;
|
||||
task_that_takes_a_second().<span class="kw">await</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.Duration"><code>pub use std::time::<a class="struct" href="https://doc.rust-lang.org/1.84.1/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</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="error/index.html" title="mod tokio::time::error">error</a></div><div class="desc docblock-short">Time error types.</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.Instant.html" title="struct tokio::time::Instant">Instant</a></div><div class="desc docblock-short">A measurement of a monotonically nondecreasing clock.
|
||||
Opaque and useful only with <code>Duration</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.Interval.html" title="struct tokio::time::Interval">Interval</a></div><div class="desc docblock-short">Interval returned by <a href="fn.interval.html" title="fn tokio::time::interval"><code>interval</code></a> and <a href="fn.interval_at.html" title="fn tokio::time::interval_at"><code>interval_at</code></a>.</div></li><li><div class="item-name"><a class="struct" href="struct.Sleep.html" title="struct tokio::time::Sleep">Sleep</a></div><div class="desc docblock-short">Future returned by <a href="fn.sleep.html" title="fn tokio::time::sleep"><code>sleep</code></a> and <a href="fn.sleep_until.html" title="fn tokio::time::sleep_until"><code>sleep_until</code></a>.</div></li><li><div class="item-name"><a class="struct" href="struct.Timeout.html" title="struct tokio::time::Timeout">Timeout</a></div><div class="desc docblock-short">Future returned by <a href="fn.timeout.html" title="fn tokio::time::timeout"><code>timeout</code></a> and <a href="fn.timeout_at.html" title="fn tokio::time::timeout_at"><code>timeout_at</code></a>.</div></li></ul><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior">Missed<wbr>Tick<wbr>Behavior</a></div><div class="desc docblock-short">Defines the behavior of an <a href="struct.Interval.html" title="struct tokio::time::Interval"><code>Interval</code></a> when it misses a tick.</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.interval.html" title="fn tokio::time::interval">interval</a></div><div class="desc docblock-short">Creates new <a href="struct.Interval.html" title="struct tokio::time::Interval"><code>Interval</code></a> that yields with interval of <code>period</code>. The first
|
||||
tick completes immediately. The default <a href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior"><code>MissedTickBehavior</code></a> is
|
||||
<a href="enum.MissedTickBehavior.html#variant.Burst" title="variant tokio::time::MissedTickBehavior::Burst"><code>Burst</code></a>, but this can be configured
|
||||
by calling <a href="struct.Interval.html#method.set_missed_tick_behavior" title="method tokio::time::Interval::set_missed_tick_behavior"><code>set_missed_tick_behavior</code></a>.</div></li><li><div class="item-name"><a class="fn" href="fn.interval_at.html" title="fn tokio::time::interval_at">interval_<wbr>at</a></div><div class="desc docblock-short">Creates new <a href="struct.Interval.html" title="struct tokio::time::Interval"><code>Interval</code></a> that yields with interval of <code>period</code> with the
|
||||
first tick completing at <code>start</code>. The default <a href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior"><code>MissedTickBehavior</code></a> is
|
||||
<a href="enum.MissedTickBehavior.html#variant.Burst" title="variant tokio::time::MissedTickBehavior::Burst"><code>Burst</code></a>, but this can be configured
|
||||
by calling <a href="struct.Interval.html#method.set_missed_tick_behavior" title="method tokio::time::Interval::set_missed_tick_behavior"><code>set_missed_tick_behavior</code></a>.</div></li><li><div class="item-name"><a class="fn" href="fn.sleep.html" title="fn tokio::time::sleep">sleep</a></div><div class="desc docblock-short">Waits until <code>duration</code> has elapsed.</div></li><li><div class="item-name"><a class="fn" href="fn.sleep_until.html" title="fn tokio::time::sleep_until">sleep_<wbr>until</a></div><div class="desc docblock-short">Waits until <code>deadline</code> is reached.</div></li><li><div class="item-name"><a class="fn" href="fn.timeout.html" title="fn tokio::time::timeout">timeout</a></div><div class="desc docblock-short">Requires a <code>Future</code> to complete before the specified duration has elapsed.</div></li><li><div class="item-name"><a class="fn" href="fn.timeout_at.html" title="fn tokio::time::timeout_at">timeout_<wbr>at</a></div><div class="desc docblock-short">Requires a <code>Future</code> to complete before the specified instant in time.</div></li></ul></section></div></main></body></html>
|
||||
11
tokio/time/instant/struct.Instant.html
Normal file
11
tokio/time/instant/struct.Instant.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../tokio/time/struct.Instant.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../tokio/time/struct.Instant.html">../../../tokio/time/struct.Instant.html</a>...</p>
|
||||
<script>location.replace("../../../tokio/time/struct.Instant.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
tokio/time/interval/enum.MissedTickBehavior.html
Normal file
11
tokio/time/interval/enum.MissedTickBehavior.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../tokio/time/enum.MissedTickBehavior.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../tokio/time/enum.MissedTickBehavior.html">../../../tokio/time/enum.MissedTickBehavior.html</a>...</p>
|
||||
<script>location.replace("../../../tokio/time/enum.MissedTickBehavior.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
tokio/time/interval/fn.interval.html
Normal file
11
tokio/time/interval/fn.interval.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../tokio/time/fn.interval.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../tokio/time/fn.interval.html">../../../tokio/time/fn.interval.html</a>...</p>
|
||||
<script>location.replace("../../../tokio/time/fn.interval.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
tokio/time/interval/fn.interval_at.html
Normal file
11
tokio/time/interval/fn.interval_at.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../tokio/time/fn.interval_at.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../tokio/time/fn.interval_at.html">../../../tokio/time/fn.interval_at.html</a>...</p>
|
||||
<script>location.replace("../../../tokio/time/fn.interval_at.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
tokio/time/interval/struct.Interval.html
Normal file
11
tokio/time/interval/struct.Interval.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../tokio/time/struct.Interval.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../tokio/time/struct.Interval.html">../../../tokio/time/struct.Interval.html</a>...</p>
|
||||
<script>location.replace("../../../tokio/time/struct.Interval.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
1
tokio/time/sidebar-items.js
Normal file
1
tokio/time/sidebar-items.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
window.SIDEBAR_ITEMS = {"enum":["MissedTickBehavior"],"fn":["interval","interval_at","sleep","sleep_until","timeout","timeout_at"],"mod":["error"],"struct":["Instant","Interval","Sleep","Timeout"]};
|
||||
11
tokio/time/sleep/fn.sleep.html
Normal file
11
tokio/time/sleep/fn.sleep.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../tokio/time/fn.sleep.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../tokio/time/fn.sleep.html">../../../tokio/time/fn.sleep.html</a>...</p>
|
||||
<script>location.replace("../../../tokio/time/fn.sleep.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
tokio/time/sleep/fn.sleep_until.html
Normal file
11
tokio/time/sleep/fn.sleep_until.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../tokio/time/fn.sleep_until.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../tokio/time/fn.sleep_until.html">../../../tokio/time/fn.sleep_until.html</a>...</p>
|
||||
<script>location.replace("../../../tokio/time/fn.sleep_until.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
tokio/time/sleep/struct.Sleep.html
Normal file
11
tokio/time/sleep/struct.Sleep.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../tokio/time/struct.Sleep.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../tokio/time/struct.Sleep.html">../../../tokio/time/struct.Sleep.html</a>...</p>
|
||||
<script>location.replace("../../../tokio/time/struct.Sleep.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
95
tokio/time/struct.Instant.html
Normal file
95
tokio/time/struct.Instant.html
Normal file
File diff suppressed because one or more lines are too long
144
tokio/time/struct.Interval.html
Normal file
144
tokio/time/struct.Interval.html
Normal file
File diff suppressed because one or more lines are too long
107
tokio/time/struct.Sleep.html
Normal file
107
tokio/time/struct.Sleep.html
Normal file
File diff suppressed because one or more lines are too long
21
tokio/time/struct.Timeout.html
Normal file
21
tokio/time/struct.Timeout.html
Normal file
File diff suppressed because one or more lines are too long
11
tokio/time/timeout/fn.timeout.html
Normal file
11
tokio/time/timeout/fn.timeout.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../tokio/time/fn.timeout.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../tokio/time/fn.timeout.html">../../../tokio/time/fn.timeout.html</a>...</p>
|
||||
<script>location.replace("../../../tokio/time/fn.timeout.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
tokio/time/timeout/fn.timeout_at.html
Normal file
11
tokio/time/timeout/fn.timeout_at.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../tokio/time/fn.timeout_at.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../tokio/time/fn.timeout_at.html">../../../tokio/time/fn.timeout_at.html</a>...</p>
|
||||
<script>location.replace("../../../tokio/time/fn.timeout_at.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
tokio/time/timeout/struct.Timeout.html
Normal file
11
tokio/time/timeout/struct.Timeout.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../tokio/time/struct.Timeout.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../tokio/time/struct.Timeout.html">../../../tokio/time/struct.Timeout.html</a>...</p>
|
||||
<script>location.replace("../../../tokio/time/struct.Timeout.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue