mentat/tokio/executor/current_thread/struct.CurrentThread.html
2018-08-22 17:04:13 +00:00

187 lines
No EOL
31 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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 `CurrentThread` struct in crate `tokio`.">
<meta name="keywords" content="rust, rustlang, rust-lang, CurrentThread">
<title>tokio::executor::current_thread::CurrentThread - 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="../../../main.css" id="themeStyle">
<script src="../../../storage.js"></script>
</head>
<body class="rustdoc struct">
<!--[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">&#9776;</div>
<p class='location'>Struct CurrentThread</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.new">new</a><a href="#method.new_with_park">new_with_park</a><a href="#method.is_idle">is_idle</a><a href="#method.spawn">spawn</a><a href="#method.block_on">block_on</a><a href="#method.run">run</a><a href="#method.run_timeout">run_timeout</a><a href="#method.turn">turn</a><a href="#method.enter">enter</a><a href="#method.get_park">get_park</a><a href="#method.get_park_mut">get_park_mut</a><a href="#method.handle">handle</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Executor">Executor</a><a href="#impl-Debug">Debug</a></div></div><p class='location'><a href='../../index.html'>tokio</a>::<wbr><a href='../index.html'>executor</a>::<wbr><a href='index.html'>current_thread</a></p><script>window.sidebarCurrent = {name: 'CurrentThread', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></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 js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Struct <a href='../../index.html'>tokio</a>::<wbr><a href='../index.html'>executor</a>::<wbr><a href='index.html'>current_thread</a>::<wbr><a class="struct" href=''>CurrentThread</a></span><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'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../../../src/tokio/executor/current_thread/mod.rs.html#127-142' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct CurrentThread&lt;P:&nbsp;<a class="trait" href="../../../tokio_executor/park/trait.Park.html" title="trait tokio_executor::park::Park">Park</a>&nbsp;=&nbsp;<a class="struct" href="../../../tokio_executor/park/struct.ParkThread.html" title="struct tokio_executor::park::ParkThread">ParkThread</a>&gt; { /* fields omitted */ }</pre><div class='docblock'><p>Executes tasks on the current thread</p>
</div>
<h2 id='methods' class='small-section-header'>
Methods<a href='#methods' class='anchor'></a>
</h2>
<h3 id='impl' class='impl'><span class='in-band'><code>impl <a class="struct" href="../../../tokio/executor/current_thread/struct.CurrentThread.html" title="struct tokio::executor::current_thread::CurrentThread">CurrentThread</a>&lt;<a class="struct" href="../../../tokio_executor/park/struct.ParkThread.html" title="struct tokio_executor::park::ParkThread">ParkThread</a>&gt;</code><a href='#impl' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/tokio/executor/current_thread/mod.rs.html#301-306' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.new' class="method"><span id='new.v' class='invisible'><code>pub fn <a href='#method.new' class='fnname'>new</a>() -&gt; Self</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/tokio/executor/current_thread/mod.rs.html#303-305' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Create a new instance of <code>CurrentThread</code>.</p>
</div></div><h3 id='impl-1' class='impl'><span class='in-band'><code>impl&lt;P:&nbsp;<a class="trait" href="../../../tokio_executor/park/trait.Park.html" title="trait tokio_executor::park::Park">Park</a>&gt; <a class="struct" href="../../../tokio/executor/current_thread/struct.CurrentThread.html" title="struct tokio::executor::current_thread::CurrentThread">CurrentThread</a>&lt;P&gt;</code><a href='#impl-1' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/tokio/executor/current_thread/mod.rs.html#308-424' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.new_with_park' class="method"><span id='new_with_park.v' class='invisible'><code>pub fn <a href='#method.new_with_park' class='fnname'>new_with_park</a>(park: P) -&gt; Self</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/tokio/executor/current_thread/mod.rs.html#311-326' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Create a new instance of <code>CurrentThread</code> backed by the given park
handle.</p>
</div><h4 id='method.is_idle' class="method"><span id='is_idle.v' class='invisible'><code>pub fn <a href='#method.is_idle' class='fnname'>is_idle</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/tokio/executor/current_thread/mod.rs.html#331-333' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Returns <code>true</code> if the executor is currently idle.</p>
<p>An idle executor is defined by not currently having any spawned tasks.</p>
</div><h4 id='method.spawn' class="method"><div class="important-traits"><div class='tooltip'><span class='tooltiptext'>Important traits for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a mut </a>R</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a mut </a>R</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, R&gt; <a class="trait" href="../../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a mut </a>R <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">impl&lt;'a, W&gt; <a class="trait" href="../../../tokio/prelude/trait.Write.html" title="trait tokio::prelude::Write">Write</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a mut </a>W <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;W: <a class="trait" href="../../../tokio/prelude/trait.Write.html" title="trait tokio::prelude::Write">Write</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">impl&lt;'a, I&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a mut </a>I <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline"> type <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &lt;I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::iterator::Iterator::Item">Item</a>;</span></code></div></div><span id='spawn.v' class='invisible'><code>pub fn <a href='#method.spawn' class='fnname'>spawn</a>&lt;F&gt;(&amp;mut self, future: F) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="../../../tokio/prelude/future/trait.Future.html" title="trait tokio::prelude::future::Future">Future</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Error = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt; + 'static,&nbsp;</span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/tokio/executor/current_thread/mod.rs.html#338-343' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Spawn the future on the executor.</p>
<p>This internally queues the future to be executed once <code>run</code> is called.</p>
</div><h4 id='method.block_on' class="method"><span id='block_on.v' class='invisible'><code>pub fn <a href='#method.block_on' class='fnname'>block_on</a>&lt;F&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;future: F<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;F::<a class="type" href="../../../tokio/prelude/future/trait.Future.html#associatedtype.Item" title="type tokio::prelude::future::Future::Item">Item</a>, <a class="struct" href="../../../tokio/executor/current_thread/struct.BlockError.html" title="struct tokio::executor::current_thread::BlockError">BlockError</a>&lt;F::<a class="type" href="../../../tokio/prelude/future/trait.Future.html#associatedtype.Error" title="type tokio::prelude::future::Future::Error">Error</a>&gt;&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="../../../tokio/prelude/future/trait.Future.html" title="trait tokio::prelude::future::Future">Future</a>,&nbsp;</span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/tokio/executor/current_thread/mod.rs.html#358-364' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Synchronously waits for the provided <code>future</code> to complete.</p>
<p>This function can be used to synchronously block the current thread
until the provided <code>future</code> has resolved either successfully or with an
error. The result of the future is then returned from this function
call.</p>
<p>Note that this function will <strong>also</strong> execute any spawned futures on the
current thread, but will <strong>not</strong> block until these other spawned futures
have completed.</p>
<p>The caller is responsible for ensuring that other spawned futures
complete execution.</p>
</div><h4 id='method.run' class="method"><span id='run.v' class='invisible'><code>pub fn <a href='#method.run' class='fnname'>run</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="../../../tokio/executor/current_thread/struct.RunError.html" title="struct tokio::executor::current_thread::RunError">RunError</a>&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/tokio/executor/current_thread/mod.rs.html#368-371' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Run the executor to completion, blocking the thread until <strong>all</strong>
spawned futures have completed.</p>
</div><h4 id='method.run_timeout' class="method"><span id='run_timeout.v' class='invisible'><code>pub fn <a href='#method.run_timeout' class='fnname'>run_timeout</a>(&amp;mut self, duration: <a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="../../../tokio/executor/current_thread/struct.RunTimeoutError.html" title="struct tokio::executor::current_thread::RunTimeoutError">RunTimeoutError</a>&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/tokio/executor/current_thread/mod.rs.html#375-380' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Run the executor to completion, blocking the thread until all
spawned futures have completed <strong>or</strong> <code>duration</code> time has elapsed.</p>
</div><h4 id='method.turn' class="method"><span id='turn.v' class='invisible'><code>pub fn <a href='#method.turn' class='fnname'>turn</a>(&amp;mut self, duration: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../../../tokio/executor/current_thread/struct.Turn.html" title="struct tokio::executor::current_thread::Turn">Turn</a>, <a class="struct" href="../../../tokio/executor/current_thread/struct.TurnError.html" title="struct tokio::executor::current_thread::TurnError">TurnError</a>&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/tokio/executor/current_thread/mod.rs.html#385-390' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Perform a single iteration of the event loop.</p>
<p>This function blocks the current thread even if the executor is idle.</p>
</div><h4 id='method.enter' class="method"><span id='enter.v' class='invisible'><code>pub fn <a href='#method.enter' class='fnname'>enter</a>&lt;'a&gt;(&amp;'a mut self, enter: &amp;'a mut <a class="struct" href="../../../tokio_executor/enter/struct.Enter.html" title="struct tokio_executor::enter::Enter">Enter</a>) -&gt; <a class="struct" href="../../../tokio/executor/current_thread/struct.Entered.html" title="struct tokio::executor::current_thread::Entered">Entered</a>&lt;'a, P&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/tokio/executor/current_thread/mod.rs.html#393-398' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Bind <code>CurrentThread</code> instance with an execution context.</p>
</div><h4 id='method.get_park' class="method"><div class="important-traits"><div class='tooltip'><span class='tooltiptext'>Important traits for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a mut </a>R</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a mut </a>R</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, R&gt; <a class="trait" href="../../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a mut </a>R <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">impl&lt;'a, W&gt; <a class="trait" href="../../../tokio/prelude/trait.Write.html" title="trait tokio::prelude::Write">Write</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a mut </a>W <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;W: <a class="trait" href="../../../tokio/prelude/trait.Write.html" title="trait tokio::prelude::Write">Write</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">impl&lt;'a, I&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a mut </a>I <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline"> type <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &lt;I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::iterator::Iterator::Item">Item</a>;</span></code></div></div><span id='get_park.v' class='invisible'><code>pub fn <a href='#method.get_park' class='fnname'>get_park</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>P</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/tokio/executor/current_thread/mod.rs.html#401-403' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Returns a reference to the underlying <code>Park</code> instance.</p>
</div><h4 id='method.get_park_mut' class="method"><div class="important-traits"><div class='tooltip'><span class='tooltiptext'>Important traits for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a mut </a>R</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a mut </a>R</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, R&gt; <a class="trait" href="../../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a mut </a>R <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../../tokio/prelude/trait.Read.html" title="trait tokio::prelude::Read">Read</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">impl&lt;'a, W&gt; <a class="trait" href="../../../tokio/prelude/trait.Write.html" title="trait tokio::prelude::Write">Write</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a mut </a>W <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;W: <a class="trait" href="../../../tokio/prelude/trait.Write.html" title="trait tokio::prelude::Write">Write</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">impl&lt;'a, I&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a mut </a>I <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline"> type <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &lt;I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::iterator::Iterator::Item">Item</a>;</span></code></div></div><span id='get_park_mut.v' class='invisible'><code>pub fn <a href='#method.get_park_mut' class='fnname'>get_park_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>P</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/tokio/executor/current_thread/mod.rs.html#406-408' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Returns a mutable reference to the underlying <code>Park</code> instance.</p>
</div><h4 id='method.handle' class="method"><span id='handle.v' class='invisible'><code>pub fn <a href='#method.handle' class='fnname'>handle</a>(&amp;self) -&gt; <a class="struct" href="../../../tokio/executor/current_thread/struct.Handle.html" title="struct tokio::executor::current_thread::Handle">Handle</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/tokio/executor/current_thread/mod.rs.html#421-423' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Get a new handle to spawn futures on the executor</p>
<p>Different to the executor itself, the handle can be sent to different
threads and can be used to spawn futures on the executor.</p>
</div></div>
<h2 id='implementations' class='small-section-header'>
Trait Implementations<a href='#implementations' class='anchor'></a>
</h2>
<h3 id='impl-Executor' class='impl'><span class='in-band'><code>impl <a class="trait" href="../../../tokio/executor/trait.Executor.html" title="trait tokio::executor::Executor">Executor</a> for <a class="struct" href="../../../tokio/executor/current_thread/struct.CurrentThread.html" title="struct tokio::executor::current_thread::CurrentThread">CurrentThread</a></code><a href='#impl-Executor' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/tokio/executor/current_thread/mod.rs.html#426-440' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.spawn-1' class="method"><span id='spawn.v-1' class='invisible'><code>fn <a href='../../../tokio/executor/trait.Executor.html#tymethod.spawn' class='fnname'>spawn</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;future: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="trait" href="../../../tokio/prelude/future/trait.Future.html" title="trait tokio::prelude::future::Future">Future</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Error = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="../../../tokio/executor/struct.SpawnError.html" title="struct tokio::executor::SpawnError">SpawnError</a>&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/tokio/executor/current_thread/mod.rs.html#427-432' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Spawns a future object to run on this executor. <a href="../../../tokio/executor/trait.Executor.html#tymethod.spawn">Read more</a></p>
</div><h4 id='method.status' class="method"><span id='status.v' class='invisible'><code>fn <a href='../../../tokio/executor/trait.Executor.html#method.status' class='fnname'>status</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="../../../tokio/executor/struct.SpawnError.html" title="struct tokio::executor::SpawnError">SpawnError</a>&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/tokio_executor/lib.rs.html#182-184' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Provides a best effort hint to whether or not <code>spawn</code> will succeed. <a href="../../../tokio/executor/trait.Executor.html#method.status">Read more</a></p>
</div></div><h3 id='impl-Debug' class='impl'><span class='in-band'><code>impl&lt;P:&nbsp;<a class="trait" href="../../../tokio_executor/park/trait.Park.html" title="trait tokio_executor::park::Park">Park</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../tokio/executor/current_thread/struct.CurrentThread.html" title="struct tokio::executor::current_thread::CurrentThread">CurrentThread</a>&lt;P&gt;</code><a href='#impl-Debug' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/tokio/executor/current_thread/mod.rs.html#442-449' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, fmt: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../../src/tokio/executor/current_thread/mod.rs.html#443-448' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt><kbd>?</kbd></dt>
<dd>Show this help dialog</dd>
<dt><kbd>S</kbd></dt>
<dd>Focus the search field</dd>
<dt><kbd></kbd></dt>
<dd>Move up in search results</dd>
<dt><kbd></kbd></dt>
<dd>Move down in search results</dd>
<dt><kbd></kbd></dt>
<dd>Switch tab</dd>
<dt><kbd>&#9166;</kbd></dt>
<dd>Go to active search result</dd>
<dt><kbd>+</kbd></dt>
<dd>Expand all sections</dd>
<dt><kbd>-</kbd></dt>
<dd>Collapse all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../../";
window.currentCrate = "tokio";
</script>
<script src="../../../main.js"></script>
<script defer src="../../../search-index.js"></script>
</body>
</html>