35 lines
12 KiB
HTML
35 lines
12 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 `Park` trait in crate `tokio_executor`."><meta name="keywords" content="rust, rustlang, rust-lang, Park"><title>tokio_executor::park::Park - 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 trait"><!--[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_executor/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait Park</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-types">Associated Types</a><div class="sidebar-links"><a href="#associatedtype.Unpark">Unpark</a><a href="#associatedtype.Error">Error</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.park">park</a><a href="#tymethod.park_timeout">park_timeout</a><a href="#tymethod.unpark">unpark</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>tokio_executor</a>::<wbr><a href='index.html'>park</a></p><script>window.sidebarCurrent = {name: 'Park', ty: 'trait', 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"><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_executor/park.rs.html#59-105' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../index.html'>tokio_executor</a>::<wbr><a href='index.html'>park</a>::<wbr><a class="trait" href=''>Park</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait Park {
|
||
type <a href='#associatedtype.Unpark' class="type">Unpark</a>: <a class="trait" href="../../tokio_executor/park/trait.Unpark.html" title="trait tokio_executor::park::Unpark">Unpark</a>;
|
||
type <a href='#associatedtype.Error' class="type">Error</a>;
|
||
fn <a href='#tymethod.unpark' class='fnname'>unpark</a>(&self) -> Self::<a class="type" href="../../tokio_executor/park/trait.Park.html#associatedtype.Unpark" title="type tokio_executor::park::Park::Unpark">Unpark</a>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.park' class='fnname'>park</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Self::<a class="type" href="../../tokio_executor/park/trait.Park.html#associatedtype.Error" title="type tokio_executor::park::Park::Error">Error</a>>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.park_timeout' class='fnname'>park_timeout</a>(&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>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Self::<a class="type" href="../../tokio_executor/park/trait.Park.html#associatedtype.Error" title="type tokio_executor::park::Park::Error">Error</a>>;
|
||
}</pre></div><div class='docblock'><p>Block the current thread.</p>
|
||
<p>See <a href="../index.html">module documentation</a> for more details.</p>
|
||
</div>
|
||
<h2 id='associated-types' class='small-section-header'>Associated Types<a href='#associated-types' class='anchor'></a></h2><div class='methods'><h3 id='associatedtype.Unpark' class='method'><code id='Unpark.t'>type <a href='#associatedtype.Unpark' class="type">Unpark</a>: <a class="trait" href="../../tokio_executor/park/trait.Unpark.html" title="trait tokio_executor::park::Unpark">Unpark</a></code></h3><div class='docblock'><p>Unpark handle type for the <code>Park</code> implementation.</p>
|
||
</div><h3 id='associatedtype.Error' class='method'><code id='Error.t'>type <a href='#associatedtype.Error' class="type">Error</a></code></h3><div class='docblock'><p>Error returned by <code>park</code></p>
|
||
</div></div><span class='loading-content'>Loading content...</span>
|
||
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.unpark' class='method'><code id='unpark.v'>fn <a href='#tymethod.unpark' class='fnname'>unpark</a>(&self) -> Self::<a class="type" href="../../tokio_executor/park/trait.Park.html#associatedtype.Unpark" title="type tokio_executor::park::Park::Unpark">Unpark</a></code></h3><div class='docblock'><p>Get a new <code>Unpark</code> handle associated with this <code>Park</code> instance.</p>
|
||
</div><h3 id='tymethod.park' class='method'><code id='park.v'>fn <a href='#tymethod.park' class='fnname'>park</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Self::<a class="type" href="../../tokio_executor/park/trait.Park.html#associatedtype.Error" title="type tokio_executor::park::Park::Error">Error</a>></code></h3><div class='docblock'><p>Block the current thread unless or until the token is available.</p>
|
||
<p>A call to <code>park</code> does not guarantee that the thread will remain blocked
|
||
forever, and callers should be prepared for this possibility. This
|
||
function may wakeup spuriously for any reason.</p>
|
||
<p>See <a href="../index.html">module documentation</a> for more details.</p>
|
||
<h1 id="panics" class="section-header"><a href="#panics">Panics</a></h1>
|
||
<p>This function <strong>should</strong> not panic, but ultimately, panics are left as
|
||
an implementation detail. Refer to the documentation for the specific
|
||
<code>Park</code> implementation</p>
|
||
</div><h3 id='tymethod.park_timeout' class='method'><code id='park_timeout.v'>fn <a href='#tymethod.park_timeout' class='fnname'>park_timeout</a>(&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>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Self::<a class="type" href="../../tokio_executor/park/trait.Park.html#associatedtype.Error" title="type tokio_executor::park::Park::Error">Error</a>></code></h3><div class='docblock'><p>Park the current thread for at most <code>duration</code>.</p>
|
||
<p>This function is the same as <code>park</code> but allows specifying a maximum time
|
||
to block the thread for.</p>
|
||
<p>Same as <code>park</code>, there is no guarantee that the thread will remain
|
||
blocked for any amount of time. Spurious wakeups are permitted for any
|
||
reason.</p>
|
||
<p>See <a href="../index.html">module documentation</a> for more details.</p>
|
||
<h1 id="panics-1" class="section-header"><a href="#panics-1">Panics</a></h1>
|
||
<p>This function <strong>should</strong> not panic, but ultimately, panics are left as
|
||
an implementation detail. Refer to the documentation for the specific
|
||
<code>Park</code> implementation</p>
|
||
</div></div><span class='loading-content'>Loading content...</span>
|
||
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-Park' class='impl'><code class='in-band'>impl Park for <a class="struct" href="../../tokio_executor/park/struct.ParkThread.html" title="struct tokio_executor::park::ParkThread">ParkThread</a></code><a href='#impl-Park' class='anchor'></a><a class='srclink' href='../../src/tokio_executor/park.rs.html#200-218' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Unpark-1' class="type"><code id='Unpark.t-1'>type <a href='#associatedtype.Unpark-1' class="type">Unpark</a> = <a class="struct" href="../../tokio_executor/park/struct.UnparkThread.html" title="struct tokio_executor::park::UnparkThread">UnparkThread</a></code></h4><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='#associatedtype.Error-1' class="type">Error</a> = <a class="struct" href="../../tokio_executor/park/struct.ParkError.html" title="struct tokio_executor::park::ParkError">ParkError</a></code></h4><h4 id='method.unpark' class="method hidden"><code id='unpark.v-1'>fn <a href='#method.unpark' class='fnname'>unpark</a>(&self) -> Self::<a class="type" href="../../tokio_executor/park/trait.Park.html#associatedtype.Unpark" title="type tokio_executor::park::Park::Unpark">Unpark</a></code><a class='srclink' href='../../src/tokio_executor/park.rs.html#204-207' title='goto source code'>[src]</a></h4><h4 id='method.park' class="method hidden"><code id='park.v-1'>fn <a href='#method.park' class='fnname'>park</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Self::<a class="type" href="../../tokio_executor/park/trait.Park.html#associatedtype.Error" title="type tokio_executor::park::Park::Error">Error</a>></code><a class='srclink' href='../../src/tokio_executor/park.rs.html#209-212' title='goto source code'>[src]</a></h4><h4 id='method.park_timeout' class="method hidden"><code id='park_timeout.v-1'>fn <a href='#method.park_timeout' class='fnname'>park_timeout</a>(&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>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Self::<a class="type" href="../../tokio_executor/park/trait.Park.html#associatedtype.Error" title="type tokio_executor::park::Park::Error">Error</a>></code><a class='srclink' href='../../src/tokio_executor/park.rs.html#214-217' title='goto source code'>[src]</a></h4></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/tokio_executor/park/trait.Park.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "tokio_executor";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html> |