blob: 1d00fb6e15208cfbb113beb59e37f28c3bc4d8f4 [file] [log] [blame]
<!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="Defines the behavior of an [`Interval`] when it misses a tick."><meta name="keywords" content="rust, rustlang, rust-lang, MissedTickBehavior"><title>MissedTickBehavior in tokio::time - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc enum"><!--[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">&#9776;</button><a class="sidebar-logo" href="../../tokio/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../tokio/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">MissedTickBehavior</a></h2><div class="sidebar-elems"><section><h3><a href="#variants">Variants</a></h3><ul class="block"><li><a href="#variant.Burst">Burst</a></li><li><a href="#variant.Delay">Delay</a></li><li><a href="#variant.Skip">Skip</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block"><li><a href="#impl-Clone-for-MissedTickBehavior">Clone</a></li><li><a href="#impl-Copy-for-MissedTickBehavior">Copy</a></li><li><a href="#impl-Debug-for-MissedTickBehavior">Debug</a></li><li><a href="#impl-Default-for-MissedTickBehavior">Default</a></li><li><a href="#impl-Eq-for-MissedTickBehavior">Eq</a></li><li><a href="#impl-PartialEq%3CMissedTickBehavior%3E-for-MissedTickBehavior">PartialEq&lt;MissedTickBehavior&gt;</a></li><li><a href="#impl-StructuralEq-for-MissedTickBehavior">StructuralEq</a></li><li><a href="#impl-StructuralPartialEq-for-MissedTickBehavior">StructuralPartialEq</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block"><li><a href="#impl-RefUnwindSafe-for-MissedTickBehavior">RefUnwindSafe</a></li><li><a href="#impl-Send-for-MissedTickBehavior">Send</a></li><li><a href="#impl-Sync-for-MissedTickBehavior">Sync</a></li><li><a href="#impl-Unpin-for-MissedTickBehavior">Unpin</a></li><li><a href="#impl-UnwindSafe-for-MissedTickBehavior">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block"><li><a href="#impl-Any-for-MissedTickBehavior">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-MissedTickBehavior">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-MissedTickBehavior">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-From%3CT%3E-for-MissedTickBehavior">From&lt;T&gt;</a></li><li><a href="#impl-Into%3CU%3E-for-MissedTickBehavior">Into&lt;U&gt;</a></li><li><a href="#impl-ToOwned-for-MissedTickBehavior">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E-for-MissedTickBehavior">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E-for-MissedTickBehavior">TryInto&lt;U&gt;</a></li></ul></section><h2><a href="index.html">In tokio::time</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Enum <a href="../index.html">tokio</a>::<wbr><a href="index.html">time</a>::<wbr><a class="enum" href="#">MissedTickBehavior</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../../src/tokio/time/interval.rs.html#182-337">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="item-decl"><pre class="rust enum"><code>pub enum MissedTickBehavior {
Burst,
Delay,
Skip,
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Defines the behavior of an <a href="struct.Interval.html" title="Interval"><code>Interval</code></a> when it misses a tick.</p>
<p>Sometimes, an <a href="struct.Interval.html" title="Interval"><code>Interval</code></a>’s tick is missed. For example, consider the
following:</p>
<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="attribute">#[tokio::main]
</span><span class="kw">async fn </span>main() {
<span class="comment">// ticks every 2 milliseconds
</span><span class="kw">let </span><span class="kw-2">mut </span>interval = time::interval(Duration::from_millis(<span class="number">2</span>));
<span class="kw">for _ in </span><span class="number">0</span>..<span class="number">5 </span>{
interval.tick().<span class="kw">await</span>;
<span class="comment">// if this takes more than 2 milliseconds, a tick will be delayed
</span>task_that_takes_one_to_three_millis().<span class="kw">await</span>;
}
}</code></pre></div>
<p>Generally, a tick is missed if too much time is spent without calling
<a href="struct.Interval.html#method.tick" title="Interval::tick()"><code>Interval::tick()</code></a>.</p>
<p>By default, when a tick is missed, <a href="struct.Interval.html" title="Interval"><code>Interval</code></a> fires ticks as quickly as it
can until it is “caught up” in time to where it should be.
<code>MissedTickBehavior</code> can be used to specify a different behavior for
<a href="struct.Interval.html" title="Interval"><code>Interval</code></a> to exhibit. Each variant represents a different strategy.</p>
<p>Note that because the executor cannot guarantee exact precision with timers,
these strategies will only apply when the delay is greater than 5
milliseconds.</p>
</div></details><h2 id="variants" class="variants small-section-header">Variants<a href="#variants" class="anchor"></a></h2><h3 id="variant.Burst" class="variant small-section-header"><a href="#variant.Burst" class="anchor field"></a><code>Burst</code></h3><div class="docblock"><p>Ticks as fast as possible until caught up.</p>
<p>When this strategy is used, <a href="struct.Interval.html" title="Interval"><code>Interval</code></a> schedules ticks “normally” (the
same as it would have if the ticks hadn’t been delayed), which results
in it firing ticks as fast as possible until it is caught up in time to
where it should be. Unlike <a href="enum.MissedTickBehavior.html#variant.Delay"><code>Delay</code></a> and <a href="enum.MissedTickBehavior.html#variant.Skip"><code>Skip</code></a>, the ticks yielded
when <code>Burst</code> is used (the <a href="struct.Instant.html" title="Instant"><code>Instant</code></a>s that <a href="struct.Interval.html#method.tick"><code>tick</code></a>
yields) aren’t different than they would have been if a tick had not
been missed. Like <a href="enum.MissedTickBehavior.html#variant.Skip"><code>Skip</code></a>, and unlike <a href="enum.MissedTickBehavior.html#variant.Delay"><code>Delay</code></a>, the ticks may be
shortened.</p>
<p>This looks something like this:</p>
<div class="example-wrap"><pre class="language-text"><code>Expected ticks: | 1 | 2 | 3 | 4 | 5 | 6 |
Actual ticks: | work -----| delay | work | work | work -| work -----|</code></pre></div>
<p>In code:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::time::{interval, Duration};
<span class="kw">let </span><span class="kw-2">mut </span>interval = interval(Duration::from_millis(<span class="number">50</span>));
<span class="comment">// First tick resolves immediately after creation
</span>interval.tick().<span class="kw">await</span>;
task_that_takes_200_millis().<span class="kw">await</span>;
<span class="comment">// The `Interval` has missed a tick
// Since we have exceeded our timeout, this will resolve immediately
</span>interval.tick().<span class="kw">await</span>;
<span class="comment">// Since we are more than 100ms after the start of `interval`, this will
// also resolve immediately.
</span>interval.tick().<span class="kw">await</span>;
<span class="comment">// Also resolves immediately, because it was supposed to resolve at
// 150ms after the start of `interval`
</span>interval.tick().<span class="kw">await</span>;
<span class="comment">// Resolves immediately
</span>interval.tick().<span class="kw">await</span>;
<span class="comment">// Since we have gotten to 200ms after the start of `interval`, this
// will resolve after 50ms
</span>interval.tick().<span class="kw">await</span>;</code></pre></div>
<p>This is the default behavior when <a href="struct.Interval.html" title="Interval"><code>Interval</code></a> is created with
<a href="fn.interval.html" title="interval"><code>interval</code></a> and <a href="fn.interval_at.html" title="interval_at"><code>interval_at</code></a>.</p>
</div><h3 id="variant.Delay" class="variant small-section-header"><a href="#variant.Delay" class="anchor field"></a><code>Delay</code></h3><div class="docblock"><p>Tick at multiples of <code>period</code> from when <a href="struct.Interval.html#method.tick"><code>tick</code></a> was called, rather than
from <code>start</code>.</p>
<p>When this strategy is used and <a href="struct.Interval.html" title="Interval"><code>Interval</code></a> has missed a tick, instead
of scheduling ticks to fire at multiples of <code>period</code> from <code>start</code> (the
time when the first tick was fired), it schedules all future ticks to
happen at a regular <code>period</code> from the point when <a href="struct.Interval.html#method.tick"><code>tick</code></a> was called.
Unlike <a href="enum.MissedTickBehavior.html#variant.Burst"><code>Burst</code></a> and <a href="enum.MissedTickBehavior.html#variant.Skip"><code>Skip</code></a>, ticks are not shortened, and they aren’t
guaranteed to happen at a multiple of <code>period</code> from <code>start</code> any longer.</p>
<p>This looks something like this:</p>
<div class="example-wrap"><pre class="language-text"><code>Expected ticks: | 1 | 2 | 3 | 4 | 5 | 6 |
Actual ticks: | work -----| delay | work -----| work -----| work -----|</code></pre></div>
<p>In code:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::time::{interval, Duration, MissedTickBehavior};
<span class="kw">let </span><span class="kw-2">mut </span>interval = interval(Duration::from_millis(<span class="number">50</span>));
interval.set_missed_tick_behavior(MissedTickBehavior::Delay);
task_that_takes_more_than_50_millis().<span class="kw">await</span>;
<span class="comment">// The `Interval` has missed a tick
// Since we have exceeded our timeout, this will resolve immediately
</span>interval.tick().<span class="kw">await</span>;
<span class="comment">// But this one, rather than also resolving immediately, as might happen
// with the `Burst` or `Skip` behaviors, will not resolve until
// 50ms after the call to `tick` up above. That is, in `tick`, when we
// recognize that we missed a tick, we schedule the next tick to happen
// 50ms (or whatever the `period` is) from right then, not from when
// were *supposed* to tick
</span>interval.tick().<span class="kw">await</span>;</code></pre></div>
</div><h3 id="variant.Skip" class="variant small-section-header"><a href="#variant.Skip" class="anchor field"></a><code>Skip</code></h3><div class="docblock"><p>Skips missed ticks and tick on the next multiple of <code>period</code> from
<code>start</code>.</p>
<p>When this strategy is used, <a href="struct.Interval.html" title="Interval"><code>Interval</code></a> schedules the next tick to fire
at the next-closest tick that is a multiple of <code>period</code> away from
<code>start</code> (the point where <a href="struct.Interval.html" title="Interval"><code>Interval</code></a> first ticked). Like <a href="enum.MissedTickBehavior.html#variant.Burst"><code>Burst</code></a>, all
ticks remain multiples of <code>period</code> away from <code>start</code>, but unlike
<a href="enum.MissedTickBehavior.html#variant.Burst"><code>Burst</code></a>, the ticks may not be <em>one</em> multiple of <code>period</code> away from the
last tick. Like <a href="enum.MissedTickBehavior.html#variant.Delay"><code>Delay</code></a>, the ticks are no longer the same as they
would have been if ticks had not been missed, but unlike <a href="enum.MissedTickBehavior.html#variant.Delay"><code>Delay</code></a>, and
like <a href="enum.MissedTickBehavior.html#variant.Burst"><code>Burst</code></a>, the ticks may be shortened to be less than one <code>period</code>
away from each other.</p>
<p>This looks something like this:</p>
<div class="example-wrap"><pre class="language-text"><code>Expected ticks: | 1 | 2 | 3 | 4 | 5 | 6 |
Actual ticks: | work -----| delay | work ---| work -----| work -----|</code></pre></div>
<p>In code:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tokio::time::{interval, Duration, MissedTickBehavior};
<span class="kw">let </span><span class="kw-2">mut </span>interval = interval(Duration::from_millis(<span class="number">50</span>));
interval.set_missed_tick_behavior(MissedTickBehavior::Skip);
task_that_takes_75_millis().<span class="kw">await</span>;
<span class="comment">// The `Interval` has missed a tick
// Since we have exceeded our timeout, this will resolve immediately
</span>interval.tick().<span class="kw">await</span>;
<span class="comment">// This one will resolve after 25ms, 100ms after the start of
// `interval`, which is the closest multiple of `period` from the start
// of `interval` after the call to `tick` up above.
</span>interval.tick().<span class="kw">await</span>;</code></pre></div>
</div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Clone-for-MissedTickBehavior" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/time/interval.rs.html#181">source</a><a href="#impl-Clone-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl Clone for <a class="enum" href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior">MissedTickBehavior</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/time/interval.rs.html#181">source</a><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a class="fnname">clone</a>(&amp;self) -&gt; <a class="enum" href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior">MissedTickBehavior</a></h4></section></summary><div class='docblock'>Returns a copy of the value. <a>Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl has-srclink"><span class="since rightside" title="Stable since Rust version 1.0.0">1.0.0</span><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">const fn <a class="fnname">clone_from</a>(&amp;mut self, source: &amp;Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Debug-for-MissedTickBehavior" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/time/interval.rs.html#181">source</a><a href="#impl-Debug-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl Debug for <a class="enum" href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior">MissedTickBehavior</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/time/interval.rs.html#181">source</a><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a class="fnname">fmt</a>(&amp;self, f: &amp;mut Formatter&lt;'_&gt;) -&gt; Result</h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Default-for-MissedTickBehavior" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/time/interval.rs.html#366-379">source</a><a href="#impl-Default-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl Default for <a class="enum" href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior">MissedTickBehavior</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.default" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/time/interval.rs.html#376-378">source</a><a href="#method.default" class="anchor"></a><h4 class="code-header">fn <a class="fnname">default</a>() -&gt; Self</h4></section></summary><div class="docblock"><p>Returns <a href="enum.MissedTickBehavior.html#variant.Burst" title="MissedTickBehavior::Burst"><code>MissedTickBehavior::Burst</code></a>.</p>
<p>For most usecases, the <a href="enum.MissedTickBehavior.html#variant.Burst"><code>Burst</code></a> strategy is what is desired.
Additionally, to preserve backwards compatibility, the <a href="enum.MissedTickBehavior.html#variant.Burst"><code>Burst</code></a>
strategy must be the default. For these reasons,
<a href="enum.MissedTickBehavior.html#variant.Burst" title="MissedTickBehavior::Burst"><code>MissedTickBehavior::Burst</code></a> is the default for <a href="enum.MissedTickBehavior.html" title="MissedTickBehavior"><code>MissedTickBehavior</code></a>.
See <a href="enum.MissedTickBehavior.html#variant.Burst"><code>Burst</code></a> for more details.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CMissedTickBehavior%3E-for-MissedTickBehavior" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/time/interval.rs.html#181">source</a><a href="#impl-PartialEq%3CMissedTickBehavior%3E-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl PartialEq&lt;<a class="enum" href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior">MissedTickBehavior</a>&gt; for <a class="enum" href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior">MissedTickBehavior</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/tokio/time/interval.rs.html#181">source</a><a href="#method.eq" class="anchor"></a><h4 class="code-header">fn <a class="fnname">eq</a>(&amp;self, other: &amp;<a class="enum" href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior">MissedTickBehavior</a>) -&gt; bool</h4></section></summary><div class='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>. <a>Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.ne" class="method trait-impl has-srclink"><span class="since rightside" title="Stable since Rust version 1.0.0">1.0.0</span><a href="#method.ne" class="anchor"></a><h4 class="code-header">const fn <a class="fnname">ne</a>(&amp;self, other: &amp;Rhs) -&gt; bool</h4></section></summary><div class='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason. <a>Read more</a></div></details></div></details><section id="impl-Copy-for-MissedTickBehavior" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/time/interval.rs.html#181">source</a><a href="#impl-Copy-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl Copy for <a class="enum" href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior">MissedTickBehavior</a></h3></section><section id="impl-Eq-for-MissedTickBehavior" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/time/interval.rs.html#181">source</a><a href="#impl-Eq-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl Eq for <a class="enum" href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior">MissedTickBehavior</a></h3></section><section id="impl-StructuralEq-for-MissedTickBehavior" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/time/interval.rs.html#181">source</a><a href="#impl-StructuralEq-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl StructuralEq for <a class="enum" href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior">MissedTickBehavior</a></h3></section><section id="impl-StructuralPartialEq-for-MissedTickBehavior" class="impl has-srclink"><a class="srclink rightside" href="../../src/tokio/time/interval.rs.html#181">source</a><a href="#impl-StructuralPartialEq-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl StructuralPartialEq for <a class="enum" href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior">MissedTickBehavior</a></h3></section></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><section id="impl-RefUnwindSafe-for-MissedTickBehavior" class="impl has-srclink"><a href="#impl-RefUnwindSafe-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl RefUnwindSafe for <a class="enum" href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior">MissedTickBehavior</a></h3></section><section id="impl-Send-for-MissedTickBehavior" class="impl has-srclink"><a href="#impl-Send-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl Send for <a class="enum" href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior">MissedTickBehavior</a></h3></section><section id="impl-Sync-for-MissedTickBehavior" class="impl has-srclink"><a href="#impl-Sync-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl Sync for <a class="enum" href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior">MissedTickBehavior</a></h3></section><section id="impl-Unpin-for-MissedTickBehavior" class="impl has-srclink"><a href="#impl-Unpin-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl Unpin for <a class="enum" href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior">MissedTickBehavior</a></h3></section><section id="impl-UnwindSafe-for-MissedTickBehavior" class="impl has-srclink"><a href="#impl-UnwindSafe-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl UnwindSafe for <a class="enum" href="enum.MissedTickBehavior.html" title="enum tokio::time::MissedTickBehavior">MissedTickBehavior</a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any-for-MissedTickBehavior" class="impl has-srclink"><a href="#impl-Any-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; Any for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><a href="#method.type_id" class="anchor"></a><h4 class="code-header">fn <a class="fnname">type_id</a>(&amp;self) -&gt; TypeId</h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-MissedTickBehavior" class="impl has-srclink"><a href="#impl-Borrow%3CT%3E-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; Borrow&lt;T&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span><a href="#method.borrow" class="anchor"></a><h4 class="code-header">fn <a class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-MissedTickBehavior" class="impl has-srclink"><a href="#impl-BorrowMut%3CT%3E-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; BorrowMut&lt;T&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">fn <a class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-MissedTickBehavior" class="impl has-srclink"><a href="#impl-From%3CT%3E-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; From&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.from" class="anchor"></a><h4 class="code-header">fn <a class="fnname">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-MissedTickBehavior" class="impl has-srclink"><a href="#impl-Into%3CU%3E-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; Into&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: From&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.into" class="anchor"></a><h4 class="code-header">fn <a class="fnname">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code>[From]&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-ToOwned-for-MissedTickBehavior" class="impl has-srclink"><a href="#impl-ToOwned-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; ToOwned for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Clone,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Owned" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl has-srclink"><a href="#method.to_owned" class="anchor"></a><h4 class="code-header">fn <a class="fnname">to_owned</a>(&amp;self) -&gt; T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a>Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl has-srclink"><a href="#method.clone_into" class="anchor"></a><h4 class="code-header">fn <a class="fnname">clone_into</a>(&amp;self, target: &amp;mut T)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-MissedTickBehavior" class="impl has-srclink"><a href="#impl-TryFrom%3CU%3E-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; TryFrom&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: Into&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Error</a> = Infallible</h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.try_from" class="anchor"></a><h4 class="code-header">fn <a class="fnname">try_from</a>(value: U) -&gt; Result&lt;T, &lt;T as TryFrom&lt;U&gt;&gt;::Error&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-MissedTickBehavior" class="impl has-srclink"><a href="#impl-TryInto%3CU%3E-for-MissedTickBehavior" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; TryInto&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: TryFrom&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Error</a> = &lt;U as TryFrom&lt;T&gt;&gt;::Error</h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.try_into" class="anchor"></a><h4 class="code-header">fn <a class="fnname">try_into</a>(self) -&gt; Result&lt;U, &lt;U as TryFrom&lt;T&gt;&gt;::Error&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="tokio" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>