46 lines
7.8 KiB
HTML
46 lines
7.8 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `tokio_timer` crate."><meta name="keywords" content="rust, rustlang, rust-lang, tokio_timer"><title>tokio_timer - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../tokio_timer/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Crate tokio_timer</p><div class="sidebar-elems"><a id='all-types' href='all.html'><p>See all tokio_timer's items</p></a><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'tokio_timer', ty: 'mod', relpath: '../'};</script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/tokio_timer/lib.rs.html#1-105' title='goto source code'>[src]</a></span><span class='in-band'>Crate <a class="mod" href=''>tokio_timer</a></span></h1><div class='docblock'><p>Utilities for tracking time.</p>
|
||
<blockquote>
|
||
<p><strong>Note:</strong> This crate is <strong>deprecated in tokio 0.2.x</strong> and has been moved
|
||
into <a href="https://docs.rs/tokio/latest/tokio/time/index.html"><code>tokio::time</code></a> behind the <code>time</code> <a href="https://docs.rs/tokio/latest/tokio/index.html#feature-flags">feature flag</a>.</p>
|
||
</blockquote>
|
||
<p>This crate provides a number of utilities for working with periods of time:</p>
|
||
<ul>
|
||
<li>
|
||
<p><a href="struct.Delay.html"><code>Delay</code></a>: A future that completes at a specified instant in time.</p>
|
||
</li>
|
||
<li>
|
||
<p><a href="struct.Interval.html"><code>Interval</code></a> A stream that yields at fixed time intervals.</p>
|
||
</li>
|
||
<li>
|
||
<p><a href="throttle/struct.Throttle.html"><code>Throttle</code></a>: Throttle down a stream by enforcing a fixed delay between items.</p>
|
||
</li>
|
||
<li>
|
||
<p><a href="struct.Timeout.html"><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>
|
||
<li>
|
||
<p><a href="struct.DelayQueue.html"><code>DelayQueue</code></a>: A queue where items are returned once the requested delay
|
||
has expired.</p>
|
||
</li>
|
||
</ul>
|
||
<p>These three types are backed by a <a href="timer/struct.Timer.html"><code>Timer</code></a> instance. In order for
|
||
<a href="struct.Delay.html"><code>Delay</code></a>, <a href="struct.Interval.html"><code>Interval</code></a>, and <a href="struct.Timeout.html"><code>Timeout</code></a> to function, the associated
|
||
<a href="timer/struct.Timer.html"><code>Timer</code></a> instance must be running on some thread.</p>
|
||
</div><h2 id='reexports' class='section-header'><a href="#reexports">Re-exports</a></h2>
|
||
<table><tr><td><code>pub use self::timer::<a class="struct" href="../tokio_timer/timer/struct.Timer.html" title="struct tokio_timer::timer::Timer">Timer</a>;</code></td></tr></table><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
|
||
<table><tr class='module-item'><td><a class="mod" href="clock/index.html" title='tokio_timer::clock mod'>clock</a></td><td class='docblock-short'><p>A configurable source of time.</p>
|
||
</td></tr><tr class='module-item'><td><a class="mod" href="delay_queue/index.html" title='tokio_timer::delay_queue mod'>delay_queue</a></td><td class='docblock-short'><p>A queue of delayed elements.</p>
|
||
</td></tr><tr class='module-item'><td><a class="mod" href="throttle/index.html" title='tokio_timer::throttle mod'>throttle</a></td><td class='docblock-short'><p>Slow down a stream by enforcing a delay between items.</p>
|
||
</td></tr><tr class='module-item'><td><a class="mod" href="timeout/index.html" title='tokio_timer::timeout mod'>timeout</a></td><td class='docblock-short'><p>Allows a future or stream to execute for a maximum amount of time.</p>
|
||
</td></tr><tr class='module-item'><td><a class="mod" href="timer/index.html" title='tokio_timer::timer mod'>timer</a></td><td class='docblock-short'><p>Timer implementation.</p>
|
||
</td></tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||
<table><tr class='module-item'><td><a class="struct" href="struct.Delay.html" title='tokio_timer::Delay struct'>Delay</a></td><td class='docblock-short'><p>A future that completes at a specified instant in time.</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.DelayQueue.html" title='tokio_timer::DelayQueue struct'>DelayQueue</a></td><td class='docblock-short'><p>A queue of delayed elements.</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Error.html" title='tokio_timer::Error struct'>Error</a></td><td class='docblock-short'><p>Errors encountered by the timer implementation.</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Interval.html" title='tokio_timer::Interval struct'>Interval</a></td><td class='docblock-short'><p>A stream representing notifications at fixed interval</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Timeout.html" title='tokio_timer::Timeout struct'>Timeout</a></td><td class='docblock-short'><p>Allows a <code>Future</code> or <code>Stream</code> to execute for a limited amount of time.</p>
|
||
</td></tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
|
||
<table><tr class='module-item'><td><a class="fn" href="fn.sleep.html" title='tokio_timer::sleep fn'>sleep</a></td><td class='docblock-short'><p>Create a Future that completes in <code>duration</code> from now.</p>
|
||
</td></tr><tr class='module-item'><td><a class="fn" href="fn.with_default.html" title='tokio_timer::with_default fn'>with_default</a></td><td class='docblock-short'><p>Set the default timer for the duration of the closure.</p>
|
||
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "tokio_timer";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html> |