Publishing GitHub Pages ***NO_CI***

This commit is contained in:
Nick Lewycky
2019-09-06 15:57:44 -07:00
commit 621a665633
23195 changed files with 1284530 additions and 0 deletions

View File

@ -0,0 +1,3 @@
<!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="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</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">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a></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"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span>
</span>
<span class='in-band'>List of all items</span></h1><h3 id='Structs'>Structs</h3><ul class='structs docblock'><li><a href='struct.GuardNoSend.html'>GuardNoSend</a></li><li><a href='struct.GuardSend.html'>GuardSend</a></li><li><a href='struct.MappedMutexGuard.html'>MappedMutexGuard</a></li><li><a href='struct.MappedReentrantMutexGuard.html'>MappedReentrantMutexGuard</a></li><li><a href='struct.MappedRwLockReadGuard.html'>MappedRwLockReadGuard</a></li><li><a href='struct.MappedRwLockWriteGuard.html'>MappedRwLockWriteGuard</a></li><li><a href='struct.Mutex.html'>Mutex</a></li><li><a href='struct.MutexGuard.html'>MutexGuard</a></li><li><a href='struct.ReentrantMutex.html'>ReentrantMutex</a></li><li><a href='struct.ReentrantMutexGuard.html'>ReentrantMutexGuard</a></li><li><a href='struct.RwLock.html'>RwLock</a></li><li><a href='struct.RwLockReadGuard.html'>RwLockReadGuard</a></li><li><a href='struct.RwLockUpgradableReadGuard.html'>RwLockUpgradableReadGuard</a></li><li><a href='struct.RwLockWriteGuard.html'>RwLockWriteGuard</a></li></ul><h3 id='Traits'>Traits</h3><ul class='traits docblock'><li><a href='trait.GetThreadId.html'>GetThreadId</a></li><li><a href='trait.RawMutex.html'>RawMutex</a></li><li><a href='trait.RawMutexFair.html'>RawMutexFair</a></li><li><a href='trait.RawMutexTimed.html'>RawMutexTimed</a></li><li><a href='trait.RawRwLock.html'>RawRwLock</a></li><li><a href='trait.RawRwLockDowngrade.html'>RawRwLockDowngrade</a></li><li><a href='trait.RawRwLockFair.html'>RawRwLockFair</a></li><li><a href='trait.RawRwLockRecursive.html'>RawRwLockRecursive</a></li><li><a href='trait.RawRwLockRecursiveTimed.html'>RawRwLockRecursiveTimed</a></li><li><a href='trait.RawRwLockTimed.html'>RawRwLockTimed</a></li><li><a href='trait.RawRwLockUpgrade.html'>RawRwLockUpgrade</a></li><li><a href='trait.RawRwLockUpgradeDowngrade.html'>RawRwLockUpgradeDowngrade</a></li><li><a href='trait.RawRwLockUpgradeFair.html'>RawRwLockUpgradeFair</a></li><li><a href='trait.RawRwLockUpgradeTimed.html'>RawRwLockUpgradeTimed</a></li></ul></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

115
rustdoc/lock_api/index.html Normal file
View File

@ -0,0 +1,115 @@
<!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 `lock_api` crate."><meta name="keywords" content="rust, rustlang, rust-lang, lock_api"><title>lock_api - 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">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Crate lock_api</p><div class="sidebar-elems"><a id='all-types' href='all.html'><p>See all lock_api's items</p></a><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'lock_api', 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 js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/lib.rs.html#8-107' title='goto source code'>[src]</a></span><span class='in-band'>Crate <a class="mod" href=''>lock_api</a></span></h1><div class='docblock'><p>This library provides type-safe and fully-featured <code>Mutex</code> and <code>RwLock</code>
types which wrap a simple raw mutex or rwlock type. This has several
benefits: not only does it eliminate a large portion of the work in
implementing custom lock types, it also allows users to write code which is
generic with regards to different lock implementations.</p>
<p>Basic usage of this crate is very straightforward:</p>
<ol>
<li>Create a raw lock type. This should only contain the lock state, not any
data protected by the lock.</li>
<li>Implement the <code>RawMutex</code> trait for your custom lock type.</li>
<li>Export your mutex as a type alias for <code>lock_api::Mutex</code>, and
your mutex guard as a type alias for <code>lock_api::MutexGuard</code>.
See the <a href="#example">example</a> below for details.</li>
</ol>
<p>This process is similar for RwLocks, except that two guards need to be
exported instead of one. (Or 3 guards if your type supports upgradable read
locks, see <a href="#extension-traits">extension traits</a> below for details)</p>
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">lock_api</span>::{<span class="ident">RawMutex</span>, <span class="ident">Mutex</span>, <span class="ident">GuardSend</span>};
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">atomic</span>::{<span class="ident">AtomicBool</span>, <span class="ident">Ordering</span>};
<span class="comment">// 1. Define our raw lock type</span>
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">RawSpinlock</span>(<span class="ident">AtomicBool</span>);
<span class="comment">// 2. Implement RawMutex for this type</span>
<span class="kw">unsafe</span> <span class="kw">impl</span> <span class="ident">RawMutex</span> <span class="kw">for</span> <span class="ident">RawSpinlock</span> {
<span class="kw">const</span> <span class="ident">INIT</span>: <span class="ident">RawSpinlock</span> <span class="op">=</span> <span class="ident">RawSpinlock</span>(<span class="ident">AtomicBool</span>::<span class="ident">new</span>(<span class="bool-val">false</span>));
<span class="comment">// A spinlock guard can be sent to another thread and unlocked there</span>
<span class="kw">type</span> <span class="ident">GuardMarker</span> <span class="op">=</span> <span class="ident">GuardSend</span>;
<span class="kw">fn</span> <span class="ident">lock</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) {
<span class="comment">// Note: This isn&#39;t the best way of implementing a spinlock, but it</span>
<span class="comment">// suffices for the sake of this example.</span>
<span class="kw">while</span> <span class="op">!</span><span class="self">self</span>.<span class="ident">try_lock</span>() {}
}
<span class="kw">fn</span> <span class="ident">try_lock</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">bool</span> {
<span class="self">self</span>.<span class="number">0</span>.<span class="ident">swap</span>(<span class="bool-val">true</span>, <span class="ident">Ordering</span>::<span class="ident">Acquire</span>)
}
<span class="kw">fn</span> <span class="ident">unlock</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) {
<span class="self">self</span>.<span class="number">0</span>.<span class="ident">store</span>(<span class="bool-val">false</span>, <span class="ident">Ordering</span>::<span class="ident">Release</span>);
}
}
<span class="comment">// 3. Export the wrappers. This are the types that your users will actually use.</span>
<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">Spinlock</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">lock_api</span>::<span class="ident">Mutex</span><span class="op">&lt;</span><span class="ident">RawSpinlock</span>, <span class="ident">T</span><span class="op">&gt;</span>;
<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">SpinlockGuard</span><span class="op">&lt;</span><span class="lifetime">&#39;a</span>, <span class="ident">T</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">lock_api</span>::<span class="ident">MutexGuard</span><span class="op">&lt;</span><span class="lifetime">&#39;a</span>, <span class="ident">RawSpinlock</span>, <span class="ident">T</span><span class="op">&gt;</span>;</pre></div>
<h1 id="extension-traits" class="section-header"><a href="#extension-traits">Extension traits</a></h1>
<p>In addition to basic locking &amp; unlocking functionality, you have the option
of exposing additional functionality in your lock types by implementing
additional traits for it. Examples of extension features include:</p>
<ul>
<li>Fair unlocking (<code>RawMutexFair</code>, <code>RawRwLockFair</code>)</li>
<li>Lock timeouts (<code>RawMutexTimed</code>, <code>RawRwLockTimed</code>)</li>
<li>Downgradable write locks (<code>RawRwLockDowngradable</code>)</li>
<li>Recursive read locks (<code>RawRwLockRecursive</code>)</li>
<li>Upgradable read locks (<code>RawRwLockUpgrade</code>)</li>
</ul>
<p>The <code>Mutex</code> and <code>RwLock</code> wrappers will automatically expose this additional
functionality if the raw lock type implements these extension traits.</p>
<h1 id="cargo-features" class="section-header"><a href="#cargo-features">Cargo features</a></h1>
<p>This crate supports two cargo features:</p>
<ul>
<li><code>owning_ref</code>: Allows your lock types to be used with the <code>owning_ref</code> crate.</li>
<li><code>nightly</code>: Enables nightly-only features. At the moment the only such
feature is <code>const fn</code> constructors for lock types.</li>
</ul>
</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<table><tr class='module-item'><td><a class="struct" href="struct.GuardNoSend.html" title='lock_api::GuardNoSend struct'>GuardNoSend</a></td><td class='docblock-short'><p>Marker type which indicates that the Guard type for a lock is not <code>Send</code>.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.GuardSend.html" title='lock_api::GuardSend struct'>GuardSend</a></td><td class='docblock-short'><p>Marker type which indicates that the Guard type for a lock is <code>Send</code>.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.MappedMutexGuard.html" title='lock_api::MappedMutexGuard struct'>MappedMutexGuard</a></td><td class='docblock-short'><p>An RAII mutex guard returned by <code>MutexGuard::map</code>, which can point to a
subfield of the protected data.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.MappedReentrantMutexGuard.html" title='lock_api::MappedReentrantMutexGuard struct'>MappedReentrantMutexGuard</a></td><td class='docblock-short'><p>An RAII mutex guard returned by <code>ReentrantMutexGuard::map</code>, which can point to a
subfield of the protected data.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.MappedRwLockReadGuard.html" title='lock_api::MappedRwLockReadGuard struct'>MappedRwLockReadGuard</a></td><td class='docblock-short'><p>An RAII read lock guard returned by <code>RwLockReadGuard::map</code>, which can point to a
subfield of the protected data.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.MappedRwLockWriteGuard.html" title='lock_api::MappedRwLockWriteGuard struct'>MappedRwLockWriteGuard</a></td><td class='docblock-short'><p>An RAII write lock guard returned by <code>RwLockWriteGuard::map</code>, which can point to a
subfield of the protected data.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Mutex.html" title='lock_api::Mutex struct'>Mutex</a></td><td class='docblock-short'><p>A mutual exclusion primitive useful for protecting shared data</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.MutexGuard.html" title='lock_api::MutexGuard struct'>MutexGuard</a></td><td class='docblock-short'><p>An RAII implementation of a &quot;scoped lock&quot; of a mutex. When this structure is
dropped (falls out of scope), the lock will be unlocked.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ReentrantMutex.html" title='lock_api::ReentrantMutex struct'>ReentrantMutex</a></td><td class='docblock-short'><p>A mutex which can be recursively locked by a single thread.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ReentrantMutexGuard.html" title='lock_api::ReentrantMutexGuard struct'>ReentrantMutexGuard</a></td><td class='docblock-short'><p>An RAII implementation of a &quot;scoped lock&quot; of a reentrant mutex. When this structure
is dropped (falls out of scope), the lock will be unlocked.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.RwLock.html" title='lock_api::RwLock struct'>RwLock</a></td><td class='docblock-short'><p>A reader-writer lock</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.RwLockReadGuard.html" title='lock_api::RwLockReadGuard struct'>RwLockReadGuard</a></td><td class='docblock-short'><p>RAII structure used to release the shared read access of a lock when
dropped.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.RwLockUpgradableReadGuard.html" title='lock_api::RwLockUpgradableReadGuard struct'>RwLockUpgradableReadGuard</a></td><td class='docblock-short'><p>RAII structure used to release the upgradable read access of a lock when
dropped.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.RwLockWriteGuard.html" title='lock_api::RwLockWriteGuard struct'>RwLockWriteGuard</a></td><td class='docblock-short'><p>RAII structure used to release the exclusive write access of a lock when
dropped.</p>
</td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
<table><tr class='module-item'><td><a class="trait" href="trait.GetThreadId.html" title='lock_api::GetThreadId trait'>GetThreadId</a></td><td class='docblock-short'><p>Helper trait which returns a non-zero thread ID.</p>
</td></tr><tr class='module-item'><td><a class="trait" href="trait.RawMutex.html" title='lock_api::RawMutex trait'>RawMutex</a></td><td class='docblock-short'><p>Basic operations for a mutex.</p>
</td></tr><tr class='module-item'><td><a class="trait" href="trait.RawMutexFair.html" title='lock_api::RawMutexFair trait'>RawMutexFair</a></td><td class='docblock-short'><p>Additional methods for mutexes which support fair unlocking.</p>
</td></tr><tr class='module-item'><td><a class="trait" href="trait.RawMutexTimed.html" title='lock_api::RawMutexTimed trait'>RawMutexTimed</a></td><td class='docblock-short'><p>Additional methods for mutexes which support locking with timeouts.</p>
</td></tr><tr class='module-item'><td><a class="trait" href="trait.RawRwLock.html" title='lock_api::RawRwLock trait'>RawRwLock</a></td><td class='docblock-short'><p>Basic operations for a reader-writer lock.</p>
</td></tr><tr class='module-item'><td><a class="trait" href="trait.RawRwLockDowngrade.html" title='lock_api::RawRwLockDowngrade trait'>RawRwLockDowngrade</a></td><td class='docblock-short'><p>Additional methods for RwLocks which support atomically downgrading an
exclusive lock to a shared lock.</p>
</td></tr><tr class='module-item'><td><a class="trait" href="trait.RawRwLockFair.html" title='lock_api::RawRwLockFair trait'>RawRwLockFair</a></td><td class='docblock-short'><p>Additional methods for RwLocks which support fair unlocking.</p>
</td></tr><tr class='module-item'><td><a class="trait" href="trait.RawRwLockRecursive.html" title='lock_api::RawRwLockRecursive trait'>RawRwLockRecursive</a></td><td class='docblock-short'><p>Additional methods for RwLocks which support recursive read locks.</p>
</td></tr><tr class='module-item'><td><a class="trait" href="trait.RawRwLockRecursiveTimed.html" title='lock_api::RawRwLockRecursiveTimed trait'>RawRwLockRecursiveTimed</a></td><td class='docblock-short'><p>Additional methods for RwLocks which support recursive read locks and timeouts.</p>
</td></tr><tr class='module-item'><td><a class="trait" href="trait.RawRwLockTimed.html" title='lock_api::RawRwLockTimed trait'>RawRwLockTimed</a></td><td class='docblock-short'><p>Additional methods for RwLocks which support locking with timeouts.</p>
</td></tr><tr class='module-item'><td><a class="trait" href="trait.RawRwLockUpgrade.html" title='lock_api::RawRwLockUpgrade trait'>RawRwLockUpgrade</a></td><td class='docblock-short'><p>Additional methods for RwLocks which support atomically upgrading a shared
lock to an exclusive lock.</p>
</td></tr><tr class='module-item'><td><a class="trait" href="trait.RawRwLockUpgradeDowngrade.html" title='lock_api::RawRwLockUpgradeDowngrade trait'>RawRwLockUpgradeDowngrade</a></td><td class='docblock-short'><p>Additional methods for RwLocks which support upgradable locks and lock
downgrading.</p>
</td></tr><tr class='module-item'><td><a class="trait" href="trait.RawRwLockUpgradeFair.html" title='lock_api::RawRwLockUpgradeFair trait'>RawRwLockUpgradeFair</a></td><td class='docblock-short'><p>Additional methods for RwLocks which support upgradable locks and fair
unlocking.</p>
</td></tr><tr class='module-item'><td><a class="trait" href="trait.RawRwLockUpgradeTimed.html" title='lock_api::RawRwLockUpgradeTimed trait'>RawRwLockUpgradeTimed</a></td><td class='docblock-short'><p>Additional methods for RwLocks which support upgradable locks and locking
with timeouts.</p>
</td></tr></table></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.MappedMutexGuard.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/struct.MappedMutexGuard.html">../../lock_api/struct.MappedMutexGuard.html</a>...</p>
<script>location.replace("../../lock_api/struct.MappedMutexGuard.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.Mutex.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/struct.Mutex.html">../../lock_api/struct.Mutex.html</a>...</p>
<script>location.replace("../../lock_api/struct.Mutex.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.MutexGuard.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/struct.MutexGuard.html">../../lock_api/struct.MutexGuard.html</a>...</p>
<script>location.replace("../../lock_api/struct.MutexGuard.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawMutex.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/trait.RawMutex.html">../../lock_api/trait.RawMutex.html</a>...</p>
<script>location.replace("../../lock_api/trait.RawMutex.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawMutexFair.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/trait.RawMutexFair.html">../../lock_api/trait.RawMutexFair.html</a>...</p>
<script>location.replace("../../lock_api/trait.RawMutexFair.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawMutexTimed.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/trait.RawMutexTimed.html">../../lock_api/trait.RawMutexTimed.html</a>...</p>
<script>location.replace("../../lock_api/trait.RawMutexTimed.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.MappedReentrantMutexGuard.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/struct.MappedReentrantMutexGuard.html">../../lock_api/struct.MappedReentrantMutexGuard.html</a>...</p>
<script>location.replace("../../lock_api/struct.MappedReentrantMutexGuard.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.ReentrantMutex.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/struct.ReentrantMutex.html">../../lock_api/struct.ReentrantMutex.html</a>...</p>
<script>location.replace("../../lock_api/struct.ReentrantMutex.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.ReentrantMutexGuard.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/struct.ReentrantMutexGuard.html">../../lock_api/struct.ReentrantMutexGuard.html</a>...</p>
<script>location.replace("../../lock_api/struct.ReentrantMutexGuard.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.GetThreadId.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/trait.GetThreadId.html">../../lock_api/trait.GetThreadId.html</a>...</p>
<script>location.replace("../../lock_api/trait.GetThreadId.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.MappedRwLockReadGuard.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/struct.MappedRwLockReadGuard.html">../../lock_api/struct.MappedRwLockReadGuard.html</a>...</p>
<script>location.replace("../../lock_api/struct.MappedRwLockReadGuard.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.MappedRwLockWriteGuard.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/struct.MappedRwLockWriteGuard.html">../../lock_api/struct.MappedRwLockWriteGuard.html</a>...</p>
<script>location.replace("../../lock_api/struct.MappedRwLockWriteGuard.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.RwLock.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/struct.RwLock.html">../../lock_api/struct.RwLock.html</a>...</p>
<script>location.replace("../../lock_api/struct.RwLock.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.RwLockReadGuard.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/struct.RwLockReadGuard.html">../../lock_api/struct.RwLockReadGuard.html</a>...</p>
<script>location.replace("../../lock_api/struct.RwLockReadGuard.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.RwLockUpgradableReadGuard.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/struct.RwLockUpgradableReadGuard.html">../../lock_api/struct.RwLockUpgradableReadGuard.html</a>...</p>
<script>location.replace("../../lock_api/struct.RwLockUpgradableReadGuard.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.RwLockWriteGuard.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/struct.RwLockWriteGuard.html">../../lock_api/struct.RwLockWriteGuard.html</a>...</p>
<script>location.replace("../../lock_api/struct.RwLockWriteGuard.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawRwLock.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/trait.RawRwLock.html">../../lock_api/trait.RawRwLock.html</a>...</p>
<script>location.replace("../../lock_api/trait.RawRwLock.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawRwLockDowngrade.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/trait.RawRwLockDowngrade.html">../../lock_api/trait.RawRwLockDowngrade.html</a>...</p>
<script>location.replace("../../lock_api/trait.RawRwLockDowngrade.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawRwLockFair.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/trait.RawRwLockFair.html">../../lock_api/trait.RawRwLockFair.html</a>...</p>
<script>location.replace("../../lock_api/trait.RawRwLockFair.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawRwLockRecursive.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/trait.RawRwLockRecursive.html">../../lock_api/trait.RawRwLockRecursive.html</a>...</p>
<script>location.replace("../../lock_api/trait.RawRwLockRecursive.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawRwLockRecursiveTimed.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/trait.RawRwLockRecursiveTimed.html">../../lock_api/trait.RawRwLockRecursiveTimed.html</a>...</p>
<script>location.replace("../../lock_api/trait.RawRwLockRecursiveTimed.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawRwLockTimed.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/trait.RawRwLockTimed.html">../../lock_api/trait.RawRwLockTimed.html</a>...</p>
<script>location.replace("../../lock_api/trait.RawRwLockTimed.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawRwLockUpgrade.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/trait.RawRwLockUpgrade.html">../../lock_api/trait.RawRwLockUpgrade.html</a>...</p>
<script>location.replace("../../lock_api/trait.RawRwLockUpgrade.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawRwLockUpgradeDowngrade.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/trait.RawRwLockUpgradeDowngrade.html">../../lock_api/trait.RawRwLockUpgradeDowngrade.html</a>...</p>
<script>location.replace("../../lock_api/trait.RawRwLockUpgradeDowngrade.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawRwLockUpgradeFair.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/trait.RawRwLockUpgradeFair.html">../../lock_api/trait.RawRwLockUpgradeFair.html</a>...</p>
<script>location.replace("../../lock_api/trait.RawRwLockUpgradeFair.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawRwLockUpgradeTimed.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/trait.RawRwLockUpgradeTimed.html">../../lock_api/trait.RawRwLockUpgradeTimed.html</a>...</p>
<script>location.replace("../../lock_api/trait.RawRwLockUpgradeTimed.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1 @@
initSidebarItems({"struct":[["GuardNoSend","Marker type which indicates that the Guard type for a lock is not `Send`."],["GuardSend","Marker type which indicates that the Guard type for a lock is `Send`."],["MappedMutexGuard","An RAII mutex guard returned by `MutexGuard::map`, which can point to a subfield of the protected data."],["MappedReentrantMutexGuard","An RAII mutex guard returned by `ReentrantMutexGuard::map`, which can point to a subfield of the protected data."],["MappedRwLockReadGuard","An RAII read lock guard returned by `RwLockReadGuard::map`, which can point to a subfield of the protected data."],["MappedRwLockWriteGuard","An RAII write lock guard returned by `RwLockWriteGuard::map`, which can point to a subfield of the protected data."],["Mutex","A mutual exclusion primitive useful for protecting shared data"],["MutexGuard","An RAII implementation of a \"scoped lock\" of a mutex. When this structure is dropped (falls out of scope), the lock will be unlocked."],["ReentrantMutex","A mutex which can be recursively locked by a single thread."],["ReentrantMutexGuard","An RAII implementation of a \"scoped lock\" of a reentrant mutex. When this structure is dropped (falls out of scope), the lock will be unlocked."],["RwLock","A reader-writer lock"],["RwLockReadGuard","RAII structure used to release the shared read access of a lock when dropped."],["RwLockUpgradableReadGuard","RAII structure used to release the upgradable read access of a lock when dropped."],["RwLockWriteGuard","RAII structure used to release the exclusive write access of a lock when dropped."]],"trait":[["GetThreadId","Helper trait which returns a non-zero thread ID."],["RawMutex","Basic operations for a mutex."],["RawMutexFair","Additional methods for mutexes which support fair unlocking."],["RawMutexTimed","Additional methods for mutexes which support locking with timeouts."],["RawRwLock","Basic operations for a reader-writer lock."],["RawRwLockDowngrade","Additional methods for RwLocks which support atomically downgrading an exclusive lock to a shared lock."],["RawRwLockFair","Additional methods for RwLocks which support fair unlocking."],["RawRwLockRecursive","Additional methods for RwLocks which support recursive read locks."],["RawRwLockRecursiveTimed","Additional methods for RwLocks which support recursive read locks and timeouts."],["RawRwLockTimed","Additional methods for RwLocks which support locking with timeouts."],["RawRwLockUpgrade","Additional methods for RwLocks which support atomically upgrading a shared lock to an exclusive lock."],["RawRwLockUpgradeDowngrade","Additional methods for RwLocks which support upgradable locks and lock downgrading."],["RawRwLockUpgradeFair","Additional methods for RwLocks which support upgradable locks and fair unlocking."],["RawRwLockUpgradeTimed","Additional methods for RwLocks which support upgradable locks and locking with timeouts."]]});

View File

@ -0,0 +1,11 @@
<!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 `GuardNoSend` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, GuardNoSend"><title>lock_api::GuardNoSend - 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 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><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct GuardNoSend</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a><a href="#impl-Unpin">Unpin</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'GuardNoSend', 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"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/lib.rs.html#98' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>GuardNoSend</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct GuardNoSend(_);</pre></div><div class='docblock'><p>Marker type which indicates that the Guard type for a lock is not <code>Send</code>.</p>
</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'><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../lock_api/struct.GuardNoSend.html" title="struct lock_api::GuardNoSend">GuardNoSend</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../lock_api/struct.GuardNoSend.html" title="struct lock_api::GuardNoSend">GuardNoSend</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../lock_api/struct.GuardNoSend.html" title="struct lock_api::GuardNoSend">GuardNoSend</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#552-554' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#553' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-577' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#574-576' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-548' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -&gt; U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#545-547' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#559-566' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(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;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#563-565' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,11 @@
<!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 `GuardSend` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, GuardSend"><title>lock_api::GuardSend - 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 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><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct GuardSend</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'GuardSend', 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"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/lib.rs.html#95' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>GuardSend</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct GuardSend(_);</pre></div><div class='docblock'><p>Marker type which indicates that the Guard type for a lock is <code>Send</code>.</p>
</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'><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../lock_api/struct.GuardSend.html" title="struct lock_api::GuardSend">GuardSend</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../lock_api/struct.GuardSend.html" title="struct lock_api::GuardSend">GuardSend</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../lock_api/struct.GuardSend.html" title="struct lock_api::GuardSend">GuardSend</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#552-554' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#553' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-577' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#574-576' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-548' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -&gt; U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#545-547' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#559-566' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(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;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#563-565' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,46 @@
<!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 `MappedMutexGuard` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, MappedMutexGuard"><title>lock_api::MappedMutexGuard - 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 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><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct MappedMutexGuard</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.map">map</a><a href="#method.try_map">try_map</a><a href="#method.unlock_fair">unlock_fair</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-DerefMut">DerefMut</a><a href="#impl-Display">Display</a><a href="#impl-Drop">Drop</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Unpin">Unpin</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'MappedMutexGuard', 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"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/mutex.rs.html#485-489' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>MappedMutexGuard</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'><span class="docblock attributes top-attr">#[must_use = "if unused the Mutex will immediately unlock"]
</span>pub struct MappedMutexGuard&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; { /* fields omitted */ }</pre></div><div class='docblock'><p>An RAII mutex guard returned by <code>MutexGuard::map</code>, which can point to a
subfield of the protected data.</p>
<p>The main difference between <code>MappedMutexGuard</code> and <code>MutexGuard</code> is that the
former doesn't support temporarily unlocking and re-locking, since that
could introduce soundness issues if the locked object is modified by another
thread.</p>
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, T&gt;</code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#500-542' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.map' class="method"><code id='map.v'>pub fn <a href='#method.map' class='fnname'>map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(s: Self, f: F) -&gt; <a class="struct" href="../lock_api/struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, U&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;mut T) -&gt; &amp;mut U,&nbsp;</span></code><a class='srclink' href='../src/lock_api/mutex.rs.html#510-518' title='goto source code'>[src]</a></h4><div class='docblock'><p>Makes a new <code>MappedMutexGuard</code> for a component of the locked data.</p>
<p>This operation cannot fail as the <code>MappedMutexGuard</code> passed
in already locked the mutex.</p>
<p>This is an associated function that needs to be
used as <code>MappedMutexGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div><h4 id='method.try_map' class="method"><code id='try_map.v'>pub fn <a href='#method.try_map' class='fnname'>try_map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;s: Self, <br>&nbsp;&nbsp;&nbsp;&nbsp;f: 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;<a class="struct" href="../lock_api/struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, U&gt;, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;mut T) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;mut U&gt;,&nbsp;</span></code><a class='srclink' href='../src/lock_api/mutex.rs.html#530-541' title='goto source code'>[src]</a></h4><div class='docblock'><p>Attempts to make a new <code>MappedMutexGuard</code> for a component of the
locked data. The original guard is return if the closure returns <code>None</code>.</p>
<p>This operation cannot fail as the <code>MappedMutexGuard</code> passed
in already locked the mutex.</p>
<p>This is an associated function that needs to be
used as <code>MappedMutexGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutexFair.html" title="trait lock_api::RawMutexFair">RawMutexFair</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#544-562' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.unlock_fair' class="method"><code id='unlock_fair.v'>pub fn <a href='#method.unlock_fair' class='fnname'>unlock_fair</a>(s: Self)</code><a class='srclink' href='../src/lock_api/mutex.rs.html#558-561' title='goto source code'>[src]</a></h4><div class='docblock'><p>Unlocks the mutex using a fair unlock protocol.</p>
<p>By default, mutexes are unfair and allow the current thread to re-lock
the mutex before another has the chance to acquire the lock, even if
that thread has been blocked on the mutex for a long time. This is the
default because it allows much higher throughput as it avoids forcing a
context switch on every mutex unlock. This can result in one thread
acquiring a mutex many more times than other threads.</p>
<p>However in some cases it can be beneficial to ensure fairness by forcing
the lock to pass on to a waiting thread if there is one. This is done by
using this method instead of dropping the <code>MutexGuard</code> normally.</p>
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-DerefMut' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html" title="trait core::ops::deref::DerefMut">DerefMut</a> for <a class="struct" href="../lock_api/struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-DerefMut' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#572-577' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deref_mut' class="method hidden"><code id='deref_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html#tymethod.deref_mut' class='fnname'>deref_mut</a>(&amp;mut self) -&gt; &amp;mut T</code><a class='srclink' href='../src/lock_api/mutex.rs.html#574-576' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably dereferences the value.</p>
</div></div><h3 id='impl-Deref' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../lock_api/struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Deref' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#564-570' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><code id='Target.t'>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = T</code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
</div><h4 id='method.deref' class="method hidden"><code id='deref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='../src/lock_api/mutex.rs.html#567-569' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
</div></div><h3 id='impl-Drop' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../lock_api/struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Drop' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#579-584' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.drop' class="method hidden"><code id='drop.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&amp;mut self)</code><a class='srclink' href='../src/lock_api/mutex.rs.html#581-583' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../lock_api/struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#592-598' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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><a class='srclink' href='../src/lock_api/mutex.rs.html#595-597' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + '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="../lock_api/struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#586-590' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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><a class='srclink' href='../src/lock_api/mutex.rs.html#587-589' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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><h3 id='impl-Send' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../lock_api/struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R::<a class="type" href="../lock_api/trait.RawMutex.html#associatedtype.GuardMarker" title="type lock_api::RawMutex::GuardMarker">GuardMarker</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,&nbsp;</span></code><a href='#impl-Send' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#495-498' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../lock_api/struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Sync' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#491-494' title='goto source code'>[src]</a></h3><div class='impl-items'></div></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'><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl&lt;'a, R, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../lock_api/struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#552-554' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#553' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-577' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#574-576' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-548' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -&gt; U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#545-547' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#559-566' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(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;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#563-565' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,45 @@
<!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 `MappedReentrantMutexGuard` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, MappedReentrantMutexGuard"><title>lock_api::MappedReentrantMutexGuard - 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 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><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct MappedReentrantMutexGuard</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.map">map</a><a href="#method.try_map">try_map</a><a href="#method.unlock_fair">unlock_fair</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-Display">Display</a><a href="#impl-Drop">Drop</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">!Send</a><a href="#impl-Unpin">Unpin</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'MappedReentrantMutexGuard', 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"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/remutex.rs.html#570-574' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>MappedReentrantMutexGuard</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'><span class="docblock attributes top-attr">#[must_use = "if unused the ReentrantMutex will immediately unlock"]
</span>pub struct MappedReentrantMutexGuard&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; { /* fields omitted */ }</pre></div><div class='docblock'><p>An RAII mutex guard returned by <code>ReentrantMutexGuard::map</code>, which can point to a
subfield of the protected data.</p>
<p>The main difference between <code>MappedReentrantMutexGuard</code> and <code>ReentrantMutexGuard</code> is that the
former doesn't support temporarily unlocking and re-locking, since that
could introduce soundness issues if the locked object is modified by another
thread.</p>
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#581-628' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.map' class="method"><code id='map.v'>pub fn <a href='#method.map' class='fnname'>map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;s: Self, <br>&nbsp;&nbsp;&nbsp;&nbsp;f: F<br>) -&gt; <a class="struct" href="../lock_api/struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, U&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;T) -&gt; &amp;U,&nbsp;</span></code><a class='srclink' href='../src/lock_api/remutex.rs.html#593-601' title='goto source code'>[src]</a></h4><div class='docblock'><p>Makes a new <code>MappedReentrantMutexGuard</code> for a component of the locked data.</p>
<p>This operation cannot fail as the <code>MappedReentrantMutexGuard</code> passed
in already locked the mutex.</p>
<p>This is an associated function that needs to be
used as <code>MappedReentrantMutexGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div><h4 id='method.try_map' class="method"><code id='try_map.v'>pub fn <a href='#method.try_map' class='fnname'>try_map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;s: Self, <br>&nbsp;&nbsp;&nbsp;&nbsp;f: 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;<a class="struct" href="../lock_api/struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, U&gt;, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;T) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;U&gt;,&nbsp;</span></code><a class='srclink' href='../src/lock_api/remutex.rs.html#613-627' title='goto source code'>[src]</a></h4><div class='docblock'><p>Attempts to make a new <code>MappedReentrantMutexGuard</code> for a component of the
locked data. The original guard is return if the closure returns <code>None</code>.</p>
<p>This operation cannot fail as the <code>MappedReentrantMutexGuard</code> passed
in already locked the mutex.</p>
<p>This is an associated function that needs to be
used as <code>MappedReentrantMutexGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutexFair.html" title="trait lock_api::RawMutexFair">RawMutexFair</a> + 'a, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#630-650' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.unlock_fair' class="method"><code id='unlock_fair.v'>pub fn <a href='#method.unlock_fair' class='fnname'>unlock_fair</a>(s: Self)</code><a class='srclink' href='../src/lock_api/remutex.rs.html#646-649' title='goto source code'>[src]</a></h4><div class='docblock'><p>Unlocks the mutex using a fair unlock protocol.</p>
<p>By default, mutexes are unfair and allow the current thread to re-lock
the mutex before another has the chance to acquire the lock, even if
that thread has been blocked on the mutex for a long time. This is the
default because it allows much higher throughput as it avoids forcing a
context switch on every mutex unlock. This can result in one thread
acquiring a mutex many more times than other threads.</p>
<p>However in some cases it can be beneficial to ensure fairness by forcing
the lock to pass on to a waiting thread if there is one. This is done by
using this method instead of dropping the <code>ReentrantMutexGuard</code> normally.</p>
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Deref' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../lock_api/struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</code><a href='#impl-Deref' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#652-660' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><code id='Target.t'>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = T</code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
</div><h4 id='method.deref' class="method hidden"><code id='deref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='../src/lock_api/remutex.rs.html#657-659' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
</div></div><h3 id='impl-Drop' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../lock_api/struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</code><a href='#impl-Drop' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#662-669' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.drop' class="method hidden"><code id='drop.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&amp;mut self)</code><a class='srclink' href='../src/lock_api/remutex.rs.html#666-668' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../lock_api/struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#679-685' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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><a class='srclink' href='../src/lock_api/remutex.rs.html#682-684' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + '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="../lock_api/struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#671-677' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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><a class='srclink' href='../src/lock_api/remutex.rs.html#674-676' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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><h3 id='impl-Sync' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../lock_api/struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</code><a href='#impl-Sync' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#576-579' title='goto source code'>[src]</a></h3><div class='impl-items'></div></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'><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl&lt;'a, R, G, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../lock_api/struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl&lt;'a, R, G, T&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../lock_api/struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#552-554' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#553' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-577' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#574-576' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-548' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -&gt; U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#545-547' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#559-566' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(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;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#563-565' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,45 @@
<!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 `MappedRwLockReadGuard` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, MappedRwLockReadGuard"><title>lock_api::MappedRwLockReadGuard - 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 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><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct MappedRwLockReadGuard</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.map">map</a><a href="#method.try_map">try_map</a><a href="#method.unlock_fair">unlock_fair</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-Display">Display</a><a href="#impl-Drop">Drop</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Unpin">Unpin</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'MappedRwLockReadGuard', 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"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#1278-1282' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>MappedRwLockReadGuard</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'><span class="docblock attributes top-attr">#[must_use = "if unused the RwLock will immediately unlock"]
</span>pub struct MappedRwLockReadGuard&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; { /* fields omitted */ }</pre></div><div class='docblock'><p>An RAII read lock guard returned by <code>RwLockReadGuard::map</code>, which can point to a
subfield of the protected data.</p>
<p>The main difference between <code>MappedRwLockReadGuard</code> and <code>RwLockReadGuard</code> is that the
former doesn't support temporarily unlocking and re-locking, since that
could introduce soundness issues if the locked object is modified by another
thread.</p>
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1290-1332' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.map' class="method"><code id='map.v'>pub fn <a href='#method.map' class='fnname'>map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(s: Self, f: F) -&gt; <a class="struct" href="../lock_api/struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, U&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;T) -&gt; &amp;U,&nbsp;</span></code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1300-1308' title='goto source code'>[src]</a></h4><div class='docblock'><p>Make a new <code>MappedRwLockReadGuard</code> for a component of the locked data.</p>
<p>This operation cannot fail as the <code>MappedRwLockReadGuard</code> passed
in already locked the data.</p>
<p>This is an associated function that needs to be
used as <code>MappedRwLockReadGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div><h4 id='method.try_map' class="method"><code id='try_map.v'>pub fn <a href='#method.try_map' class='fnname'>try_map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;s: Self, <br>&nbsp;&nbsp;&nbsp;&nbsp;f: 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;<a class="struct" href="../lock_api/struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, U&gt;, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;T) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;U&gt;,&nbsp;</span></code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1320-1331' title='goto source code'>[src]</a></h4><div class='docblock'><p>Attempts to make a new <code>MappedRwLockReadGuard</code> for a component of the
locked data. The original guard is return if the closure returns <code>None</code>.</p>
<p>This operation cannot fail as the <code>MappedRwLockReadGuard</code> passed
in already locked the data.</p>
<p>This is an associated function that needs to be
used as <code>MappedRwLockReadGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockFair.html" title="trait lock_api::RawRwLockFair">RawRwLockFair</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1334-1352' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.unlock_fair' class="method"><code id='unlock_fair.v'>pub fn <a href='#method.unlock_fair' class='fnname'>unlock_fair</a>(s: Self)</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1348-1351' title='goto source code'>[src]</a></h4><div class='docblock'><p>Unlocks the <code>RwLock</code> using a fair unlock protocol.</p>
<p>By default, <code>RwLock</code> is unfair and allow the current thread to re-lock
the <code>RwLock</code> before another has the chance to acquire the lock, even if
that thread has been blocked on the <code>RwLock</code> for a long time. This is
the default because it allows much higher throughput as it avoids
forcing a context switch on every <code>RwLock</code> unlock. This can result in one
thread acquiring a <code>RwLock</code> many more times than other threads.</p>
<p>However in some cases it can be beneficial to ensure fairness by forcing
the lock to pass on to a waiting thread if there is one. This is done by
using this method instead of dropping the <code>MappedRwLockReadGuard</code> normally.</p>
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Deref' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../lock_api/struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Deref' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1354-1360' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><code id='Target.t'>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = T</code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
</div><h4 id='method.deref' class="method hidden"><code id='deref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1357-1359' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
</div></div><h3 id='impl-Drop' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../lock_api/struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Drop' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1362-1367' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.drop' class="method hidden"><code id='drop.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&amp;mut self)</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1364-1366' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../lock_api/struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1377-1383' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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><a class='srclink' href='../src/lock_api/rwlock.rs.html#1380-1382' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + '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="../lock_api/struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1369-1375' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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><a class='srclink' href='../src/lock_api/rwlock.rs.html#1372-1374' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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><h3 id='impl-Send' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../lock_api/struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R::<a class="type" href="../lock_api/trait.RawRwLock.html#associatedtype.GuardMarker" title="type lock_api::RawRwLock::GuardMarker">GuardMarker</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,&nbsp;</span></code><a href='#impl-Send' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1285-1288' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../lock_api/struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Sync' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1284' title='goto source code'>[src]</a></h3><div class='impl-items'></div></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'><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl&lt;'a, R, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../lock_api/struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#552-554' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#553' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-577' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#574-576' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-548' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -&gt; U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#545-547' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#559-566' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(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;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#563-565' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,51 @@
<!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 `MappedRwLockWriteGuard` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, MappedRwLockWriteGuard"><title>lock_api::MappedRwLockWriteGuard - 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 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><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct MappedRwLockWriteGuard</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.downgrade">downgrade</a><a href="#method.map">map</a><a href="#method.try_map">try_map</a><a href="#method.unlock_fair">unlock_fair</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-DerefMut">DerefMut</a><a href="#impl-Display">Display</a><a href="#impl-Drop">Drop</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Unpin">Unpin</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'MappedRwLockWriteGuard', 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"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#1399-1403' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>MappedRwLockWriteGuard</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'><span class="docblock attributes top-attr">#[must_use = "if unused the RwLock will immediately unlock"]
</span>pub struct MappedRwLockWriteGuard&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; { /* fields omitted */ }</pre></div><div class='docblock'><p>An RAII write lock guard returned by <code>RwLockWriteGuard::map</code>, which can point to a
subfield of the protected data.</p>
<p>The main difference between <code>MappedRwLockWriteGuard</code> and <code>RwLockWriteGuard</code> is that the
former doesn't support temporarily unlocking and re-locking, since that
could introduce soundness issues if the locked object is modified by another
thread.</p>
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1414-1456' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.map' class="method"><code id='map.v'>pub fn <a href='#method.map' class='fnname'>map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(s: Self, f: F) -&gt; <a class="struct" href="../lock_api/struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, U&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;mut T) -&gt; &amp;mut U,&nbsp;</span></code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1424-1432' title='goto source code'>[src]</a></h4><div class='docblock'><p>Make a new <code>MappedRwLockWriteGuard</code> for a component of the locked data.</p>
<p>This operation cannot fail as the <code>MappedRwLockWriteGuard</code> passed
in already locked the data.</p>
<p>This is an associated function that needs to be
used as <code>MappedRwLockWriteGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div><h4 id='method.try_map' class="method"><code id='try_map.v'>pub fn <a href='#method.try_map' class='fnname'>try_map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;s: Self, <br>&nbsp;&nbsp;&nbsp;&nbsp;f: 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;<a class="struct" href="../lock_api/struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, U&gt;, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;mut T) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;mut U&gt;,&nbsp;</span></code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1444-1455' title='goto source code'>[src]</a></h4><div class='docblock'><p>Attempts to make a new <code>MappedRwLockWriteGuard</code> for a component of the
locked data. The original guard is return if the closure returns <code>None</code>.</p>
<p>This operation cannot fail as the <code>MappedRwLockWriteGuard</code> passed
in already locked the data.</p>
<p>This is an associated function that needs to be
used as <code>MappedRwLockWriteGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockDowngrade.html" title="trait lock_api::RawRwLockDowngrade">RawRwLockDowngrade</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1458-1472' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.downgrade' class="method"><code id='downgrade.v'>pub fn <a href='#method.downgrade' class='fnname'>downgrade</a>(s: Self) -&gt; <a class="struct" href="../lock_api/struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, T&gt;</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1465-1471' title='goto source code'>[src]</a></h4><div class='docblock'><p>Atomically downgrades a write lock into a read lock without allowing any
writers to take exclusive access of the lock in the meantime.</p>
<p>Note that if there are any writers currently waiting to take the lock
then other readers may not be able to acquire the lock even if it was
downgraded.</p>
</div></div><h3 id='impl-2' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockFair.html" title="trait lock_api::RawRwLockFair">RawRwLockFair</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-2' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1474-1492' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.unlock_fair' class="method"><code id='unlock_fair.v'>pub fn <a href='#method.unlock_fair' class='fnname'>unlock_fair</a>(s: Self)</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1488-1491' title='goto source code'>[src]</a></h4><div class='docblock'><p>Unlocks the <code>RwLock</code> using a fair unlock protocol.</p>
<p>By default, <code>RwLock</code> is unfair and allow the current thread to re-lock
the <code>RwLock</code> before another has the chance to acquire the lock, even if
that thread has been blocked on the <code>RwLock</code> for a long time. This is
the default because it allows much higher throughput as it avoids
forcing a context switch on every <code>RwLock</code> unlock. This can result in one
thread acquiring a <code>RwLock</code> many more times than other threads.</p>
<p>However in some cases it can be beneficial to ensure fairness by forcing
the lock to pass on to a waiting thread if there is one. This is done by
using this method instead of dropping the <code>MappedRwLockWriteGuard</code> normally.</p>
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-DerefMut' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html" title="trait core::ops::deref::DerefMut">DerefMut</a> for <a class="struct" href="../lock_api/struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-DerefMut' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1502-1507' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deref_mut' class="method hidden"><code id='deref_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html#tymethod.deref_mut' class='fnname'>deref_mut</a>(&amp;mut self) -&gt; &amp;mut T</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1504-1506' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably dereferences the value.</p>
</div></div><h3 id='impl-Deref' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../lock_api/struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Deref' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1494-1500' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><code id='Target.t'>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = T</code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
</div><h4 id='method.deref' class="method hidden"><code id='deref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1497-1499' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
</div></div><h3 id='impl-Drop' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../lock_api/struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Drop' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1509-1514' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.drop' class="method hidden"><code id='drop.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&amp;mut self)</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1511-1513' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../lock_api/struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1524-1530' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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><a class='srclink' href='../src/lock_api/rwlock.rs.html#1527-1529' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + '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="../lock_api/struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1516-1522' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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><a class='srclink' href='../src/lock_api/rwlock.rs.html#1519-1521' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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><h3 id='impl-Send' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../lock_api/struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R::<a class="type" href="../lock_api/trait.RawRwLock.html#associatedtype.GuardMarker" title="type lock_api::RawRwLock::GuardMarker">GuardMarker</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,&nbsp;</span></code><a href='#impl-Send' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1409-1412' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../lock_api/struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Sync' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1405-1408' title='goto source code'>[src]</a></h3><div class='impl-items'></div></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'><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl&lt;'a, R, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../lock_api/struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#552-554' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#553' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-577' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#574-576' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-548' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -&gt; U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#545-547' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#559-566' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(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;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#563-565' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,67 @@
<!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 `Mutex` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, Mutex"><title>lock_api::Mutex - 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 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><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Mutex</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.force_unlock">force_unlock</a><a href="#method.force_unlock_fair">force_unlock_fair</a><a href="#method.get_mut">get_mut</a><a href="#method.into_inner">into_inner</a><a href="#method.lock">lock</a><a href="#method.new">new</a><a href="#method.raw">raw</a><a href="#method.try_lock">try_lock</a><a href="#method.try_lock_for">try_lock_for</a><a href="#method.try_lock_until">try_lock_until</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Unpin">Unpin</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'Mutex', 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"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/mutex.rs.html#94-97' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>Mutex</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Mutex&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; { /* fields omitted */ }</pre></div><div class='docblock'><p>A mutual exclusion primitive useful for protecting shared data</p>
<p>This mutex will block threads waiting for the lock to become available. The
mutex can also be statically initialized or created via a <code>new</code>
constructor. Each mutex has a type parameter which represents the data that
it is protecting. The data can only be accessed through the RAII guards
returned from <code>lock</code> and <code>try_lock</code>, which guarantees that the data is only
ever accessed when the mutex is locked.</p>
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T&gt; <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#131-152' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code id='new.v'>pub fn <a href='#method.new' class='fnname'>new</a>(val: T) -&gt; <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</code><a class='srclink' href='../src/lock_api/mutex.rs.html#142-144' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates a new mutex in an unlocked state ready for use.</p>
</div><h4 id='method.into_inner' class="method"><code id='into_inner.v'>pub fn <a href='#method.into_inner' class='fnname'>into_inner</a>(self) -&gt; T</code><a class='srclink' href='../src/lock_api/mutex.rs.html#149-151' title='goto source code'>[src]</a></h4><div class='docblock'><p>Consumes this mutex, returning the underlying data.</p>
</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#154-234' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.lock' class="method"><code id='lock.v'>pub fn <a href='#method.lock' class='fnname'>lock</a>(&amp;self) -&gt; <a class="struct" href="../lock_api/struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a>&lt;R, T&gt;</code><a class='srclink' href='../src/lock_api/mutex.rs.html#173-177' title='goto source code'>[src]</a></h4><div class='docblock'><p>Acquires a mutex, blocking the current thread until it is able to do so.</p>
<p>This function will block the local thread until it is available to acquire
the mutex. Upon returning, the thread is the only thread with the mutex
held. An RAII guard is returned to allow scoped unlock of the lock. When
the guard goes out of scope, the mutex will be unlocked.</p>
<p>Attempts to lock a mutex in the thread which already holds the lock will
result in a deadlock.</p>
</div><h4 id='method.try_lock' class="method"><code id='try_lock.v'>pub fn <a href='#method.try_lock' class='fnname'>try_lock</a>(&amp;self) -&gt; <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="../lock_api/struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a>&lt;R, T&gt;&gt;</code><a class='srclink' href='../src/lock_api/mutex.rs.html#187-194' title='goto source code'>[src]</a></h4><div class='docblock'><p>Attempts to acquire this lock.</p>
<p>If the lock could not be acquired at this time, then <code>None</code> is returned.
Otherwise, an RAII guard is returned. The lock will be unlocked when the
guard is dropped.</p>
<p>This function does not block.</p>
</div><h4 id='method.get_mut' class="method"><code id='get_mut.v'>pub fn <a href='#method.get_mut' class='fnname'>get_mut</a>(&amp;mut self) -&gt; &amp;mut T</code><a class='srclink' href='../src/lock_api/mutex.rs.html#201-203' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a mutable reference to the underlying data.</p>
<p>Since this call borrows the <code>Mutex</code> mutably, no actual locking needs to
take place---the mutable borrow statically guarantees no locks exist.</p>
</div><h4 id='method.force_unlock' class="method"><code id='force_unlock.v'>pub unsafe fn <a href='#method.force_unlock' class='fnname'>force_unlock</a>(&amp;self)</code><a class='srclink' href='../src/lock_api/mutex.rs.html#217-219' title='goto source code'>[src]</a></h4><div class='docblock'><p>Forcibly unlocks the mutex.</p>
<p>This is useful when combined with <code>mem::forget</code> to hold a lock without
the need to maintain a <code>MutexGuard</code> object alive, for example when
dealing with FFI.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>This method must only be called if the current thread logically owns a
<code>MutexGuard</code> but that guard has be discarded using <code>mem::forget</code>.
Behavior is undefined if a mutex is unlocked when not locked.</p>
</div><h4 id='method.raw' class="method"><code id='raw.v'>pub unsafe fn <a href='#method.raw' class='fnname'>raw</a>(&amp;self) -&gt; &amp;R</code><a class='srclink' href='../src/lock_api/mutex.rs.html#231-233' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the underlying raw mutex object.</p>
<p>Note that you will most likely need to import the <code>RawMutex</code> trait from
<code>lock_api</code> to be able to call functions on the raw mutex.</p>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method is unsafe because it allows unlocking a mutex while
still holding a reference to a <code>MutexGuard</code>.</p>
</div></div><h3 id='impl-2' class='impl'><code class='in-band'>impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutexFair.html" title="trait lock_api::RawMutexFair">RawMutexFair</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</code><a href='#impl-2' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#236-252' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.force_unlock_fair' class="method"><code id='force_unlock_fair.v'>pub unsafe fn <a href='#method.force_unlock_fair' class='fnname'>force_unlock_fair</a>(&amp;self)</code><a class='srclink' href='../src/lock_api/mutex.rs.html#249-251' title='goto source code'>[src]</a></h4><div class='docblock'><p>Forcibly unlocks the mutex using a fair unlock procotol.</p>
<p>This is useful when combined with <code>mem::forget</code> to hold a lock without
the need to maintain a <code>MutexGuard</code> object alive, for example when
dealing with FFI.</p>
<h1 id="safety-2" class="section-header"><a href="#safety-2">Safety</a></h1>
<p>This method must only be called if the current thread logically owns a
<code>MutexGuard</code> but that guard has be discarded using <code>mem::forget</code>.
Behavior is undefined if a mutex is unlocked when not locked.</p>
</div></div><h3 id='impl-3' class='impl'><code class='in-band'>impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutexTimed.html" title="trait lock_api::RawMutexTimed">RawMutexTimed</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</code><a href='#impl-3' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#254-284' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.try_lock_for' class="method"><code id='try_lock_for.v'>pub fn <a href='#method.try_lock_for' class='fnname'>try_lock_for</a>(&amp;self, timeout: R::<a class="type" href="../lock_api/trait.RawMutexTimed.html#associatedtype.Duration" title="type lock_api::RawMutexTimed::Duration">Duration</a>) -&gt; <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="../lock_api/struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a>&lt;R, T&gt;&gt;</code><a class='srclink' href='../src/lock_api/mutex.rs.html#261-268' title='goto source code'>[src]</a></h4><div class='docblock'><p>Attempts to acquire this lock until a timeout is reached.</p>
<p>If the lock could not be acquired before the timeout expired, then
<code>None</code> is returned. Otherwise, an RAII guard is returned. The lock will
be unlocked when the guard is dropped.</p>
</div><h4 id='method.try_lock_until' class="method"><code id='try_lock_until.v'>pub fn <a href='#method.try_lock_until' class='fnname'>try_lock_until</a>(&amp;self, timeout: R::<a class="type" href="../lock_api/trait.RawMutexTimed.html#associatedtype.Instant" title="type lock_api::RawMutexTimed::Instant">Instant</a>) -&gt; <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="../lock_api/struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a>&lt;R, T&gt;&gt;</code><a class='srclink' href='../src/lock_api/mutex.rs.html#276-283' title='goto source code'>[src]</a></h4><div class='docblock'><p>Attempts to acquire this lock until a timeout is reached.</p>
<p>If the lock could not be acquired before the timeout expired, then
<code>None</code> is returned. Otherwise, an RAII guard is returned. The lock will
be unlocked when the guard is dropped.</p>
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#293-298' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</code><a class='srclink' href='../src/lock_api/mutex.rs.html#295-297' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</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="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#300-316' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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><a class='srclink' href='../src/lock_api/mutex.rs.html#301-315' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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><h3 id='impl-Send' class='impl'><code class='in-band'>impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</code><a href='#impl-Send' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#128' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</code><a href='#impl-Sync' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#129' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#286-291' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -&gt; <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</code><a class='srclink' href='../src/lock_api/mutex.rs.html#288-290' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the &quot;default value&quot; for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
</div></div></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'><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl&lt;R, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-From%3CT%3E-1' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href='#impl-From%3CT%3E-1' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#552-554' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#553' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-577' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#574-576' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-548' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -&gt; U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#545-547' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#559-566' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(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;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#563-565' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,56 @@
<!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 `MutexGuard` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, MutexGuard"><title>lock_api::MutexGuard - 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 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><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct MutexGuard</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.bump">bump</a><a href="#method.map">map</a><a href="#method.mutex">mutex</a><a href="#method.try_map">try_map</a><a href="#method.unlock_fair">unlock_fair</a><a href="#method.unlocked">unlocked</a><a href="#method.unlocked_fair">unlocked_fair</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-DerefMut">DerefMut</a><a href="#impl-Display">Display</a><a href="#impl-Drop">Drop</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Unpin">Unpin</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'MutexGuard', 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"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/mutex.rs.html#324-327' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>MutexGuard</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'><span class="docblock attributes top-attr">#[must_use = "if unused the Mutex will immediately unlock"]
</span>pub struct MutexGuard&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; { /* fields omitted */ }</pre></div><div class='docblock'><p>An RAII implementation of a &quot;scoped lock&quot; of a mutex. When this structure is
dropped (falls out of scope), the lock will be unlocked.</p>
<p>The data protected by the mutex can be accessed through this guard via its
<code>Deref</code> and <code>DerefMut</code> implementations.</p>
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a>&lt;'a, R, T&gt;</code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#331-392' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.mutex' class="method"><code id='mutex.v'>pub fn <a href='#method.mutex' class='fnname'>mutex</a>(s: &amp;Self) -&gt; &amp;'a <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</code><a class='srclink' href='../src/lock_api/mutex.rs.html#333-335' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a reference to the original <code>Mutex</code> object.</p>
</div><h4 id='method.map' class="method"><code id='map.v'>pub fn <a href='#method.map' class='fnname'>map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(s: Self, f: F) -&gt; <a class="struct" href="../lock_api/struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, U&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;mut T) -&gt; &amp;mut U,&nbsp;</span></code><a class='srclink' href='../src/lock_api/mutex.rs.html#346-354' title='goto source code'>[src]</a></h4><div class='docblock'><p>Makes a new <code>MappedMutexGuard</code> for a component of the locked data.</p>
<p>This operation cannot fail as the <code>MutexGuard</code> passed
in already locked the mutex.</p>
<p>This is an associated function that needs to be
used as <code>MutexGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div><h4 id='method.try_map' class="method"><code id='try_map.v'>pub fn <a href='#method.try_map' class='fnname'>try_map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;s: Self, <br>&nbsp;&nbsp;&nbsp;&nbsp;f: 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;<a class="struct" href="../lock_api/struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, U&gt;, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;mut T) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;mut U&gt;,&nbsp;</span></code><a class='srclink' href='../src/lock_api/mutex.rs.html#366-377' title='goto source code'>[src]</a></h4><div class='docblock'><p>Attempts to make a new <code>MappedMutexGuard</code> for a component of the
locked data. The original guard is return if the closure returns <code>None</code>.</p>
<p>This operation cannot fail as the <code>MutexGuard</code> passed
in already locked the mutex.</p>
<p>This is an associated function that needs to be
used as <code>MutexGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div><h4 id='method.unlocked' class="method"><code id='unlocked.v'>pub fn <a href='#method.unlocked' class='fnname'>unlocked</a>&lt;F, U&gt;(s: &amp;mut Self, f: F) -&gt; U <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -&gt; U,&nbsp;</span></code><a class='srclink' href='../src/lock_api/mutex.rs.html#384-391' title='goto source code'>[src]</a></h4><div class='docblock'><p>Temporarily unlocks the mutex to execute the given function.</p>
<p>This is safe because <code>&amp;mut</code> guarantees that there exist no other
references to the data protected by the mutex.</p>
</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutexFair.html" title="trait lock_api::RawMutexFair">RawMutexFair</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#394-438' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.unlock_fair' class="method"><code id='unlock_fair.v'>pub fn <a href='#method.unlock_fair' class='fnname'>unlock_fair</a>(s: Self)</code><a class='srclink' href='../src/lock_api/mutex.rs.html#408-411' title='goto source code'>[src]</a></h4><div class='docblock'><p>Unlocks the mutex using a fair unlock protocol.</p>
<p>By default, mutexes are unfair and allow the current thread to re-lock
the mutex before another has the chance to acquire the lock, even if
that thread has been blocked on the mutex for a long time. This is the
default because it allows much higher throughput as it avoids forcing a
context switch on every mutex unlock. This can result in one thread
acquiring a mutex many more times than other threads.</p>
<p>However in some cases it can be beneficial to ensure fairness by forcing
the lock to pass on to a waiting thread if there is one. This is done by
using this method instead of dropping the <code>MutexGuard</code> normally.</p>
</div><h4 id='method.unlocked_fair' class="method"><code id='unlocked_fair.v'>pub fn <a href='#method.unlocked_fair' class='fnname'>unlocked_fair</a>&lt;F, U&gt;(s: &amp;mut Self, f: F) -&gt; U <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -&gt; U,&nbsp;</span></code><a class='srclink' href='../src/lock_api/mutex.rs.html#420-427' title='goto source code'>[src]</a></h4><div class='docblock'><p>Temporarily unlocks the mutex to execute the given function.</p>
<p>The mutex is unlocked a fair unlock protocol.</p>
<p>This is safe because <code>&amp;mut</code> guarantees that there exist no other
references to the data protected by the mutex.</p>
</div><h4 id='method.bump' class="method"><code id='bump.v'>pub fn <a href='#method.bump' class='fnname'>bump</a>(s: &amp;mut Self)</code><a class='srclink' href='../src/lock_api/mutex.rs.html#435-437' title='goto source code'>[src]</a></h4><div class='docblock'><p>Temporarily yields the mutex to a waiting thread if there is one.</p>
<p>This method is functionally equivalent to calling <code>unlock_fair</code> followed
by <code>lock</code>, however it can be much more efficient in the case where there
are no waiting threads.</p>
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-DerefMut' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html" title="trait core::ops::deref::DerefMut">DerefMut</a> for <a class="struct" href="../lock_api/struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-DerefMut' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#448-453' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deref_mut' class="method hidden"><code id='deref_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html#tymethod.deref_mut' class='fnname'>deref_mut</a>(&amp;mut self) -&gt; &amp;mut T</code><a class='srclink' href='../src/lock_api/mutex.rs.html#450-452' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably dereferences the value.</p>
</div></div><h3 id='impl-Deref' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../lock_api/struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Deref' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#440-446' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><code id='Target.t'>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = T</code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
</div><h4 id='method.deref' class="method hidden"><code id='deref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='../src/lock_api/mutex.rs.html#443-445' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
</div></div><h3 id='impl-Drop' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../lock_api/struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Drop' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#455-460' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.drop' class="method hidden"><code id='drop.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&amp;mut self)</code><a class='srclink' href='../src/lock_api/mutex.rs.html#457-459' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../lock_api/struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#468-472' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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><a class='srclink' href='../src/lock_api/mutex.rs.html#469-471' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + '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="../lock_api/struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#462-466' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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><a class='srclink' href='../src/lock_api/mutex.rs.html#463-465' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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><h3 id='impl-Sync' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../lock_api/struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Sync' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#329' title='goto source code'>[src]</a></h3><div class='impl-items'></div></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'><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl&lt;'a, R, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../lock_api/struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a>&lt;'a, R, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;R as <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>&gt;::<a class="type" href="../lock_api/trait.RawMutex.html#associatedtype.GuardMarker" title="type lock_api::RawMutex::GuardMarker">GuardMarker</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl&lt;'a, R, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../lock_api/struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a>&lt;'a, R, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;R as <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>&gt;::<a class="type" href="../lock_api/trait.RawMutex.html#associatedtype.GuardMarker" title="type lock_api::RawMutex::GuardMarker">GuardMarker</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,&nbsp;</span></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#552-554' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#553' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-577' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#574-576' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-548' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -&gt; U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#545-547' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#559-566' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(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;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#563-565' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,72 @@
<!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 `ReentrantMutex` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, ReentrantMutex"><title>lock_api::ReentrantMutex - 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 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><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct ReentrantMutex</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.force_unlock">force_unlock</a><a href="#method.force_unlock_fair">force_unlock_fair</a><a href="#method.get_mut">get_mut</a><a href="#method.into_inner">into_inner</a><a href="#method.lock">lock</a><a href="#method.new">new</a><a href="#method.raw">raw</a><a href="#method.try_lock">try_lock</a><a href="#method.try_lock_for">try_lock_for</a><a href="#method.try_lock_until">try_lock_until</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Unpin">Unpin</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'ReentrantMutex', 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"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/remutex.rs.html#142-145' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>ReentrantMutex</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct ReentrantMutex&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; { /* fields omitted */ }</pre></div><div class='docblock'><p>A mutex which can be recursively locked by a single thread.</p>
<p>This type is identical to <code>Mutex</code> except for the following points:</p>
<ul>
<li>Locking multiple times from the same thread will work correctly instead of
deadlocking.</li>
<li><code>ReentrantMutexGuard</code> does not give mutable references to the locked data.
Use a <code>RefCell</code> if you need this.</li>
</ul>
<p>See <a href="struct.Mutex.html"><code>Mutex</code></a> for more details about the underlying mutex
primitive.</p>
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a>, T&gt; <a class="struct" href="../lock_api/struct.ReentrantMutex.html" title="struct lock_api::ReentrantMutex">ReentrantMutex</a>&lt;R, G, T&gt;</code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#187-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code id='new.v'>pub fn <a href='#method.new' class='fnname'>new</a>(val: T) -&gt; <a class="struct" href="../lock_api/struct.ReentrantMutex.html" title="struct lock_api::ReentrantMutex">ReentrantMutex</a>&lt;R, G, T&gt;</code><a class='srclink' href='../src/lock_api/remutex.rs.html#206-216' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates a new reentrant mutex in an unlocked state ready for use.</p>
</div><h4 id='method.into_inner' class="method"><code id='into_inner.v'>pub fn <a href='#method.into_inner' class='fnname'>into_inner</a>(self) -&gt; T</code><a class='srclink' href='../src/lock_api/remutex.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock'><p>Consumes this mutex, returning the underlying data.</p>
</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="struct" href="../lock_api/struct.ReentrantMutex.html" title="struct lock_api::ReentrantMutex">ReentrantMutex</a>&lt;R, G, T&gt;</code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#226-307' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.lock' class="method"><code id='lock.v'>pub fn <a href='#method.lock' class='fnname'>lock</a>(&amp;self) -&gt; <a class="struct" href="../lock_api/struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;R, G, T&gt;</code><a class='srclink' href='../src/lock_api/remutex.rs.html#246-250' title='goto source code'>[src]</a></h4><div class='docblock'><p>Acquires a reentrant mutex, blocking the current thread until it is able
to do so.</p>
<p>If the mutex is held by another thread then this function will block the
local thread until it is available to acquire the mutex. If the mutex is
already held by the current thread then this function will increment the
lock reference count and return immediately. Upon returning,
the thread is the only thread with the mutex held. An RAII guard is
returned to allow scoped unlock of the lock. When the guard goes out of
scope, the mutex will be unlocked.</p>
</div><h4 id='method.try_lock' class="method"><code id='try_lock.v'>pub fn <a href='#method.try_lock' class='fnname'>try_lock</a>(&amp;self) -&gt; <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="../lock_api/struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;R, G, T&gt;&gt;</code><a class='srclink' href='../src/lock_api/remutex.rs.html#260-267' title='goto source code'>[src]</a></h4><div class='docblock'><p>Attempts to acquire this lock.</p>
<p>If the lock could not be acquired at this time, then <code>None</code> is returned.
Otherwise, an RAII guard is returned. The lock will be unlocked when the
guard is dropped.</p>
<p>This function does not block.</p>
</div><h4 id='method.get_mut' class="method"><code id='get_mut.v'>pub fn <a href='#method.get_mut' class='fnname'>get_mut</a>(&amp;mut self) -&gt; &amp;mut T</code><a class='srclink' href='../src/lock_api/remutex.rs.html#274-276' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a mutable reference to the underlying data.</p>
<p>Since this call borrows the <code>ReentrantMutex</code> mutably, no actual locking needs to
take place---the mutable borrow statically guarantees no locks exist.</p>
</div><h4 id='method.force_unlock' class="method"><code id='force_unlock.v'>pub unsafe fn <a href='#method.force_unlock' class='fnname'>force_unlock</a>(&amp;self)</code><a class='srclink' href='../src/lock_api/remutex.rs.html#290-292' title='goto source code'>[src]</a></h4><div class='docblock'><p>Forcibly unlocks the mutex.</p>
<p>This is useful when combined with <code>mem::forget</code> to hold a lock without
the need to maintain a <code>ReentrantMutexGuard</code> object alive, for example when
dealing with FFI.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>This method must only be called if the current thread logically owns a
<code>ReentrantMutexGuard</code> but that guard has be discarded using <code>mem::forget</code>.
Behavior is undefined if a mutex is unlocked when not locked.</p>
</div><h4 id='method.raw' class="method"><code id='raw.v'>pub unsafe fn <a href='#method.raw' class='fnname'>raw</a>(&amp;self) -&gt; &amp;R</code><a class='srclink' href='../src/lock_api/remutex.rs.html#304-306' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the underlying raw mutex object.</p>
<p>Note that you will most likely need to import the <code>RawMutex</code> trait from
<code>lock_api</code> to be able to call functions on the raw mutex.</p>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method is unsafe because it allows unlocking a mutex while
still holding a reference to a <code>ReentrantMutexGuard</code>.</p>
</div></div><h3 id='impl-2' class='impl'><code class='in-band'>impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutexFair.html" title="trait lock_api::RawMutexFair">RawMutexFair</a>, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="struct" href="../lock_api/struct.ReentrantMutex.html" title="struct lock_api::ReentrantMutex">ReentrantMutex</a>&lt;R, G, T&gt;</code><a href='#impl-2' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#309-325' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.force_unlock_fair' class="method"><code id='force_unlock_fair.v'>pub unsafe fn <a href='#method.force_unlock_fair' class='fnname'>force_unlock_fair</a>(&amp;self)</code><a class='srclink' href='../src/lock_api/remutex.rs.html#322-324' title='goto source code'>[src]</a></h4><div class='docblock'><p>Forcibly unlocks the mutex using a fair unlock protocol.</p>
<p>This is useful when combined with <code>mem::forget</code> to hold a lock without
the need to maintain a <code>ReentrantMutexGuard</code> object alive, for example when
dealing with FFI.</p>
<h1 id="safety-2" class="section-header"><a href="#safety-2">Safety</a></h1>
<p>This method must only be called if the current thread logically owns a
<code>ReentrantMutexGuard</code> but that guard has be discarded using <code>mem::forget</code>.
Behavior is undefined if a mutex is unlocked when not locked.</p>
</div></div><h3 id='impl-3' class='impl'><code class='in-band'>impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutexTimed.html" title="trait lock_api::RawMutexTimed">RawMutexTimed</a>, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="struct" href="../lock_api/struct.ReentrantMutex.html" title="struct lock_api::ReentrantMutex">ReentrantMutex</a>&lt;R, G, T&gt;</code><a href='#impl-3' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#327-357' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.try_lock_for' class="method"><code id='try_lock_for.v'>pub fn <a href='#method.try_lock_for' class='fnname'>try_lock_for</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;timeout: R::<a class="type" href="../lock_api/trait.RawMutexTimed.html#associatedtype.Duration" title="type lock_api::RawMutexTimed::Duration">Duration</a><br>) -&gt; <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="../lock_api/struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;R, G, T&gt;&gt;</code><a class='srclink' href='../src/lock_api/remutex.rs.html#334-341' title='goto source code'>[src]</a></h4><div class='docblock'><p>Attempts to acquire this lock until a timeout is reached.</p>
<p>If the lock could not be acquired before the timeout expired, then
<code>None</code> is returned. Otherwise, an RAII guard is returned. The lock will
be unlocked when the guard is dropped.</p>
</div><h4 id='method.try_lock_until' class="method"><code id='try_lock_until.v'>pub fn <a href='#method.try_lock_until' class='fnname'>try_lock_until</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;timeout: R::<a class="type" href="../lock_api/trait.RawMutexTimed.html#associatedtype.Instant" title="type lock_api::RawMutexTimed::Instant">Instant</a><br>) -&gt; <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="../lock_api/struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;R, G, T&gt;&gt;</code><a class='srclink' href='../src/lock_api/remutex.rs.html#349-356' title='goto source code'>[src]</a></h4><div class='docblock'><p>Attempts to acquire this lock until a timeout is reached.</p>
<p>If the lock could not be acquired before the timeout expired, then
<code>None</code> is returned. Otherwise, an RAII guard is returned. The lock will
be unlocked when the guard is dropped.</p>
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a>, T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for <a class="struct" href="../lock_api/struct.ReentrantMutex.html" title="struct lock_api::ReentrantMutex">ReentrantMutex</a>&lt;R, G, T&gt;</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#366-371' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; <a class="struct" href="../lock_api/struct.ReentrantMutex.html" title="struct lock_api::ReentrantMutex">ReentrantMutex</a>&lt;R, G, T&gt;</code><a class='srclink' href='../src/lock_api/remutex.rs.html#368-370' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</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="../lock_api/struct.ReentrantMutex.html" title="struct lock_api::ReentrantMutex">ReentrantMutex</a>&lt;R, G, T&gt;</code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#373-389' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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><a class='srclink' href='../src/lock_api/remutex.rs.html#374-388' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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><h3 id='impl-Send' class='impl'><code class='in-band'>impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../lock_api/struct.ReentrantMutex.html" title="struct lock_api::ReentrantMutex">ReentrantMutex</a>&lt;R, G, T&gt;</code><a href='#impl-Send' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#178-181' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../lock_api/struct.ReentrantMutex.html" title="struct lock_api::ReentrantMutex">ReentrantMutex</a>&lt;R, G, T&gt;</code><a href='#impl-Sync' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#182-185' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../lock_api/struct.ReentrantMutex.html" title="struct lock_api::ReentrantMutex">ReentrantMutex</a>&lt;R, G, T&gt;</code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#359-364' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -&gt; <a class="struct" href="../lock_api/struct.ReentrantMutex.html" title="struct lock_api::ReentrantMutex">ReentrantMutex</a>&lt;R, G, T&gt;</code><a class='srclink' href='../src/lock_api/remutex.rs.html#361-363' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the &quot;default value&quot; for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
</div></div></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'><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl&lt;R, G, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../lock_api/struct.ReentrantMutex.html" title="struct lock_api::ReentrantMutex">ReentrantMutex</a>&lt;R, G, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;G: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-From%3CT%3E-1' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href='#impl-From%3CT%3E-1' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#552-554' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#553' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-577' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#574-576' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-548' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -&gt; U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#545-547' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#559-566' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(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;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#563-565' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,55 @@
<!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 `ReentrantMutexGuard` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, ReentrantMutexGuard"><title>lock_api::ReentrantMutexGuard - 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 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><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct ReentrantMutexGuard</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.bump">bump</a><a href="#method.map">map</a><a href="#method.remutex">remutex</a><a href="#method.try_map">try_map</a><a href="#method.unlock_fair">unlock_fair</a><a href="#method.unlocked">unlocked</a><a href="#method.unlocked_fair">unlocked_fair</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-Display">Display</a><a href="#impl-Drop">Drop</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">!Send</a><a href="#impl-Unpin">Unpin</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'ReentrantMutexGuard', 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"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/remutex.rs.html#397-400' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>ReentrantMutexGuard</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'><span class="docblock attributes top-attr">#[must_use = "if unused the ReentrantMutex will immediately unlock"]
</span>pub struct ReentrantMutexGuard&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; { /* fields omitted */ }</pre></div><div class='docblock'><p>An RAII implementation of a &quot;scoped lock&quot; of a reentrant mutex. When this structure
is dropped (falls out of scope), the lock will be unlocked.</p>
<p>The data protected by the mutex can be accessed through this guard via its
<code>Deref</code> implementation.</p>
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#407-471' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.remutex' class="method"><code id='remutex.v'>pub fn <a href='#method.remutex' class='fnname'>remutex</a>(s: &amp;Self) -&gt; &amp;'a <a class="struct" href="../lock_api/struct.ReentrantMutex.html" title="struct lock_api::ReentrantMutex">ReentrantMutex</a>&lt;R, G, T&gt;</code><a class='srclink' href='../src/lock_api/remutex.rs.html#409-411' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a reference to the original <code>ReentrantMutex</code> object.</p>
</div><h4 id='method.map' class="method"><code id='map.v'>pub fn <a href='#method.map' class='fnname'>map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;s: Self, <br>&nbsp;&nbsp;&nbsp;&nbsp;f: F<br>) -&gt; <a class="struct" href="../lock_api/struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, U&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;T) -&gt; &amp;U,&nbsp;</span></code><a class='srclink' href='../src/lock_api/remutex.rs.html#422-430' title='goto source code'>[src]</a></h4><div class='docblock'><p>Makes a new <code>MappedReentrantMutexGuard</code> for a component of the locked data.</p>
<p>This operation cannot fail as the <code>ReentrantMutexGuard</code> passed
in already locked the mutex.</p>
<p>This is an associated function that needs to be
used as <code>ReentrantMutexGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div><h4 id='method.try_map' class="method"><code id='try_map.v'>pub fn <a href='#method.try_map' class='fnname'>try_map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;s: Self, <br>&nbsp;&nbsp;&nbsp;&nbsp;f: 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;<a class="struct" href="../lock_api/struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, U&gt;, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;mut T) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;mut U&gt;,&nbsp;</span></code><a class='srclink' href='../src/lock_api/remutex.rs.html#442-456' title='goto source code'>[src]</a></h4><div class='docblock'><p>Attempts to make a new <code>MappedReentrantMutexGuard</code> for a component of the
locked data. The original guard is return if the closure returns <code>None</code>.</p>
<p>This operation cannot fail as the <code>ReentrantMutexGuard</code> passed
in already locked the mutex.</p>
<p>This is an associated function that needs to be
used as <code>ReentrantMutexGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div><h4 id='method.unlocked' class="method"><code id='unlocked.v'>pub fn <a href='#method.unlocked' class='fnname'>unlocked</a>&lt;F, U&gt;(s: &amp;mut Self, f: F) -&gt; U <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -&gt; U,&nbsp;</span></code><a class='srclink' href='../src/lock_api/remutex.rs.html#463-470' title='goto source code'>[src]</a></h4><div class='docblock'><p>Temporarily unlocks the mutex to execute the given function.</p>
<p>This is safe because <code>&amp;mut</code> guarantees that there exist no other
references to the data protected by the mutex.</p>
</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutexFair.html" title="trait lock_api::RawMutexFair">RawMutexFair</a> + 'a, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#473-519' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.unlock_fair' class="method"><code id='unlock_fair.v'>pub fn <a href='#method.unlock_fair' class='fnname'>unlock_fair</a>(s: Self)</code><a class='srclink' href='../src/lock_api/remutex.rs.html#489-492' title='goto source code'>[src]</a></h4><div class='docblock'><p>Unlocks the mutex using a fair unlock protocol.</p>
<p>By default, mutexes are unfair and allow the current thread to re-lock
the mutex before another has the chance to acquire the lock, even if
that thread has been blocked on the mutex for a long time. This is the
default because it allows much higher throughput as it avoids forcing a
context switch on every mutex unlock. This can result in one thread
acquiring a mutex many more times than other threads.</p>
<p>However in some cases it can be beneficial to ensure fairness by forcing
the lock to pass on to a waiting thread if there is one. This is done by
using this method instead of dropping the <code>ReentrantMutexGuard</code> normally.</p>
</div><h4 id='method.unlocked_fair' class="method"><code id='unlocked_fair.v'>pub fn <a href='#method.unlocked_fair' class='fnname'>unlocked_fair</a>&lt;F, U&gt;(s: &amp;mut Self, f: F) -&gt; U <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -&gt; U,&nbsp;</span></code><a class='srclink' href='../src/lock_api/remutex.rs.html#501-508' title='goto source code'>[src]</a></h4><div class='docblock'><p>Temporarily unlocks the mutex to execute the given function.</p>
<p>The mutex is unlocked a fair unlock protocol.</p>
<p>This is safe because <code>&amp;mut</code> guarantees that there exist no other
references to the data protected by the mutex.</p>
</div><h4 id='method.bump' class="method"><code id='bump.v'>pub fn <a href='#method.bump' class='fnname'>bump</a>(s: &amp;mut Self)</code><a class='srclink' href='../src/lock_api/remutex.rs.html#516-518' title='goto source code'>[src]</a></h4><div class='docblock'><p>Temporarily yields the mutex to a waiting thread if there is one.</p>
<p>This method is functionally equivalent to calling <code>unlock_fair</code> followed
by <code>lock</code>, however it can be much more efficient in the case where there
are no waiting threads.</p>
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Deref' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../lock_api/struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</code><a href='#impl-Deref' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#521-529' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><code id='Target.t'>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = T</code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
</div><h4 id='method.deref' class="method hidden"><code id='deref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='../src/lock_api/remutex.rs.html#526-528' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
</div></div><h3 id='impl-Drop' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../lock_api/struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</code><a href='#impl-Drop' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#531-538' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.drop' class="method hidden"><code id='drop.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&amp;mut self)</code><a class='srclink' href='../src/lock_api/remutex.rs.html#535-537' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../lock_api/struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#548-554' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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><a class='srclink' href='../src/lock_api/remutex.rs.html#551-553' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + '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="../lock_api/struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#540-546' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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><a class='srclink' href='../src/lock_api/remutex.rs.html#543-545' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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><h3 id='impl-Sync' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a, G:&nbsp;<a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../lock_api/struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</code><a href='#impl-Sync' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#402-405' title='goto source code'>[src]</a></h3><div class='impl-items'></div></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'><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl&lt;'a, R, G, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../lock_api/struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl&lt;'a, R, G, T&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../lock_api/struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#552-554' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#553' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-577' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#574-576' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-548' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -&gt; U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#545-547' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#559-566' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(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;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#563-565' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,54 @@
<!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 `RwLockReadGuard` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RwLockReadGuard"><title>lock_api::RwLockReadGuard - 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 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><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct RwLockReadGuard</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.bump">bump</a><a href="#method.map">map</a><a href="#method.rwlock">rwlock</a><a href="#method.try_map">try_map</a><a href="#method.unlock_fair">unlock_fair</a><a href="#method.unlocked">unlocked</a><a href="#method.unlocked_fair">unlocked_fair</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-Display">Display</a><a href="#impl-Drop">Drop</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Unpin">Unpin</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RwLockReadGuard', 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"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#738-741' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>RwLockReadGuard</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'><span class="docblock attributes top-attr">#[must_use = "if unused the RwLock will immediately unlock"]
</span>pub struct RwLockReadGuard&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; { /* fields omitted */ }</pre></div><div class='docblock'><p>RAII structure used to release the shared read access of a lock when
dropped.</p>
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.RwLockReadGuard.html" title="struct lock_api::RwLockReadGuard">RwLockReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#745-808' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.rwlock' class="method"><code id='rwlock.v'>pub fn <a href='#method.rwlock' class='fnname'>rwlock</a>(s: &amp;Self) -&gt; &amp;'a <a class="struct" href="../lock_api/struct.RwLock.html" title="struct lock_api::RwLock">RwLock</a>&lt;R, T&gt;</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#747-749' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a reference to the original reader-writer lock object.</p>
</div><h4 id='method.map' class="method"><code id='map.v'>pub fn <a href='#method.map' class='fnname'>map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(s: Self, f: F) -&gt; <a class="struct" href="../lock_api/struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, U&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;T) -&gt; &amp;U,&nbsp;</span></code><a class='srclink' href='../src/lock_api/rwlock.rs.html#760-768' title='goto source code'>[src]</a></h4><div class='docblock'><p>Make a new <code>MappedRwLockReadGuard</code> for a component of the locked data.</p>
<p>This operation cannot fail as the <code>RwLockReadGuard</code> passed
in already locked the data.</p>
<p>This is an associated function that needs to be
used as <code>RwLockReadGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div><h4 id='method.try_map' class="method"><code id='try_map.v'>pub fn <a href='#method.try_map' class='fnname'>try_map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;s: Self, <br>&nbsp;&nbsp;&nbsp;&nbsp;f: 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;<a class="struct" href="../lock_api/struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, U&gt;, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;T) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;U&gt;,&nbsp;</span></code><a class='srclink' href='../src/lock_api/rwlock.rs.html#780-791' title='goto source code'>[src]</a></h4><div class='docblock'><p>Attempts to make a new <code>MappedRwLockReadGuard</code> for a component of the
locked data. The original guard is return if the closure returns <code>None</code>.</p>
<p>This operation cannot fail as the <code>RwLockReadGuard</code> passed
in already locked the data.</p>
<p>This is an associated function that needs to be
used as <code>RwLockReadGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div><h4 id='method.unlocked' class="method"><code id='unlocked.v'>pub fn <a href='#method.unlocked' class='fnname'>unlocked</a>&lt;F, U&gt;(s: &amp;mut Self, f: F) -&gt; U <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -&gt; U,&nbsp;</span></code><a class='srclink' href='../src/lock_api/rwlock.rs.html#800-807' title='goto source code'>[src]</a></h4><div class='docblock'><p>Temporarily unlocks the <code>RwLock</code> to execute the given function.</p>
<p>The <code>RwLock</code> is unlocked a fair unlock protocol.</p>
<p>This is safe because <code>&amp;mut</code> guarantees that there exist no other
references to the data protected by the <code>RwLock</code>.</p>
</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockFair.html" title="trait lock_api::RawRwLockFair">RawRwLockFair</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.RwLockReadGuard.html" title="struct lock_api::RwLockReadGuard">RwLockReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#810-854' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.unlock_fair' class="method"><code id='unlock_fair.v'>pub fn <a href='#method.unlock_fair' class='fnname'>unlock_fair</a>(s: Self)</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#824-827' title='goto source code'>[src]</a></h4><div class='docblock'><p>Unlocks the <code>RwLock</code> using a fair unlock protocol.</p>
<p>By default, <code>RwLock</code> is unfair and allow the current thread to re-lock
the <code>RwLock</code> before another has the chance to acquire the lock, even if
that thread has been blocked on the <code>RwLock</code> for a long time. This is
the default because it allows much higher throughput as it avoids
forcing a context switch on every <code>RwLock</code> unlock. This can result in one
thread acquiring a <code>RwLock</code> many more times than other threads.</p>
<p>However in some cases it can be beneficial to ensure fairness by forcing
the lock to pass on to a waiting thread if there is one. This is done by
using this method instead of dropping the <code>RwLockReadGuard</code> normally.</p>
</div><h4 id='method.unlocked_fair' class="method"><code id='unlocked_fair.v'>pub fn <a href='#method.unlocked_fair' class='fnname'>unlocked_fair</a>&lt;F, U&gt;(s: &amp;mut Self, f: F) -&gt; U <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -&gt; U,&nbsp;</span></code><a class='srclink' href='../src/lock_api/rwlock.rs.html#836-843' title='goto source code'>[src]</a></h4><div class='docblock'><p>Temporarily unlocks the <code>RwLock</code> to execute the given function.</p>
<p>The <code>RwLock</code> is unlocked a fair unlock protocol.</p>
<p>This is safe because <code>&amp;mut</code> guarantees that there exist no other
references to the data protected by the <code>RwLock</code>.</p>
</div><h4 id='method.bump' class="method"><code id='bump.v'>pub fn <a href='#method.bump' class='fnname'>bump</a>(s: &amp;mut Self)</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#851-853' title='goto source code'>[src]</a></h4><div class='docblock'><p>Temporarily yields the <code>RwLock</code> to a waiting thread if there is one.</p>
<p>This method is functionally equivalent to calling <code>unlock_fair</code> followed
by <code>read</code>, however it can be much more efficient in the case where there
are no waiting threads.</p>
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Deref' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../lock_api/struct.RwLockReadGuard.html" title="struct lock_api::RwLockReadGuard">RwLockReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Deref' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#856-862' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><code id='Target.t'>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = T</code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
</div><h4 id='method.deref' class="method hidden"><code id='deref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#859-861' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
</div></div><h3 id='impl-Drop' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../lock_api/struct.RwLockReadGuard.html" title="struct lock_api::RwLockReadGuard">RwLockReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Drop' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#864-869' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.drop' class="method hidden"><code id='drop.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&amp;mut self)</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#866-868' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../lock_api/struct.RwLockReadGuard.html" title="struct lock_api::RwLockReadGuard">RwLockReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#877-883' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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><a class='srclink' href='../src/lock_api/rwlock.rs.html#880-882' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + '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="../lock_api/struct.RwLockReadGuard.html" title="struct lock_api::RwLockReadGuard">RwLockReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#871-875' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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><a class='srclink' href='../src/lock_api/rwlock.rs.html#872-874' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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><h3 id='impl-Sync' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../lock_api/struct.RwLockReadGuard.html" title="struct lock_api::RwLockReadGuard">RwLockReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Sync' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#743' title='goto source code'>[src]</a></h3><div class='impl-items'></div></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'><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl&lt;'a, R, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../lock_api/struct.RwLockReadGuard.html" title="struct lock_api::RwLockReadGuard">RwLockReadGuard</a>&lt;'a, R, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;R as <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a>&gt;::<a class="type" href="../lock_api/trait.RawRwLock.html#associatedtype.GuardMarker" title="type lock_api::RawRwLock::GuardMarker">GuardMarker</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl&lt;'a, R, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../lock_api/struct.RwLockReadGuard.html" title="struct lock_api::RwLockReadGuard">RwLockReadGuard</a>&lt;'a, R, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;R as <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a>&gt;::<a class="type" href="../lock_api/trait.RawRwLock.html#associatedtype.GuardMarker" title="type lock_api::RawRwLock::GuardMarker">GuardMarker</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,&nbsp;</span></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#552-554' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#553' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-577' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#574-576' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-548' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -&gt; U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#545-547' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#559-566' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(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;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#563-565' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,58 @@
<!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 `RwLockUpgradableReadGuard` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RwLockUpgradableReadGuard"><title>lock_api::RwLockUpgradableReadGuard - 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 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><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct RwLockUpgradableReadGuard</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.bump">bump</a><a href="#method.downgrade">downgrade</a><a href="#method.rwlock">rwlock</a><a href="#method.try_upgrade">try_upgrade</a><a href="#method.try_upgrade_for">try_upgrade_for</a><a href="#method.try_upgrade_until">try_upgrade_until</a><a href="#method.unlock_fair">unlock_fair</a><a href="#method.unlocked">unlocked</a><a href="#method.unlocked_fair">unlocked_fair</a><a href="#method.upgrade">upgrade</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-Display">Display</a><a href="#impl-Drop">Drop</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Unpin">Unpin</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RwLockUpgradableReadGuard', 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"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#1079-1082' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>RwLockUpgradableReadGuard</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'><span class="docblock attributes top-attr">#[must_use = "if unused the RwLock will immediately unlock"]
</span>pub struct RwLockUpgradableReadGuard&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockUpgrade.html" title="trait lock_api::RawRwLockUpgrade">RawRwLockUpgrade</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; { /* fields omitted */ }</pre></div><div class='docblock'><p>RAII structure used to release the upgradable read access of a lock when
dropped.</p>
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockUpgrade.html" title="trait lock_api::RawRwLockUpgrade">RawRwLockUpgrade</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.RwLockUpgradableReadGuard.html" title="struct lock_api::RwLockUpgradableReadGuard">RwLockUpgradableReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1089-1130' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.rwlock' class="method"><code id='rwlock.v'>pub fn <a href='#method.rwlock' class='fnname'>rwlock</a>(s: &amp;Self) -&gt; &amp;'a <a class="struct" href="../lock_api/struct.RwLock.html" title="struct lock_api::RwLock">RwLock</a>&lt;R, T&gt;</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1091-1093' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a reference to the original reader-writer lock object.</p>
</div><h4 id='method.unlocked' class="method"><code id='unlocked.v'>pub fn <a href='#method.unlocked' class='fnname'>unlocked</a>&lt;F, U&gt;(s: &amp;mut Self, f: F) -&gt; U <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -&gt; U,&nbsp;</span></code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1100-1107' title='goto source code'>[src]</a></h4><div class='docblock'><p>Temporarily unlocks the <code>RwLock</code> to execute the given function.</p>
<p>This is safe because <code>&amp;mut</code> guarantees that there exist no other
references to the data protected by the <code>RwLock</code>.</p>
</div><h4 id='method.upgrade' class="method"><code id='upgrade.v'>pub fn <a href='#method.upgrade' class='fnname'>upgrade</a>(s: Self) -&gt; <a class="struct" href="../lock_api/struct.RwLockWriteGuard.html" title="struct lock_api::RwLockWriteGuard">RwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1111-1116' title='goto source code'>[src]</a></h4><div class='docblock'><p>Atomically upgrades an upgradable read lock lock into a exclusive write lock,
blocking the current thread until it can be acquired.</p>
</div><h4 id='method.try_upgrade' class="method"><code id='try_upgrade.v'>pub fn <a href='#method.try_upgrade' class='fnname'>try_upgrade</a>(s: 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="struct" href="../lock_api/struct.RwLockWriteGuard.html" title="struct lock_api::RwLockWriteGuard">RwLockWriteGuard</a>&lt;'a, R, T&gt;, Self&gt;</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1121-1129' title='goto source code'>[src]</a></h4><div class='docblock'><p>Tries to atomically upgrade an upgradable read lock into a exclusive write lock.</p>
<p>If the access could not be granted at this time, then the current guard is returned.</p>
</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockUpgradeFair.html" title="trait lock_api::RawRwLockUpgradeFair">RawRwLockUpgradeFair</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.RwLockUpgradableReadGuard.html" title="struct lock_api::RwLockUpgradableReadGuard">RwLockUpgradableReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1132-1176' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.unlock_fair' class="method"><code id='unlock_fair.v'>pub fn <a href='#method.unlock_fair' class='fnname'>unlock_fair</a>(s: Self)</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1146-1149' title='goto source code'>[src]</a></h4><div class='docblock'><p>Unlocks the <code>RwLock</code> using a fair unlock protocol.</p>
<p>By default, <code>RwLock</code> is unfair and allow the current thread to re-lock
the <code>RwLock</code> before another has the chance to acquire the lock, even if
that thread has been blocked on the <code>RwLock</code> for a long time. This is
the default because it allows much higher throughput as it avoids
forcing a context switch on every <code>RwLock</code> unlock. This can result in one
thread acquiring a <code>RwLock</code> many more times than other threads.</p>
<p>However in some cases it can be beneficial to ensure fairness by forcing
the lock to pass on to a waiting thread if there is one. This is done by
using this method instead of dropping the <code>RwLockUpgradableReadGuard</code> normally.</p>
</div><h4 id='method.unlocked_fair' class="method"><code id='unlocked_fair.v'>pub fn <a href='#method.unlocked_fair' class='fnname'>unlocked_fair</a>&lt;F, U&gt;(s: &amp;mut Self, f: F) -&gt; U <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -&gt; U,&nbsp;</span></code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1158-1165' title='goto source code'>[src]</a></h4><div class='docblock'><p>Temporarily unlocks the <code>RwLock</code> to execute the given function.</p>
<p>The <code>RwLock</code> is unlocked a fair unlock protocol.</p>
<p>This is safe because <code>&amp;mut</code> guarantees that there exist no other
references to the data protected by the <code>RwLock</code>.</p>
</div><h4 id='method.bump' class="method"><code id='bump.v'>pub fn <a href='#method.bump' class='fnname'>bump</a>(s: &amp;mut Self)</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1173-1175' title='goto source code'>[src]</a></h4><div class='docblock'><p>Temporarily yields the <code>RwLock</code> to a waiting thread if there is one.</p>
<p>This method is functionally equivalent to calling <code>unlock_fair</code> followed
by <code>upgradable_read</code>, however it can be much more efficient in the case where there
are no waiting threads.</p>
</div></div><h3 id='impl-2' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockUpgradeDowngrade.html" title="trait lock_api::RawRwLockUpgradeDowngrade">RawRwLockUpgradeDowngrade</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.RwLockUpgradableReadGuard.html" title="struct lock_api::RwLockUpgradableReadGuard">RwLockUpgradableReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-2' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1178-1192' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.downgrade' class="method"><code id='downgrade.v'>pub fn <a href='#method.downgrade' class='fnname'>downgrade</a>(s: Self) -&gt; <a class="struct" href="../lock_api/struct.RwLockReadGuard.html" title="struct lock_api::RwLockReadGuard">RwLockReadGuard</a>&lt;'a, R, T&gt;</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1186-1191' title='goto source code'>[src]</a></h4><div class='docblock'><p>Atomically downgrades an upgradable read lock lock into a shared read lock
without allowing any writers to take exclusive access of the lock in the
meantime.</p>
<p>Note that if there are any writers currently waiting to take the lock
then other readers may not be able to acquire the lock even if it was
downgraded.</p>
</div></div><h3 id='impl-3' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockUpgradeTimed.html" title="trait lock_api::RawRwLockUpgradeTimed">RawRwLockUpgradeTimed</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.RwLockUpgradableReadGuard.html" title="struct lock_api::RwLockUpgradableReadGuard">RwLockUpgradableReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-3' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1194-1231' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.try_upgrade_for' class="method"><code id='try_upgrade_for.v'>pub fn <a href='#method.try_upgrade_for' class='fnname'>try_upgrade_for</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;s: Self, <br>&nbsp;&nbsp;&nbsp;&nbsp;timeout: R::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a><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="struct" href="../lock_api/struct.RwLockWriteGuard.html" title="struct lock_api::RwLockWriteGuard">RwLockWriteGuard</a>&lt;'a, R, T&gt;, Self&gt;</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1200-1211' title='goto source code'>[src]</a></h4><div class='docblock'><p>Tries to atomically upgrade an upgradable read lock into a exclusive
write lock, until a timeout is reached.</p>
<p>If the access could not be granted before the timeout expires, then
the current guard is returned.</p>
</div><h4 id='method.try_upgrade_until' class="method"><code id='try_upgrade_until.v'>pub fn <a href='#method.try_upgrade_until' class='fnname'>try_upgrade_until</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;s: Self, <br>&nbsp;&nbsp;&nbsp;&nbsp;timeout: R::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a><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="struct" href="../lock_api/struct.RwLockWriteGuard.html" title="struct lock_api::RwLockWriteGuard">RwLockWriteGuard</a>&lt;'a, R, T&gt;, Self&gt;</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1219-1230' title='goto source code'>[src]</a></h4><div class='docblock'><p>Tries to atomically upgrade an upgradable read lock into a exclusive
write lock, until a timeout is reached.</p>
<p>If the access could not be granted before the timeout expires, then
the current guard is returned.</p>
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Deref' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockUpgrade.html" title="trait lock_api::RawRwLockUpgrade">RawRwLockUpgrade</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../lock_api/struct.RwLockUpgradableReadGuard.html" title="struct lock_api::RwLockUpgradableReadGuard">RwLockUpgradableReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Deref' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1233-1239' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><code id='Target.t'>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = T</code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
</div><h4 id='method.deref' class="method hidden"><code id='deref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1236-1238' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
</div></div><h3 id='impl-Drop' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockUpgrade.html" title="trait lock_api::RawRwLockUpgrade">RawRwLockUpgrade</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../lock_api/struct.RwLockUpgradableReadGuard.html" title="struct lock_api::RwLockUpgradableReadGuard">RwLockUpgradableReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Drop' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1241-1246' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.drop' class="method hidden"><code id='drop.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&amp;mut self)</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1243-1245' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockUpgrade.html" title="trait lock_api::RawRwLockUpgrade">RawRwLockUpgrade</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../lock_api/struct.RwLockUpgradableReadGuard.html" title="struct lock_api::RwLockUpgradableReadGuard">RwLockUpgradableReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1256-1262' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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><a class='srclink' href='../src/lock_api/rwlock.rs.html#1259-1261' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockUpgrade.html" title="trait lock_api::RawRwLockUpgrade">RawRwLockUpgrade</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + '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="../lock_api/struct.RwLockUpgradableReadGuard.html" title="struct lock_api::RwLockUpgradableReadGuard">RwLockUpgradableReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1248-1254' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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><a class='srclink' href='../src/lock_api/rwlock.rs.html#1251-1253' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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><h3 id='impl-Sync' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockUpgrade.html" title="trait lock_api::RawRwLockUpgrade">RawRwLockUpgrade</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../lock_api/struct.RwLockUpgradableReadGuard.html" title="struct lock_api::RwLockUpgradableReadGuard">RwLockUpgradableReadGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Sync' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1084-1087' title='goto source code'>[src]</a></h3><div class='impl-items'></div></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'><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl&lt;'a, R, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../lock_api/struct.RwLockUpgradableReadGuard.html" title="struct lock_api::RwLockUpgradableReadGuard">RwLockUpgradableReadGuard</a>&lt;'a, R, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;R as <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a>&gt;::<a class="type" href="../lock_api/trait.RawRwLock.html#associatedtype.GuardMarker" title="type lock_api::RawRwLock::GuardMarker">GuardMarker</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl&lt;'a, R, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../lock_api/struct.RwLockUpgradableReadGuard.html" title="struct lock_api::RwLockUpgradableReadGuard">RwLockUpgradableReadGuard</a>&lt;'a, R, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;R as <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a>&gt;::<a class="type" href="../lock_api/trait.RawRwLock.html#associatedtype.GuardMarker" title="type lock_api::RawRwLock::GuardMarker">GuardMarker</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,&nbsp;</span></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#552-554' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#553' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-577' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#574-576' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-548' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -&gt; U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#545-547' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#559-566' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(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;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#563-565' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,64 @@
<!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 `RwLockWriteGuard` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RwLockWriteGuard"><title>lock_api::RwLockWriteGuard - 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 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><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct RwLockWriteGuard</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.bump">bump</a><a href="#method.downgrade">downgrade</a><a href="#method.downgrade_to_upgradable">downgrade_to_upgradable</a><a href="#method.map">map</a><a href="#method.rwlock">rwlock</a><a href="#method.try_map">try_map</a><a href="#method.unlock_fair">unlock_fair</a><a href="#method.unlocked">unlocked</a><a href="#method.unlocked_fair">unlocked_fair</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-DerefMut">DerefMut</a><a href="#impl-Display">Display</a><a href="#impl-Drop">Drop</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Unpin">Unpin</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RwLockWriteGuard', 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"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#891-894' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>RwLockWriteGuard</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'><span class="docblock attributes top-attr">#[must_use = "if unused the RwLock will immediately unlock"]
</span>pub struct RwLockWriteGuard&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; { /* fields omitted */ }</pre></div><div class='docblock'><p>RAII structure used to release the exclusive write access of a lock when
dropped.</p>
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.RwLockWriteGuard.html" title="struct lock_api::RwLockWriteGuard">RwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#898-959' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.rwlock' class="method"><code id='rwlock.v'>pub fn <a href='#method.rwlock' class='fnname'>rwlock</a>(s: &amp;Self) -&gt; &amp;'a <a class="struct" href="../lock_api/struct.RwLock.html" title="struct lock_api::RwLock">RwLock</a>&lt;R, T&gt;</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#900-902' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a reference to the original reader-writer lock object.</p>
</div><h4 id='method.map' class="method"><code id='map.v'>pub fn <a href='#method.map' class='fnname'>map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(s: Self, f: F) -&gt; <a class="struct" href="../lock_api/struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, U&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;mut T) -&gt; &amp;mut U,&nbsp;</span></code><a class='srclink' href='../src/lock_api/rwlock.rs.html#913-921' title='goto source code'>[src]</a></h4><div class='docblock'><p>Make a new <code>MappedRwLockWriteGuard</code> for a component of the locked data.</p>
<p>This operation cannot fail as the <code>RwLockWriteGuard</code> passed
in already locked the data.</p>
<p>This is an associated function that needs to be
used as <code>RwLockWriteGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div><h4 id='method.try_map' class="method"><code id='try_map.v'>pub fn <a href='#method.try_map' class='fnname'>try_map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;s: Self, <br>&nbsp;&nbsp;&nbsp;&nbsp;f: 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;<a class="struct" href="../lock_api/struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, U&gt;, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;mut T) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;mut U&gt;,&nbsp;</span></code><a class='srclink' href='../src/lock_api/rwlock.rs.html#933-944' title='goto source code'>[src]</a></h4><div class='docblock'><p>Attempts to make a new <code>MappedRwLockWriteGuard</code> for a component of the
locked data. The original guard is return if the closure returns <code>None</code>.</p>
<p>This operation cannot fail as the <code>RwLockWriteGuard</code> passed
in already locked the data.</p>
<p>This is an associated function that needs to be
used as <code>RwLockWriteGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div><h4 id='method.unlocked' class="method"><code id='unlocked.v'>pub fn <a href='#method.unlocked' class='fnname'>unlocked</a>&lt;F, U&gt;(s: &amp;mut Self, f: F) -&gt; U <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -&gt; U,&nbsp;</span></code><a class='srclink' href='../src/lock_api/rwlock.rs.html#951-958' title='goto source code'>[src]</a></h4><div class='docblock'><p>Temporarily unlocks the <code>RwLock</code> to execute the given function.</p>
<p>This is safe because <code>&amp;mut</code> guarantees that there exist no other
references to the data protected by the <code>RwLock</code>.</p>
</div></div><h3 id='impl-1' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockDowngrade.html" title="trait lock_api::RawRwLockDowngrade">RawRwLockDowngrade</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.RwLockWriteGuard.html" title="struct lock_api::RwLockWriteGuard">RwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#961-974' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.downgrade' class="method"><code id='downgrade.v'>pub fn <a href='#method.downgrade' class='fnname'>downgrade</a>(s: Self) -&gt; <a class="struct" href="../lock_api/struct.RwLockReadGuard.html" title="struct lock_api::RwLockReadGuard">RwLockReadGuard</a>&lt;'a, R, T&gt;</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#968-973' title='goto source code'>[src]</a></h4><div class='docblock'><p>Atomically downgrades a write lock into a read lock without allowing any
writers to take exclusive access of the lock in the meantime.</p>
<p>Note that if there are any writers currently waiting to take the lock
then other readers may not be able to acquire the lock even if it was
downgraded.</p>
</div></div><h3 id='impl-2' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockUpgradeDowngrade.html" title="trait lock_api::RawRwLockUpgradeDowngrade">RawRwLockUpgradeDowngrade</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.RwLockWriteGuard.html" title="struct lock_api::RwLockWriteGuard">RwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-2' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#976-989' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.downgrade_to_upgradable' class="method"><code id='downgrade_to_upgradable.v'>pub fn <a href='#method.downgrade_to_upgradable' class='fnname'>downgrade_to_upgradable</a>(s: Self) -&gt; <a class="struct" href="../lock_api/struct.RwLockUpgradableReadGuard.html" title="struct lock_api::RwLockUpgradableReadGuard">RwLockUpgradableReadGuard</a>&lt;'a, R, T&gt;</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#983-988' title='goto source code'>[src]</a></h4><div class='docblock'><p>Atomically downgrades a write lock into an upgradable read lock without allowing any
writers to take exclusive access of the lock in the meantime.</p>
<p>Note that if there are any writers currently waiting to take the lock
then other readers may not be able to acquire the lock even if it was
downgraded.</p>
</div></div><h3 id='impl-3' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockFair.html" title="trait lock_api::RawRwLockFair">RawRwLockFair</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="../lock_api/struct.RwLockWriteGuard.html" title="struct lock_api::RwLockWriteGuard">RwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-3' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#991-1035' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.unlock_fair' class="method"><code id='unlock_fair.v'>pub fn <a href='#method.unlock_fair' class='fnname'>unlock_fair</a>(s: Self)</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1005-1008' title='goto source code'>[src]</a></h4><div class='docblock'><p>Unlocks the <code>RwLock</code> using a fair unlock protocol.</p>
<p>By default, <code>RwLock</code> is unfair and allow the current thread to re-lock
the <code>RwLock</code> before another has the chance to acquire the lock, even if
that thread has been blocked on the <code>RwLock</code> for a long time. This is
the default because it allows much higher throughput as it avoids
forcing a context switch on every <code>RwLock</code> unlock. This can result in one
thread acquiring a <code>RwLock</code> many more times than other threads.</p>
<p>However in some cases it can be beneficial to ensure fairness by forcing
the lock to pass on to a waiting thread if there is one. This is done by
using this method instead of dropping the <code>RwLockWriteGuard</code> normally.</p>
</div><h4 id='method.unlocked_fair' class="method"><code id='unlocked_fair.v'>pub fn <a href='#method.unlocked_fair' class='fnname'>unlocked_fair</a>&lt;F, U&gt;(s: &amp;mut Self, f: F) -&gt; U <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -&gt; U,&nbsp;</span></code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1017-1024' title='goto source code'>[src]</a></h4><div class='docblock'><p>Temporarily unlocks the <code>RwLock</code> to execute the given function.</p>
<p>The <code>RwLock</code> is unlocked a fair unlock protocol.</p>
<p>This is safe because <code>&amp;mut</code> guarantees that there exist no other
references to the data protected by the <code>RwLock</code>.</p>
</div><h4 id='method.bump' class="method"><code id='bump.v'>pub fn <a href='#method.bump' class='fnname'>bump</a>(s: &amp;mut Self)</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1032-1034' title='goto source code'>[src]</a></h4><div class='docblock'><p>Temporarily yields the <code>RwLock</code> to a waiting thread if there is one.</p>
<p>This method is functionally equivalent to calling <code>unlock_fair</code> followed
by <code>write</code>, however it can be much more efficient in the case where there
are no waiting threads.</p>
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-DerefMut' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html" title="trait core::ops::deref::DerefMut">DerefMut</a> for <a class="struct" href="../lock_api/struct.RwLockWriteGuard.html" title="struct lock_api::RwLockWriteGuard">RwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-DerefMut' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1045-1050' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deref_mut' class="method hidden"><code id='deref_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html#tymethod.deref_mut' class='fnname'>deref_mut</a>(&amp;mut self) -&gt; &amp;mut T</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1047-1049' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably dereferences the value.</p>
</div></div><h3 id='impl-Deref' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../lock_api/struct.RwLockWriteGuard.html" title="struct lock_api::RwLockWriteGuard">RwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Deref' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1037-1043' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><code id='Target.t'>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = T</code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
</div><h4 id='method.deref' class="method hidden"><code id='deref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1040-1042' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
</div></div><h3 id='impl-Drop' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../lock_api/struct.RwLockWriteGuard.html" title="struct lock_api::RwLockWriteGuard">RwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Drop' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1052-1057' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.drop' class="method hidden"><code id='drop.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&amp;mut self)</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1054-1056' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../lock_api/struct.RwLockWriteGuard.html" title="struct lock_api::RwLockWriteGuard">RwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1065-1071' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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><a class='srclink' href='../src/lock_api/rwlock.rs.html#1068-1070' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + '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="../lock_api/struct.RwLockWriteGuard.html" title="struct lock_api::RwLockWriteGuard">RwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1059-1063' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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><a class='srclink' href='../src/lock_api/rwlock.rs.html#1060-1062' title='goto source code'>[src]</a></h4><div class='docblock hidden'><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><h3 id='impl-Sync' class='impl'><code class='in-band'>impl&lt;'a, R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../lock_api/struct.RwLockWriteGuard.html" title="struct lock_api::RwLockWriteGuard">RwLockWriteGuard</a>&lt;'a, R, T&gt;</code><a href='#impl-Sync' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#896' title='goto source code'>[src]</a></h3><div class='impl-items'></div></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'><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl&lt;'a, R, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../lock_api/struct.RwLockWriteGuard.html" title="struct lock_api::RwLockWriteGuard">RwLockWriteGuard</a>&lt;'a, R, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;R as <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a>&gt;::<a class="type" href="../lock_api/trait.RawRwLock.html#associatedtype.GuardMarker" title="type lock_api::RawRwLock::GuardMarker">GuardMarker</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl&lt;'a, R, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../lock_api/struct.RwLockWriteGuard.html" title="struct lock_api::RwLockWriteGuard">RwLockWriteGuard</a>&lt;'a, R, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;R as <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a>&gt;::<a class="type" href="../lock_api/trait.RawRwLock.html#associatedtype.GuardMarker" title="type lock_api::RawRwLock::GuardMarker">GuardMarker</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,&nbsp;</span></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#552-554' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#553' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-577' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#574-576' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-548' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -&gt; U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#545-547' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#559-566' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(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;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#563-565' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; &amp;T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,20 @@
<!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 `GetThreadId` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, GetThreadId"><title>lock_api::GetThreadId - 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">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait GetThreadId</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-const">Associated Constants</a><div class="sidebar-links"><a href="#associatedconstant.INIT">INIT</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.nonzero_thread_id">nonzero_thread_id</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'GetThreadId', 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 js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/remutex.rs.html#38-45' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>GetThreadId</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait GetThreadId {
const <a href='#associatedconstant.INIT' class="constant"><b>INIT</b></a>: Self;
fn <a href='#tymethod.nonzero_thread_id' class='fnname'>nonzero_thread_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/num/struct.NonZeroUsize.html" title="struct core::num::NonZeroUsize">NonZeroUsize</a>;
}</pre></div><div class='docblock'><p>Helper trait which returns a non-zero thread ID.</p>
<p>The simplest way to implement this trait is to return the address of a
thread-local variable.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>Implementations of this trait must ensure that no two active threads share
the same thread ID. However the ID of a thread that has exited can be
re-used since that thread is no longer active.</p>
</div>
<h2 id='associated-const' class='small-section-header'>Associated Constants<a href='#associated-const' class='anchor'></a></h2><div class='methods'><h3 id='associatedconstant.INIT' class='method'><code id='INIT.v'>const <a href='#associatedconstant.INIT' class="constant"><b>INIT</b></a>: Self</code></h3><div class='docblock'><p>Initial value.</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.nonzero_thread_id' class='method'><code id='nonzero_thread_id.v'>fn <a href='#tymethod.nonzero_thread_id' class='fnname'>nonzero_thread_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/num/struct.NonZeroUsize.html" title="struct core::num::NonZeroUsize">NonZeroUsize</a></code></h3><div class='docblock'><p>Returns a non-zero thread ID which identifies the current thread of
execution.</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'></div><span class='loading-content'>Loading content...</span><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
src="../implementors/lock_api/trait.GetThreadId.js">
</script></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,27 @@
<!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 `RawMutex` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawMutex"><title>lock_api::RawMutex - 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">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawMutex</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.GuardMarker">GuardMarker</a></div><a class="sidebar-title" href="#associated-const">Associated Constants</a><div class="sidebar-links"><a href="#associatedconstant.INIT">INIT</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.lock">lock</a><a href="#tymethod.try_lock">try_lock</a><a href="#tymethod.unlock">unlock</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawMutex', 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 js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/mutex.rs.html#29-45' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawMutex</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawMutex {
type <a href='#associatedtype.GuardMarker' class="type">GuardMarker</a>;
const <a href='#associatedconstant.INIT' class="constant"><b>INIT</b></a>: Self;
fn <a href='#tymethod.lock' class='fnname'>lock</a>(&amp;self);
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock' class='fnname'>try_lock</a>(&amp;self) -&gt; bool;
<div class='item-spacer'></div> fn <a href='#tymethod.unlock' class='fnname'>unlock</a>(&amp;self);
}</pre></div><div class='docblock'><p>Basic operations for a mutex.</p>
<p>Types implementing this trait can be used by <code>Mutex</code> to form a safe and
fully-functioning mutex type.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>Implementations of this trait must ensure that the mutex is actually
exclusive: a lock can't be acquired while the mutex is already locked.</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.GuardMarker' class='method'><code id='GuardMarker.t'>type <a href='#associatedtype.GuardMarker' class="type">GuardMarker</a></code></h3><div class='docblock'><p>Marker type which determines whether a lock guard should be <code>Send</code>. Use
one of the <code>GuardSend</code> or <code>GuardNoSend</code> helper types here.</p>
</div></div><span class='loading-content'>Loading content...</span>
<h2 id='associated-const' class='small-section-header'>Associated Constants<a href='#associated-const' class='anchor'></a></h2><div class='methods'><h3 id='associatedconstant.INIT' class='method'><code id='INIT.v'>const <a href='#associatedconstant.INIT' class="constant"><b>INIT</b></a>: Self</code></h3><div class='docblock'><p>Initial value for an unlocked mutex.</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.lock' class='method'><code id='lock.v'>fn <a href='#tymethod.lock' class='fnname'>lock</a>(&amp;self)</code></h3><div class='docblock'><p>Acquires this mutex, blocking the current thread until it is able to do so.</p>
</div><h3 id='tymethod.try_lock' class='method'><code id='try_lock.v'>fn <a href='#tymethod.try_lock' class='fnname'>try_lock</a>(&amp;self) -&gt; bool</code></h3><div class='docblock'><p>Attempts to acquire this mutex without blocking.</p>
</div><h3 id='tymethod.unlock' class='method'><code id='unlock.v'>fn <a href='#tymethod.unlock' class='fnname'>unlock</a>(&amp;self)</code></h3><div class='docblock'><p>Unlocks this mutex.</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'></div><span class='loading-content'>Loading content...</span><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
src="../implementors/lock_api/trait.RawMutex.js">
</script></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,20 @@
<!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 `RawMutexFair` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawMutexFair"><title>lock_api::RawMutexFair - 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">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawMutexFair</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.unlock_fair">unlock_fair</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.bump">bump</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawMutexFair', 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 js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/mutex.rs.html#53-66' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawMutexFair</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawMutexFair: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> {
fn <a href='#tymethod.unlock_fair' class='fnname'>unlock_fair</a>(&amp;self);
fn <a href='#method.bump' class='fnname'>bump</a>(&amp;self) { ... }
}</pre></div><div class='docblock'><p>Additional methods for mutexes which support fair unlocking.</p>
<p>Fair unlocking means that a lock is handed directly over to the next waiting
thread if there is one, without giving other threads the opportunity to
&quot;steal&quot; the lock in the meantime. This is typically slower than unfair
unlocking, but may be necessary in certain circumstances.</p>
</div>
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.unlock_fair' class='method'><code id='unlock_fair.v'>fn <a href='#tymethod.unlock_fair' class='fnname'>unlock_fair</a>(&amp;self)</code></h3><div class='docblock'><p>Unlocks this mutex using a fair unlock protocol.</p>
</div></div><span class='loading-content'>Loading content...</span>
<h2 id='provided-methods' class='small-section-header'>Provided methods<a href='#provided-methods' class='anchor'></a></h2><div class='methods'><h3 id='method.bump' class='method'><code id='bump.v'>fn <a href='#method.bump' class='fnname'>bump</a>(&amp;self)</code></h3><div class='docblock'><p>Temporarily yields the mutex to a waiting thread if there is one.</p>
<p>This method is functionally equivalent to calling <code>unlock_fair</code> followed
by <code>lock</code>, however it can be much more efficient in the case where there
are no waiting threads.</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'></div><span class='loading-content'>Loading content...</span><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
src="../implementors/lock_api/trait.RawMutexFair.js">
</script></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,18 @@
<!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 `RawMutexTimed` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawMutexTimed"><title>lock_api::RawMutexTimed - 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">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawMutexTimed</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.Duration">Duration</a><a href="#associatedtype.Instant">Instant</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.try_lock_for">try_lock_for</a><a href="#tymethod.try_lock_until">try_lock_until</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawMutexTimed', 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 js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/mutex.rs.html#72-84' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawMutexTimed</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawMutexTimed: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> {
type <a href='#associatedtype.Duration' class="type">Duration</a>;
type <a href='#associatedtype.Instant' class="type">Instant</a>;
fn <a href='#tymethod.try_lock_for' class='fnname'>try_lock_for</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawMutexTimed.html#associatedtype.Duration" title="type lock_api::RawMutexTimed::Duration">Duration</a>) -&gt; bool;
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock_until' class='fnname'>try_lock_until</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawMutexTimed.html#associatedtype.Instant" title="type lock_api::RawMutexTimed::Instant">Instant</a>) -&gt; bool;
}</pre></div><div class='docblock'><p>Additional methods for mutexes which support locking with timeouts.</p>
<p>The <code>Duration</code> and <code>Instant</code> types are specified as associated types so that
this trait is usable even in <code>no_std</code> environments.</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.Duration' class='method'><code id='Duration.t'>type <a href='#associatedtype.Duration' class="type">Duration</a></code></h3><div class='docblock'><p>Duration type used for <code>try_lock_for</code>.</p>
</div><h3 id='associatedtype.Instant' class='method'><code id='Instant.t'>type <a href='#associatedtype.Instant' class="type">Instant</a></code></h3><div class='docblock'><p>Instant type used for <code>try_lock_until</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.try_lock_for' class='method'><code id='try_lock_for.v'>fn <a href='#tymethod.try_lock_for' class='fnname'>try_lock_for</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawMutexTimed.html#associatedtype.Duration" title="type lock_api::RawMutexTimed::Duration">Duration</a>) -&gt; bool</code></h3><div class='docblock'><p>Attempts to acquire this lock until a timeout is reached.</p>
</div><h3 id='tymethod.try_lock_until' class='method'><code id='try_lock_until.v'>fn <a href='#tymethod.try_lock_until' class='fnname'>try_lock_until</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawMutexTimed.html#associatedtype.Instant" title="type lock_api::RawMutexTimed::Instant">Instant</a>) -&gt; bool</code></h3><div class='docblock'><p>Attempts to acquire this lock until a timeout is reached.</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'></div><span class='loading-content'>Loading content...</span><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
src="../implementors/lock_api/trait.RawMutexTimed.js">
</script></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,35 @@
<!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 `RawRwLock` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLock"><title>lock_api::RawRwLock - 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">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawRwLock</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.GuardMarker">GuardMarker</a></div><a class="sidebar-title" href="#associated-const">Associated Constants</a><div class="sidebar-links"><a href="#associatedconstant.INIT">INIT</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.lock_exclusive">lock_exclusive</a><a href="#tymethod.lock_shared">lock_shared</a><a href="#tymethod.try_lock_exclusive">try_lock_exclusive</a><a href="#tymethod.try_lock_shared">try_lock_shared</a><a href="#tymethod.unlock_exclusive">unlock_exclusive</a><a href="#tymethod.unlock_shared">unlock_shared</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawRwLock', 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 js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#31-56' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawRwLock</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawRwLock {
type <a href='#associatedtype.GuardMarker' class="type">GuardMarker</a>;
const <a href='#associatedconstant.INIT' class="constant"><b>INIT</b></a>: Self;
fn <a href='#tymethod.lock_shared' class='fnname'>lock_shared</a>(&amp;self);
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock_shared' class='fnname'>try_lock_shared</a>(&amp;self) -&gt; bool;
<div class='item-spacer'></div> fn <a href='#tymethod.unlock_shared' class='fnname'>unlock_shared</a>(&amp;self);
<div class='item-spacer'></div> fn <a href='#tymethod.lock_exclusive' class='fnname'>lock_exclusive</a>(&amp;self);
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock_exclusive' class='fnname'>try_lock_exclusive</a>(&amp;self) -&gt; bool;
<div class='item-spacer'></div> fn <a href='#tymethod.unlock_exclusive' class='fnname'>unlock_exclusive</a>(&amp;self);
}</pre></div><div class='docblock'><p>Basic operations for a reader-writer lock.</p>
<p>Types implementing this trait can be used by <code>RwLock</code> to form a safe and
fully-functioning <code>RwLock</code> type.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>Implementations of this trait must ensure that the <code>RwLock</code> is actually
exclusive: an exclusive lock can't be acquired while an exclusive or shared
lock exists, and a shared lock can't be acquire while an exclusive lock
exists.</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.GuardMarker' class='method'><code id='GuardMarker.t'>type <a href='#associatedtype.GuardMarker' class="type">GuardMarker</a></code></h3><div class='docblock'><p>Marker type which determines whether a lock guard should be <code>Send</code>. Use
one of the <code>GuardSend</code> or <code>GuardNoSend</code> helper types here.</p>
</div></div><span class='loading-content'>Loading content...</span>
<h2 id='associated-const' class='small-section-header'>Associated Constants<a href='#associated-const' class='anchor'></a></h2><div class='methods'><h3 id='associatedconstant.INIT' class='method'><code id='INIT.v'>const <a href='#associatedconstant.INIT' class="constant"><b>INIT</b></a>: Self</code></h3><div class='docblock'><p>Initial value for an unlocked <code>RwLock</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.lock_shared' class='method'><code id='lock_shared.v'>fn <a href='#tymethod.lock_shared' class='fnname'>lock_shared</a>(&amp;self)</code></h3><div class='docblock'><p>Acquires a shared lock, blocking the current thread until it is able to do so.</p>
</div><h3 id='tymethod.try_lock_shared' class='method'><code id='try_lock_shared.v'>fn <a href='#tymethod.try_lock_shared' class='fnname'>try_lock_shared</a>(&amp;self) -&gt; bool</code></h3><div class='docblock'><p>Attempts to acquire a shared lock without blocking.</p>
</div><h3 id='tymethod.unlock_shared' class='method'><code id='unlock_shared.v'>fn <a href='#tymethod.unlock_shared' class='fnname'>unlock_shared</a>(&amp;self)</code></h3><div class='docblock'><p>Releases a shared lock.</p>
</div><h3 id='tymethod.lock_exclusive' class='method'><code id='lock_exclusive.v'>fn <a href='#tymethod.lock_exclusive' class='fnname'>lock_exclusive</a>(&amp;self)</code></h3><div class='docblock'><p>Acquires an exclusive lock, blocking the current thread until it is able to do so.</p>
</div><h3 id='tymethod.try_lock_exclusive' class='method'><code id='try_lock_exclusive.v'>fn <a href='#tymethod.try_lock_exclusive' class='fnname'>try_lock_exclusive</a>(&amp;self) -&gt; bool</code></h3><div class='docblock'><p>Attempts to acquire an exclusive lock without blocking.</p>
</div><h3 id='tymethod.unlock_exclusive' class='method'><code id='unlock_exclusive.v'>fn <a href='#tymethod.unlock_exclusive' class='fnname'>unlock_exclusive</a>(&amp;self)</code></h3><div class='docblock'><p>Releases an exclusive lock.</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'></div><span class='loading-content'>Loading content...</span><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
src="../implementors/lock_api/trait.RawRwLock.js">
</script></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,11 @@
<!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 `RawRwLockDowngrade` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockDowngrade"><title>lock_api::RawRwLockDowngrade - 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">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawRwLockDowngrade</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.downgrade">downgrade</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawRwLockDowngrade', 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 js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#94-98' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawRwLockDowngrade</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawRwLockDowngrade: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> {
fn <a href='#tymethod.downgrade' class='fnname'>downgrade</a>(&amp;self);
}</pre></div><div class='docblock'><p>Additional methods for RwLocks which support atomically downgrading an
exclusive lock to a shared lock.</p>
</div>
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.downgrade' class='method'><code id='downgrade.v'>fn <a href='#tymethod.downgrade' class='fnname'>downgrade</a>(&amp;self)</code></h3><div class='docblock'><p>Atomically downgrades an exclusive lock into a shared lock without
allowing any thread to take an exclusive lock in the meantime.</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'></div><span class='loading-content'>Loading content...</span><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
src="../implementors/lock_api/trait.RawRwLockDowngrade.js">
</script></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,27 @@
<!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 `RawRwLockFair` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockFair"><title>lock_api::RawRwLockFair - 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">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawRwLockFair</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.unlock_exclusive_fair">unlock_exclusive_fair</a><a href="#tymethod.unlock_shared_fair">unlock_shared_fair</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.bump_exclusive">bump_exclusive</a><a href="#method.bump_shared">bump_shared</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawRwLockFair', 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 js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#64-90' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawRwLockFair</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawRwLockFair: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> {
fn <a href='#tymethod.unlock_shared_fair' class='fnname'>unlock_shared_fair</a>(&amp;self);
<div class='item-spacer'></div> fn <a href='#tymethod.unlock_exclusive_fair' class='fnname'>unlock_exclusive_fair</a>(&amp;self);
fn <a href='#method.bump_shared' class='fnname'>bump_shared</a>(&amp;self) { ... }
<div class='item-spacer'></div> fn <a href='#method.bump_exclusive' class='fnname'>bump_exclusive</a>(&amp;self) { ... }
}</pre></div><div class='docblock'><p>Additional methods for RwLocks which support fair unlocking.</p>
<p>Fair unlocking means that a lock is handed directly over to the next waiting
thread if there is one, without giving other threads the opportunity to
&quot;steal&quot; the lock in the meantime. This is typically slower than unfair
unlocking, but may be necessary in certain circumstances.</p>
</div>
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.unlock_shared_fair' class='method'><code id='unlock_shared_fair.v'>fn <a href='#tymethod.unlock_shared_fair' class='fnname'>unlock_shared_fair</a>(&amp;self)</code></h3><div class='docblock'><p>Releases a shared lock using a fair unlock protocol.</p>
</div><h3 id='tymethod.unlock_exclusive_fair' class='method'><code id='unlock_exclusive_fair.v'>fn <a href='#tymethod.unlock_exclusive_fair' class='fnname'>unlock_exclusive_fair</a>(&amp;self)</code></h3><div class='docblock'><p>Releases an exclusive lock using a fair unlock protocol.</p>
</div></div><span class='loading-content'>Loading content...</span>
<h2 id='provided-methods' class='small-section-header'>Provided methods<a href='#provided-methods' class='anchor'></a></h2><div class='methods'><h3 id='method.bump_shared' class='method'><code id='bump_shared.v'>fn <a href='#method.bump_shared' class='fnname'>bump_shared</a>(&amp;self)</code></h3><div class='docblock'><p>Temporarily yields a shared lock to a waiting thread if there is one.</p>
<p>This method is functionally equivalent to calling <code>unlock_shared_fair</code> followed
by <code>lock_shared</code>, however it can be much more efficient in the case where there
are no waiting threads.</p>
</div><h3 id='method.bump_exclusive' class='method'><code id='bump_exclusive.v'>fn <a href='#method.bump_exclusive' class='fnname'>bump_exclusive</a>(&amp;self)</code></h3><div class='docblock'><p>Temporarily yields an exclusive lock to a waiting thread if there is one.</p>
<p>This method is functionally equivalent to calling <code>unlock_exclusive_fair</code> followed
by <code>lock_exclusive</code>, however it can be much more efficient in the case where there
are no waiting threads.</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'></div><span class='loading-content'>Loading content...</span><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
src="../implementors/lock_api/trait.RawRwLockFair.js">
</script></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,16 @@
<!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 `RawRwLockRecursive` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockRecursive"><title>lock_api::RawRwLockRecursive - 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">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawRwLockRecursive</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.lock_shared_recursive">lock_shared_recursive</a><a href="#tymethod.try_lock_shared_recursive">try_lock_shared_recursive</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawRwLockRecursive', 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 js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#131-137' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawRwLockRecursive</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawRwLockRecursive: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> {
fn <a href='#tymethod.lock_shared_recursive' class='fnname'>lock_shared_recursive</a>(&amp;self);
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock_shared_recursive' class='fnname'>try_lock_shared_recursive</a>(&amp;self) -&gt; bool;
}</pre></div><div class='docblock'><p>Additional methods for RwLocks which support recursive read locks.</p>
<p>These are guaranteed to succeed without blocking if
another read lock is held at the time of the call. This allows a thread
to recursively lock a <code>RwLock</code>. However using this method can cause
writers to starve since readers no longer block if a writer is waiting
for the lock.</p>
</div>
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.lock_shared_recursive' class='method'><code id='lock_shared_recursive.v'>fn <a href='#tymethod.lock_shared_recursive' class='fnname'>lock_shared_recursive</a>(&amp;self)</code></h3><div class='docblock'><p>Acquires a shared lock without deadlocking in case of a recursive lock.</p>
</div><h3 id='tymethod.try_lock_shared_recursive' class='method'><code id='try_lock_shared_recursive.v'>fn <a href='#tymethod.try_lock_shared_recursive' class='fnname'>try_lock_shared_recursive</a>(&amp;self) -&gt; bool</code></h3><div class='docblock'><p>Attempts to acquire a shared lock without deadlocking in case of a recursive lock.</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'></div><span class='loading-content'>Loading content...</span><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
src="../implementors/lock_api/trait.RawRwLockRecursive.js">
</script></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,13 @@
<!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 `RawRwLockRecursiveTimed` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockRecursiveTimed"><title>lock_api::RawRwLockRecursiveTimed - 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">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawRwLockRecursiveTimed</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.try_lock_shared_recursive_for">try_lock_shared_recursive_for</a><a href="#tymethod.try_lock_shared_recursive_until">try_lock_shared_recursive_until</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawRwLockRecursiveTimed', 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 js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#140-148' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawRwLockRecursiveTimed</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawRwLockRecursiveTimed: <a class="trait" href="../lock_api/trait.RawRwLockRecursive.html" title="trait lock_api::RawRwLockRecursive">RawRwLockRecursive</a> + <a class="trait" href="../lock_api/trait.RawRwLockTimed.html" title="trait lock_api::RawRwLockTimed">RawRwLockTimed</a> {
fn <a href='#tymethod.try_lock_shared_recursive_for' class='fnname'>try_lock_shared_recursive_for</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -&gt; bool;
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock_shared_recursive_until' class='fnname'>try_lock_shared_recursive_until</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -&gt; bool;
}</pre></div><div class='docblock'><p>Additional methods for RwLocks which support recursive read locks and timeouts.</p>
</div>
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.try_lock_shared_recursive_for' class='method'><code id='try_lock_shared_recursive_for.v'>fn <a href='#tymethod.try_lock_shared_recursive_for' class='fnname'>try_lock_shared_recursive_for</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -&gt; bool</code></h3><div class='docblock'><p>Attempts to acquire a shared lock until a timeout is reached, without
deadlocking in case of a recursive lock.</p>
</div><h3 id='tymethod.try_lock_shared_recursive_until' class='method'><code id='try_lock_shared_recursive_until.v'>fn <a href='#tymethod.try_lock_shared_recursive_until' class='fnname'>try_lock_shared_recursive_until</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -&gt; bool</code></h3><div class='docblock'><p>Attempts to acquire a shared lock until a timeout is reached, without
deadlocking in case of a recursive lock.</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'></div><span class='loading-content'>Loading content...</span><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
src="../implementors/lock_api/trait.RawRwLockRecursiveTimed.js">
</script></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,22 @@
<!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 `RawRwLockTimed` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockTimed"><title>lock_api::RawRwLockTimed - 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">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawRwLockTimed</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.Duration">Duration</a><a href="#associatedtype.Instant">Instant</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.try_lock_exclusive_for">try_lock_exclusive_for</a><a href="#tymethod.try_lock_exclusive_until">try_lock_exclusive_until</a><a href="#tymethod.try_lock_shared_for">try_lock_shared_for</a><a href="#tymethod.try_lock_shared_until">try_lock_shared_until</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawRwLockTimed', 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 js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#104-122' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawRwLockTimed</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawRwLockTimed: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> {
type <a href='#associatedtype.Duration' class="type">Duration</a>;
type <a href='#associatedtype.Instant' class="type">Instant</a>;
fn <a href='#tymethod.try_lock_shared_for' class='fnname'>try_lock_shared_for</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -&gt; bool;
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock_shared_until' class='fnname'>try_lock_shared_until</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -&gt; bool;
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock_exclusive_for' class='fnname'>try_lock_exclusive_for</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -&gt; bool;
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock_exclusive_until' class='fnname'>try_lock_exclusive_until</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -&gt; bool;
}</pre></div><div class='docblock'><p>Additional methods for RwLocks which support locking with timeouts.</p>
<p>The <code>Duration</code> and <code>Instant</code> types are specified as associated types so that
this trait is usable even in <code>no_std</code> environments.</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.Duration' class='method'><code id='Duration.t'>type <a href='#associatedtype.Duration' class="type">Duration</a></code></h3><div class='docblock'><p>Duration type used for <code>try_lock_for</code>.</p>
</div><h3 id='associatedtype.Instant' class='method'><code id='Instant.t'>type <a href='#associatedtype.Instant' class="type">Instant</a></code></h3><div class='docblock'><p>Instant type used for <code>try_lock_until</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.try_lock_shared_for' class='method'><code id='try_lock_shared_for.v'>fn <a href='#tymethod.try_lock_shared_for' class='fnname'>try_lock_shared_for</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -&gt; bool</code></h3><div class='docblock'><p>Attempts to acquire a shared lock until a timeout is reached.</p>
</div><h3 id='tymethod.try_lock_shared_until' class='method'><code id='try_lock_shared_until.v'>fn <a href='#tymethod.try_lock_shared_until' class='fnname'>try_lock_shared_until</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -&gt; bool</code></h3><div class='docblock'><p>Attempts to acquire a shared lock until a timeout is reached.</p>
</div><h3 id='tymethod.try_lock_exclusive_for' class='method'><code id='try_lock_exclusive_for.v'>fn <a href='#tymethod.try_lock_exclusive_for' class='fnname'>try_lock_exclusive_for</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -&gt; bool</code></h3><div class='docblock'><p>Attempts to acquire an exclusive lock until a timeout is reached.</p>
</div><h3 id='tymethod.try_lock_exclusive_until' class='method'><code id='try_lock_exclusive_until.v'>fn <a href='#tymethod.try_lock_exclusive_until' class='fnname'>try_lock_exclusive_until</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -&gt; bool</code></h3><div class='docblock'><p>Attempts to acquire an exclusive lock until a timeout is reached.</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'></div><span class='loading-content'>Loading content...</span><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
src="../implementors/lock_api/trait.RawRwLockTimed.js">
</script></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,22 @@
<!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 `RawRwLockUpgrade` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockUpgrade"><title>lock_api::RawRwLockUpgrade - 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">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawRwLockUpgrade</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.lock_upgradable">lock_upgradable</a><a href="#tymethod.try_lock_upgradable">try_lock_upgradable</a><a href="#tymethod.try_upgrade">try_upgrade</a><a href="#tymethod.unlock_upgradable">unlock_upgradable</a><a href="#tymethod.upgrade">upgrade</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawRwLockUpgrade', 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 js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#156-172' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawRwLockUpgrade</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawRwLockUpgrade: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> {
fn <a href='#tymethod.lock_upgradable' class='fnname'>lock_upgradable</a>(&amp;self);
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock_upgradable' class='fnname'>try_lock_upgradable</a>(&amp;self) -&gt; bool;
<div class='item-spacer'></div> fn <a href='#tymethod.unlock_upgradable' class='fnname'>unlock_upgradable</a>(&amp;self);
<div class='item-spacer'></div> fn <a href='#tymethod.upgrade' class='fnname'>upgrade</a>(&amp;self);
<div class='item-spacer'></div> fn <a href='#tymethod.try_upgrade' class='fnname'>try_upgrade</a>(&amp;self) -&gt; bool;
}</pre></div><div class='docblock'><p>Additional methods for RwLocks which support atomically upgrading a shared
lock to an exclusive lock.</p>
<p>This requires acquiring a special &quot;upgradable read lock&quot; instead of a
normal shared lock. There may only be one upgradable lock at any time,
otherwise deadlocks could occur when upgrading.</p>
</div>
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.lock_upgradable' class='method'><code id='lock_upgradable.v'>fn <a href='#tymethod.lock_upgradable' class='fnname'>lock_upgradable</a>(&amp;self)</code></h3><div class='docblock'><p>Acquires an upgradable lock, blocking the current thread until it is able to do so.</p>
</div><h3 id='tymethod.try_lock_upgradable' class='method'><code id='try_lock_upgradable.v'>fn <a href='#tymethod.try_lock_upgradable' class='fnname'>try_lock_upgradable</a>(&amp;self) -&gt; bool</code></h3><div class='docblock'><p>Attempts to acquire an upgradable lock without blocking.</p>
</div><h3 id='tymethod.unlock_upgradable' class='method'><code id='unlock_upgradable.v'>fn <a href='#tymethod.unlock_upgradable' class='fnname'>unlock_upgradable</a>(&amp;self)</code></h3><div class='docblock'><p>Releases an upgradable lock.</p>
</div><h3 id='tymethod.upgrade' class='method'><code id='upgrade.v'>fn <a href='#tymethod.upgrade' class='fnname'>upgrade</a>(&amp;self)</code></h3><div class='docblock'><p>Upgrades an upgradable lock to an exclusive lock.</p>
</div><h3 id='tymethod.try_upgrade' class='method'><code id='try_upgrade.v'>fn <a href='#tymethod.try_upgrade' class='fnname'>try_upgrade</a>(&amp;self) -&gt; bool</code></h3><div class='docblock'><p>Attempts to upgrade an upgradable lock to an exclusive lock without
blocking.</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'></div><span class='loading-content'>Loading content...</span><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
src="../implementors/lock_api/trait.RawRwLockUpgrade.js">
</script></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,12 @@
<!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 `RawRwLockUpgradeDowngrade` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockUpgradeDowngrade"><title>lock_api::RawRwLockUpgradeDowngrade - 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">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawRwLockUpgradeDowngrade</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.downgrade_to_upgradable">downgrade_to_upgradable</a><a href="#tymethod.downgrade_upgradable">downgrade_upgradable</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawRwLockUpgradeDowngrade', 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 js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#193-199' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawRwLockUpgradeDowngrade</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawRwLockUpgradeDowngrade: <a class="trait" href="../lock_api/trait.RawRwLockUpgrade.html" title="trait lock_api::RawRwLockUpgrade">RawRwLockUpgrade</a> + <a class="trait" href="../lock_api/trait.RawRwLockDowngrade.html" title="trait lock_api::RawRwLockDowngrade">RawRwLockDowngrade</a> {
fn <a href='#tymethod.downgrade_upgradable' class='fnname'>downgrade_upgradable</a>(&amp;self);
<div class='item-spacer'></div> fn <a href='#tymethod.downgrade_to_upgradable' class='fnname'>downgrade_to_upgradable</a>(&amp;self);
}</pre></div><div class='docblock'><p>Additional methods for RwLocks which support upgradable locks and lock
downgrading.</p>
</div>
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.downgrade_upgradable' class='method'><code id='downgrade_upgradable.v'>fn <a href='#tymethod.downgrade_upgradable' class='fnname'>downgrade_upgradable</a>(&amp;self)</code></h3><div class='docblock'><p>Downgrades an upgradable lock to a shared lock.</p>
</div><h3 id='tymethod.downgrade_to_upgradable' class='method'><code id='downgrade_to_upgradable.v'>fn <a href='#tymethod.downgrade_to_upgradable' class='fnname'>downgrade_to_upgradable</a>(&amp;self)</code></h3><div class='docblock'><p>Downgrades an exclusive lock to an upgradable lock.</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'></div><span class='loading-content'>Loading content...</span><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
src="../implementors/lock_api/trait.RawRwLockUpgradeDowngrade.js">
</script></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,17 @@
<!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 `RawRwLockUpgradeFair` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockUpgradeFair"><title>lock_api::RawRwLockUpgradeFair - 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">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawRwLockUpgradeFair</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.unlock_upgradable_fair">unlock_upgradable_fair</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.bump_upgradable">bump_upgradable</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawRwLockUpgradeFair', 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 js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#176-189' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawRwLockUpgradeFair</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawRwLockUpgradeFair: <a class="trait" href="../lock_api/trait.RawRwLockUpgrade.html" title="trait lock_api::RawRwLockUpgrade">RawRwLockUpgrade</a> + <a class="trait" href="../lock_api/trait.RawRwLockFair.html" title="trait lock_api::RawRwLockFair">RawRwLockFair</a> {
fn <a href='#tymethod.unlock_upgradable_fair' class='fnname'>unlock_upgradable_fair</a>(&amp;self);
fn <a href='#method.bump_upgradable' class='fnname'>bump_upgradable</a>(&amp;self) { ... }
}</pre></div><div class='docblock'><p>Additional methods for RwLocks which support upgradable locks and fair
unlocking.</p>
</div>
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.unlock_upgradable_fair' class='method'><code id='unlock_upgradable_fair.v'>fn <a href='#tymethod.unlock_upgradable_fair' class='fnname'>unlock_upgradable_fair</a>(&amp;self)</code></h3><div class='docblock'><p>Releases an upgradable lock using a fair unlock protocol.</p>
</div></div><span class='loading-content'>Loading content...</span>
<h2 id='provided-methods' class='small-section-header'>Provided methods<a href='#provided-methods' class='anchor'></a></h2><div class='methods'><h3 id='method.bump_upgradable' class='method'><code id='bump_upgradable.v'>fn <a href='#method.bump_upgradable' class='fnname'>bump_upgradable</a>(&amp;self)</code></h3><div class='docblock'><p>Temporarily yields an upgradable lock to a waiting thread if there is one.</p>
<p>This method is functionally equivalent to calling <code>unlock_upgradable_fair</code> followed
by <code>lock_upgradable</code>, however it can be much more efficient in the case where there
are no waiting threads.</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'></div><span class='loading-content'>Loading content...</span><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
src="../implementors/lock_api/trait.RawRwLockUpgradeFair.js">
</script></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

View File

@ -0,0 +1,18 @@
<!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 `RawRwLockUpgradeTimed` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockUpgradeTimed"><title>lock_api::RawRwLockUpgradeTimed - 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">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawRwLockUpgradeTimed</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.try_lock_upgradable_for">try_lock_upgradable_for</a><a href="#tymethod.try_lock_upgradable_until">try_lock_upgradable_until</a><a href="#tymethod.try_upgrade_for">try_upgrade_for</a><a href="#tymethod.try_upgrade_until">try_upgrade_until</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawRwLockUpgradeTimed', 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 js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" 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'>&#x2212;</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#203-217' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawRwLockUpgradeTimed</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawRwLockUpgradeTimed: <a class="trait" href="../lock_api/trait.RawRwLockUpgrade.html" title="trait lock_api::RawRwLockUpgrade">RawRwLockUpgrade</a> + <a class="trait" href="../lock_api/trait.RawRwLockTimed.html" title="trait lock_api::RawRwLockTimed">RawRwLockTimed</a> {
fn <a href='#tymethod.try_lock_upgradable_for' class='fnname'>try_lock_upgradable_for</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -&gt; bool;
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock_upgradable_until' class='fnname'>try_lock_upgradable_until</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -&gt; bool;
<div class='item-spacer'></div> fn <a href='#tymethod.try_upgrade_for' class='fnname'>try_upgrade_for</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -&gt; bool;
<div class='item-spacer'></div> fn <a href='#tymethod.try_upgrade_until' class='fnname'>try_upgrade_until</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -&gt; bool;
}</pre></div><div class='docblock'><p>Additional methods for RwLocks which support upgradable locks and locking
with timeouts.</p>
</div>
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.try_lock_upgradable_for' class='method'><code id='try_lock_upgradable_for.v'>fn <a href='#tymethod.try_lock_upgradable_for' class='fnname'>try_lock_upgradable_for</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -&gt; bool</code></h3><div class='docblock'><p>Attempts to acquire an upgradable lock until a timeout is reached.</p>
</div><h3 id='tymethod.try_lock_upgradable_until' class='method'><code id='try_lock_upgradable_until.v'>fn <a href='#tymethod.try_lock_upgradable_until' class='fnname'>try_lock_upgradable_until</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -&gt; bool</code></h3><div class='docblock'><p>Attempts to acquire an upgradable lock until a timeout is reached.</p>
</div><h3 id='tymethod.try_upgrade_for' class='method'><code id='try_upgrade_for.v'>fn <a href='#tymethod.try_upgrade_for' class='fnname'>try_upgrade_for</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -&gt; bool</code></h3><div class='docblock'><p>Attempts to upgrade an upgradable lock to an exclusive lock until a
timeout is reached.</p>
</div><h3 id='tymethod.try_upgrade_until' class='method'><code id='try_upgrade_until.v'>fn <a href='#tymethod.try_upgrade_until' class='fnname'>try_upgrade_until</a>(&amp;self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -&gt; bool</code></h3><div class='docblock'><p>Attempts to upgrade an upgradable lock to an exclusive lock until a
timeout is reached.</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'></div><span class='loading-content'>Loading content...</span><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
src="../implementors/lock_api/trait.RawRwLockUpgradeTimed.js">
</script></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><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>