Auto Generated Documentation

This commit is contained in:
github-actions[bot]
2021-06-02 05:29:43 +00:00
parent 01775d8dee
commit c1a51a3934
14224 changed files with 345643 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
<!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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate lock_api</p><div class="block version"><p>Version 0.4.4</p></div><a id="all-types" href="index.html"><p>Back to index</p></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">List of all items</span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span>
</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.RawReentrantMutex.html">RawReentrantMutex</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><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
+122
View File
@@ -0,0 +1,122 @@
<!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="This library provides type-safe and fully-featured `Mutex` and `RwLock` 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."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate lock_api</p><div class="block version"><p>Version 0.4.4</p></div><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><div id="sidebar-vars" data-name="lock_api" data-ty="mod" data-relpath="../"></div></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="">lock_api</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/lib.rs.html#8-111" title="goto source code">[src]</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">compare_exchange</span>(<span class="bool-val">false</span>, <span class="bool-val">true</span>, <span class="ident">Ordering</span>::<span class="ident">Acquire</span>, <span class="ident">Ordering</span>::<span class="ident">Relaxed</span>)
.<span class="ident">is_ok</span>()
}
<span class="kw">unsafe</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 “scoped lock” 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.RawReentrantMutex.html" title="lock_api::RawReentrantMutex struct">RawReentrantMutex</a></td><td class="docblock-short"><p>A raw mutex type that wraps another raw mutex to provide reentrancy.</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 “scoped lock” 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><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
@@ -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>
+10
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>
@@ -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>
+10
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>
@@ -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>
@@ -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>
@@ -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>
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.RawReentrantMutex.html">
</head>
<body>
<p>Redirecting to <a href="../../lock_api/struct.RawReentrantMutex.html">../../lock_api/struct.RawReentrantMutex.html</a>...</p>
<script>location.replace("../../lock_api/struct.RawReentrantMutex.html" + location.search + location.hash);</script>
</body>
</html>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
+10
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>
@@ -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>
@@ -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>
@@ -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>
+10
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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
+1
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."],["RawReentrantMutex","A raw mutex type that wraps another raw mutex to provide reentrancy."],["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."]]});
+15
View File
@@ -0,0 +1,15 @@
<!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="Marker type which indicates that the Guard type for a lock is not `Send`."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><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><div id="sidebar-vars" data-name="GuardNoSend" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">lock_api</a>::<wbr><a class="struct" href="">GuardNoSend</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/lib.rs.html#100" title="goto source code">[src]</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="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><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><a class="srclink" href="../src/lock_api/lib.rs.html#102" 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-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-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></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-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#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub 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#132" 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><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#208-213" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#210" 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#216-220" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#217" 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-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/mod.rs.html#544-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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/mod.rs.html#545" 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/mod.rs.html#533-540" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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/mod.rs.html#537" 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/mod.rs.html#581-590" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>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>pub 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/mod.rs.html#587" 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/mod.rs.html#567-576" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>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>pub 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/mod.rs.html#573" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
+15
View File
@@ -0,0 +1,15 @@
<!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="Marker type which indicates that the Guard type for a lock is `Send`."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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><div id="sidebar-vars" data-name="GuardSend" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">lock_api</a>::<wbr><a class="struct" href="">GuardSend</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/lib.rs.html#97" title="goto source code">[src]</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-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><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></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-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#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub 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#132" 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><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#208-213" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#210" 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#216-220" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#217" 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-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/mod.rs.html#544-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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/mod.rs.html#545" 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/mod.rs.html#533-540" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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/mod.rs.html#537" 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/mod.rs.html#581-590" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>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>pub 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/mod.rs.html#587" 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/mod.rs.html#567-576" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>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>pub 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/mod.rs.html#573" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
@@ -0,0 +1,49 @@
<!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="An RAII mutex guard returned by `MutexGuard::map`, which can point to a subfield of the protected data."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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="#implementations">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="#trait-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><div id="sidebar-vars" data-name="MappedMutexGuard" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">lock_api</a>::<wbr><a class="struct" href="">MappedMutexGuard</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/mutex.rs.html#594-598" title="goto source code">[src]</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 doesnt 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="implementations" class="small-section-header">Implementations<a href="#implementations" 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#609-659" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.map" class="method"><code>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#619-631" 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>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#643-658" 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 returned 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::try_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#661-682" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.unlock_fair" class="method"><code>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#675-681" 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="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><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#709-713" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>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>&lt;'_&gt;) -&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#710-712" 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-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#684-690" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Target" class="type"><code>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>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#687-689" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
</div></div><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#692-697" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.deref_mut" class="method hidden"><code>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#694-696" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably dereferences the value.</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#715-721" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>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>&lt;'_&gt;) -&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#718-720" 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-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#699-707" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.drop" class="method hidden"><code>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#701-706" 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-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 class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</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#604-607" 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#600-603" 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-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#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub 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#132" 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><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#208-213" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#210" 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#216-220" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#217" 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-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/mod.rs.html#544-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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/mod.rs.html#545" 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/mod.rs.html#533-540" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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/mod.rs.html#537" 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/mod.rs.html#581-590" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>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>pub 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/mod.rs.html#587" 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/mod.rs.html#567-576" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>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>pub 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/mod.rs.html#573" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
@@ -0,0 +1,48 @@
<!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="An RAII mutex guard returned by `ReentrantMutexGuard::map`, which can point to a subfield of the protected data."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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="#implementations">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="#trait-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><div id="sidebar-vars" data-name="MappedReentrantMutexGuard" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">lock_api</a>::<wbr><a class="struct" href="">MappedReentrantMutexGuard</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/remutex.rs.html#717-721" title="goto source code">[src]</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 doesnt 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="implementations" class="small-section-header">Implementations<a href="#implementations" 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#728-783" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.map" class="method"><code>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#740-752" 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>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#764-782" 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#785-808" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.unlock_fair" class="method"><code>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#801-807" 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="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><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#832-838" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>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>&lt;'_&gt;) -&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#835-837" 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-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#810-818" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Target" class="type"><code>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>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#815-817" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</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#840-846" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>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>&lt;'_&gt;) -&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#843-845" 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-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#820-830" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.drop" class="method hidden"><code>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#824-829" 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-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#723-726" 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-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><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></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-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#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub 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#132" 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><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#208-213" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#210" 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#216-220" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#217" 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-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/mod.rs.html#544-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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/mod.rs.html#545" 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/mod.rs.html#533-540" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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/mod.rs.html#537" 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/mod.rs.html#581-590" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>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>pub 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/mod.rs.html#587" 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/mod.rs.html#567-576" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>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>pub 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/mod.rs.html#573" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
@@ -0,0 +1,48 @@
<!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="An RAII read lock guard returned by `RwLockReadGuard::map`, which can point to a subfield of the protected data."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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="#implementations">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="#trait-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><div id="sidebar-vars" data-name="MappedRwLockReadGuard" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">lock_api</a>::<wbr><a class="struct" href="">MappedRwLockReadGuard</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#1506-1510" title="goto source code">[src]</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 doesnt 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="implementations" class="small-section-header">Implementations<a href="#implementations" 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#1518-1568" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.map" class="method"><code>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#1528-1540" 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>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#1552-1567" 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#1570-1591" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.unlock_fair" class="method"><code>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#1584-1590" 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="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><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#1611-1617" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>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>&lt;'_&gt;) -&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#1614-1616" 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-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#1593-1599" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Target" class="type"><code>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>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#1596-1598" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</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#1619-1625" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>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>&lt;'_&gt;) -&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#1622-1624" 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-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#1601-1609" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.drop" class="method hidden"><code>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#1603-1608" 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-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 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.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#1513-1516" 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#1512" 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-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#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub 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#132" 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><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#208-213" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#210" 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#216-220" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#217" 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-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/mod.rs.html#544-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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/mod.rs.html#545" 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/mod.rs.html#533-540" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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/mod.rs.html#537" 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/mod.rs.html#581-590" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>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>pub 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/mod.rs.html#587" 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/mod.rs.html#567-576" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>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>pub 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/mod.rs.html#573" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
@@ -0,0 +1,49 @@
<!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="An RAII write lock guard returned by `RwLockWriteGuard::map`, which can point to a subfield of the protected data."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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="#implementations">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="#trait-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><div id="sidebar-vars" data-name="MappedRwLockWriteGuard" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">lock_api</a>::<wbr><a class="struct" href="">MappedRwLockWriteGuard</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#1641-1645" title="goto source code">[src]</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 doesnt 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="implementations" class="small-section-header">Implementations<a href="#implementations" 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#1656-1706" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.map" class="method"><code>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#1666-1678" 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>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#1690-1705" 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.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-1" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1708-1729" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.unlock_fair" class="method"><code>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#1722-1728" 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="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><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#1756-1762" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>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>&lt;'_&gt;) -&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#1759-1761" 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-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#1731-1737" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Target" class="type"><code>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>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#1734-1736" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
</div></div><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#1739-1744" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.deref_mut" class="method hidden"><code>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#1741-1743" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably dereferences the value.</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#1764-1770" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>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>&lt;'_&gt;) -&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#1767-1769" 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-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#1746-1754" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.drop" class="method hidden"><code>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#1748-1753" 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-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 class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</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#1651-1654" 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#1647-1650" 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-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#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub 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#132" 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><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#208-213" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#210" 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#216-220" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#217" 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-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/mod.rs.html#544-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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/mod.rs.html#545" 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/mod.rs.html#533-540" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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/mod.rs.html#537" 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/mod.rs.html#581-590" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>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>pub 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/mod.rs.html#587" 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/mod.rs.html#567-576" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>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>pub 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/mod.rs.html#573" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
+83
View File
@@ -0,0 +1,83 @@
<!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="A mutual exclusion primitive useful for protecting shared data"><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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="#implementations">Methods</a><div class="sidebar-links"><a href="#method.const_new">const_new</a><a href="#method.data_ptr">data_ptr</a><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.is_locked">is_locked</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="#trait-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%3C!%3E">From&lt;!&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><div id="sidebar-vars" data-name="Mutex" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">lock_api</a>::<wbr><a class="struct" href="">Mutex</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/mutex.rs.html#135-138" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Mutex&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; { /* 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="implementations" class="small-section-header">Implementations<a href="#implementations" 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#143-169" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.new" class="method"><code>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#157-162" 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>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#166-168" 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, 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-1" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#171-182" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.const_new" class="method"><code>pub const fn <a href="#method.const_new" class="fnname">const_new</a>(raw_mutex: R, 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#176-181" title="goto source code">[src]</a></h4><div class="docblock"><p>Creates a new mutex based on a pre-existing raw mutex.</p>
<p>This allows creating a mutex in a constant context on stable Rust.</p>
</div></div><h3 id="impl-2" 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-2" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#184-289" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.lock" class="method"><code>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#206-210" 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>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#220-227" 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>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#234-236" 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.is_locked" class="method"><code>pub fn <a href="#method.is_locked" class="fnname">is_locked</a>(&amp;self) -&gt; bool</code><a class="srclink" href="../src/lock_api/mutex.rs.html#240-242" title="goto source code">[src]</a></h4><div class="docblock"><p>Checks whether the mutex is currently locked.</p>
</div><h4 id="method.force_unlock" class="method"><code>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#256-258" 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>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#270-272" 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><h4 id="method.data_ptr" class="method"><code>pub fn <a href="#method.data_ptr" class="fnname">data_ptr</a>(&amp;self) -&gt; *mut T</code><a class="srclink" href="../src/lock_api/mutex.rs.html#286-288" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns a raw pointer to the underlying data.</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>You must ensure that there are no data races when dereferencing the
returned pointer, for example if the current thread logically owns
a <code>MutexGuard</code> but that guard has been discarded using <code>mem::forget</code>.</p>
</div></div><h3 id="impl-3" 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-3" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#291-307" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.force_unlock_fair" class="method"><code>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#304-306" 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-3" class="section-header"><a href="#safety-3">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-4" 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-4" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#309-339" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.try_lock_for" class="method"><code>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#316-323" 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>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.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#331-338" 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="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><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#355-373" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>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>&lt;'_&gt;) -&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#356-372" 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-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#341-346" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>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#343-345" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the “default value” for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
</div></div><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#348-353" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>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#350-352" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</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#140" 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#141" 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;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-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#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub 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#132" 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><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#208-213" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#210" 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#216-220" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#217" 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-From%3C!%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;!&gt; for T</code><a href="#impl-From%3C!%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-563" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: !) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#560" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><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/mod.rs.html#544-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>pub 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/mod.rs.html#545" 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/mod.rs.html#533-540" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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/mod.rs.html#537" 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/mod.rs.html#581-590" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>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>pub 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/mod.rs.html#587" 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/mod.rs.html#567-576" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>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>pub 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/mod.rs.html#573" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
File diff suppressed because one or more lines are too long
@@ -0,0 +1,43 @@
<!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="A raw mutex type that wraps another raw mutex to provide reentrancy."><meta name="keywords" content="rust, rustlang, rust-lang, RawReentrantMutex"><title>lock_api::RawReentrantMutex - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Struct RawReentrantMutex</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.bump">bump</a><a href="#method.is_locked">is_locked</a><a href="#method.is_owned_by_current_thread">is_owned_by_current_thread</a><a href="#method.lock">lock</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><a href="#method.unlock">unlock</a><a href="#method.unlock_fair">unlock_fair</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><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><div id="sidebar-vars" data-name="RawReentrantMutex" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">lock_api</a>::<wbr><a class="struct" href="">RawReentrantMutex</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/remutex.rs.html#60-65" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct RawReentrantMutex&lt;R, G&gt; { /* fields omitted */ }</pre></div><div class="docblock"><p>A raw mutex type that wraps another raw mutex to provide reentrancy.</p>
<p>Although this has the same methods as the <a href="trait.RawMutex.html"><code>RawMutex</code></a> trait, it does
not implement it, and should not be used in the same way, since this
mutex can successfully acquire a lock multiple times in the same thread.
Only use this when you know you want a raw mutex that can be locked
reentrantly; you probably want <a href="struct.ReentrantMutex.html"><code>ReentrantMutex</code></a> instead.</p>
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" 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>&gt; <a class="struct" href="../lock_api/struct.RawReentrantMutex.html" title="struct lock_api::RawReentrantMutex">RawReentrantMutex</a>&lt;R, G&gt;</code><a href="#impl" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#70-145" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedconstant.INIT" class="associatedconstant"><code>pub const <a href="#associatedconstant.INIT" class="constant"><b>INIT</b></a>: Self</code><a class="srclink" href="../src/lock_api/remutex.rs.html#73-78" title="goto source code">[src]</a></h4><div class="docblock"><p>Initial value for an unlocked mutex.</p>
</div><h4 id="method.lock" class="method"><code>pub fn <a href="#method.lock" class="fnname">lock</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/remutex.rs.html#103-108" title="goto source code">[src]</a></h4><div class="docblock"><p>Acquires this mutex, blocking if its held by another thread.</p>
</div><h4 id="method.try_lock" class="method"><code>pub fn <a href="#method.try_lock" class="fnname">try_lock</a>(&amp;self) -&gt; bool</code><a class="srclink" href="../src/lock_api/remutex.rs.html#113-115" title="goto source code">[src]</a></h4><div class="docblock"><p>Attempts to acquire this mutex without blocking. Returns <code>true</code>
if the lock was successfully acquired and <code>false</code> otherwise.</p>
</div><h4 id="method.unlock" class="method"><code>pub unsafe fn <a href="#method.unlock" class="fnname">unlock</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/remutex.rs.html#124-131" title="goto source code">[src]</a></h4><div class="docblock"><p>Unlocks this mutex. The inner mutex may not be unlocked if
this mutex was acquired previously in the current thread.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>This method may only be called if the mutex is held by the current thread.</p>
</div><h4 id="method.is_locked" class="method"><code>pub fn <a href="#method.is_locked" class="fnname">is_locked</a>(&amp;self) -&gt; bool</code><a class="srclink" href="../src/lock_api/remutex.rs.html#135-137" title="goto source code">[src]</a></h4><div class="docblock"><p>Checks whether the mutex is currently locked.</p>
</div><h4 id="method.is_owned_by_current_thread" class="method"><code>pub fn <a href="#method.is_owned_by_current_thread" class="fnname">is_owned_by_current_thread</a>(&amp;self) -&gt; bool</code><a class="srclink" href="../src/lock_api/remutex.rs.html#141-144" title="goto source code">[src]</a></h4><div class="docblock"><p>Checks whether the mutex is currently held by the current thread.</p>
</div></div><h3 id="impl-1" 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>&gt; <a class="struct" href="../lock_api/struct.RawReentrantMutex.html" title="struct lock_api::RawReentrantMutex">RawReentrantMutex</a>&lt;R, G&gt;</code><a href="#impl-1" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#147-183" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.unlock_fair" class="method"><code>pub unsafe fn <a href="#method.unlock_fair" class="fnname">unlock_fair</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/remutex.rs.html#156-163" title="goto source code">[src]</a></h4><div class="docblock"><p>Unlocks this mutex using a fair unlock protocol. The inner mutex
may not be unlocked if this mutex was acquired previously in the
current thread.</p>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method may only be called if the mutex is held by the current thread.</p>
</div><h4 id="method.bump" class="method"><code>pub unsafe fn <a href="#method.bump" class="fnname">bump</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/remutex.rs.html#175-182" 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>
<h1 id="safety-2" class="section-header"><a href="#safety-2">Safety</a></h1>
<p>This method may only be called if the mutex is held by the current thread.</p>
</div></div><h3 id="impl-2" 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>&gt; <a class="struct" href="../lock_api/struct.RawReentrantMutex.html" title="struct lock_api::RawReentrantMutex">RawReentrantMutex</a>&lt;R, G&gt;</code><a href="#impl-2" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#185-197" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.try_lock_until" class="method"><code>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; bool</code><a class="srclink" href="../src/lock_api/remutex.rs.html#188-190" title="goto source code">[src]</a></h4><div class="docblock"><p>Attempts to acquire this lock until a timeout is reached.</p>
</div><h4 id="method.try_lock_for" class="method"><code>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; bool</code><a class="srclink" href="../src/lock_api/remutex.rs.html#194-196" title="goto source code">[src]</a></h4><div class="docblock"><p>Attempts to acquire this lock until a timeout is reached.</p>
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><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>&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.RawReentrantMutex.html" title="struct lock_api::RawReentrantMutex">RawReentrantMutex</a>&lt;R, G&gt;</code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#67" 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>&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.RawReentrantMutex.html" title="struct lock_api::RawReentrantMutex">RawReentrantMutex</a>&lt;R, G&gt;</code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#68" 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;R, G&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.RawReentrantMutex.html" title="struct lock_api::RawReentrantMutex">RawReentrantMutex</a>&lt;R, G&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>,&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-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#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub 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#132" 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><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#208-213" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#210" 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#216-220" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#217" 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-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/mod.rs.html#544-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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/mod.rs.html#545" 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/mod.rs.html#533-540" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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/mod.rs.html#537" 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/mod.rs.html#581-590" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>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>pub 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/mod.rs.html#587" 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/mod.rs.html#567-576" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>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>pub 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/mod.rs.html#573" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
File diff suppressed because one or more lines are too long
@@ -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="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."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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="#implementations">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="#trait-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><div id="sidebar-vars" data-name="ReentrantMutexGuard" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">lock_api</a>::<wbr><a class="struct" href="">ReentrantMutexGuard</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/remutex.rs.html#521-524" title="goto source code">[src]</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 “scoped lock” 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="implementations" class="small-section-header">Implementations<a href="#implementations" 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#531-606" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.remutex" class="method"><code>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#533-535" 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>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#546-558" 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>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#570-588" 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>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#595-605" 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#608-663" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.unlock_fair" class="method"><code>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#624-630" 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>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#639-649" 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>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#657-662" 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="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><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#687-693" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>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>&lt;'_&gt;) -&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#690-692" 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-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#665-673" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Target" class="type"><code>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>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#670-672" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</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#695-701" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>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>&lt;'_&gt;) -&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#698-700" 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-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#675-685" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.drop" class="method hidden"><code>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#679-684" 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-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#526-529" 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-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><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></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-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#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub 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#132" 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><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#208-213" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#210" 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#216-220" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#217" 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-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/mod.rs.html#544-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub 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/mod.rs.html#545" 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/mod.rs.html#533-540" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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/mod.rs.html#537" 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/mod.rs.html#581-590" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>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>pub 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/mod.rs.html#587" 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/mod.rs.html#567-576" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>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>pub 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/mod.rs.html#573" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
+185
View File
@@ -0,0 +1,185 @@
<!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="A reader-writer lock"><meta name="keywords" content="rust, rustlang, rust-lang, RwLock"><title>lock_api::RwLock - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Struct RwLock</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.const_new">const_new</a><a href="#method.data_ptr">data_ptr</a><a href="#method.force_unlock_read">force_unlock_read</a><a href="#method.force_unlock_read_fair">force_unlock_read_fair</a><a href="#method.force_unlock_write">force_unlock_write</a><a href="#method.force_unlock_write_fair">force_unlock_write_fair</a><a href="#method.get_mut">get_mut</a><a href="#method.into_inner">into_inner</a><a href="#method.is_locked">is_locked</a><a href="#method.new">new</a><a href="#method.raw">raw</a><a href="#method.read">read</a><a href="#method.read_recursive">read_recursive</a><a href="#method.try_read">try_read</a><a href="#method.try_read_for">try_read_for</a><a href="#method.try_read_recursive">try_read_recursive</a><a href="#method.try_read_recursive_for">try_read_recursive_for</a><a href="#method.try_read_recursive_until">try_read_recursive_until</a><a href="#method.try_read_until">try_read_until</a><a href="#method.try_upgradable_read">try_upgradable_read</a><a href="#method.try_upgradable_read_for">try_upgradable_read_for</a><a href="#method.try_upgradable_read_until">try_upgradable_read_until</a><a href="#method.try_write">try_write</a><a href="#method.try_write_for">try_write_for</a><a href="#method.try_write_until">try_write_until</a><a href="#method.upgradable_read">upgradable_read</a><a href="#method.write">write</a></div><a class="sidebar-title" href="#trait-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%3C!%3E">From&lt;!&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><div id="sidebar-vars" data-name="RwLock" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">lock_api</a>::<wbr><a class="struct" href="">RwLock</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#311-314" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct RwLock&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; { /* fields omitted */ }</pre></div><div class="docblock"><p>A reader-writer lock</p>
<p>This type of lock allows a number of readers or at most one writer at any
point in time. The write portion of this lock typically allows modification
of the underlying data (exclusive access) and the read portion of this lock
typically allows for read-only access (shared access).</p>
<p>The type parameter <code>T</code> represents the data that this lock protects. It is
required that <code>T</code> satisfies <code>Send</code> to be shared across threads and <code>Sync</code> to
allow concurrent access through readers. The RAII guards returned from the
locking methods implement <code>Deref</code> (and <code>DerefMut</code> for the <code>write</code> methods)
to allow access to the contained of the lock.</p>
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a>, T&gt; <a class="struct" href="../lock_api/struct.RwLock.html" title="struct lock_api::RwLock">RwLock</a>&lt;R, T&gt;</code><a href="#impl" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#348-375" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.new" class="method"><code>pub fn <a href="#method.new" class="fnname">new</a>(val: T) -&gt; <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#362-367" title="goto source code">[src]</a></h4><div class="docblock"><p>Creates a new instance of an <code>RwLock&lt;T&gt;</code> which is unlocked.</p>
</div><h4 id="method.into_inner" class="method"><code>pub fn <a href="#method.into_inner" class="fnname">into_inner</a>(self) -&gt; T</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#372-374" title="goto source code">[src]</a></h4><div class="docblock"><p>Consumes this <code>RwLock</code>, returning the underlying data.</p>
</div></div><h3 id="impl-1" class="impl"><code class="in-band">impl&lt;R, T&gt; <a class="struct" href="../lock_api/struct.RwLock.html" title="struct lock_api::RwLock">RwLock</a>&lt;R, T&gt;</code><a href="#impl-1" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#377-390" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.const_new" class="method"><code>pub const fn <a href="#method.const_new" class="fnname">const_new</a>(raw_rwlock: R, val: T) -&gt; <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#384-389" title="goto source code">[src]</a></h4><div class="docblock"><p>Creates a new new instance of an <code>RwLock&lt;T&gt;</code> based on a pre-existing
<code>RawRwLock&lt;T&gt;</code>.</p>
<p>This allows creating a <code>RwLock&lt;T&gt;</code> in a constant context on stable
Rust.</p>
</div></div><h3 id="impl-2" class="impl"><code class="in-band">impl&lt;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; <a class="struct" href="../lock_api/struct.RwLock.html" title="struct lock_api::RwLock">RwLock</a>&lt;R, T&gt;</code><a href="#impl-2" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#392-560" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.read" class="method"><code>pub fn <a href="#method.read" class="fnname">read</a>(&amp;self) -&gt; <a class="struct" href="../lock_api/struct.RwLockReadGuard.html" title="struct lock_api::RwLockReadGuard">RwLockReadGuard</a>&lt;'_, R, T&gt;</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#428-432" title="goto source code">[src]</a></h4><div class="docblock"><p>Locks this <code>RwLock</code> with shared read access, blocking the current thread
until it can be acquired.</p>
<p>The calling thread will be blocked until there are no more writers which
hold the lock. There may be other readers currently inside the lock when
this method returns.</p>
<p>Note that attempts to recursively acquire a read lock on a <code>RwLock</code> when
the current thread already holds one may result in a deadlock.</p>
<p>Returns an RAII guard which will release this threads shared access
once it is dropped.</p>
</div><h4 id="method.try_read" class="method"><code>pub fn <a href="#method.try_read" class="fnname">try_read</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.RwLockReadGuard.html" title="struct lock_api::RwLockReadGuard">RwLockReadGuard</a>&lt;'_, R, T&gt;&gt;</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#442-449" title="goto source code">[src]</a></h4><div class="docblock"><p>Attempts to acquire this <code>RwLock</code> with shared read access.</p>
<p>If the access could not be granted at this time, then <code>None</code> is returned.
Otherwise, an RAII guard is returned which will release the shared access
when it is dropped.</p>
<p>This function does not block.</p>
</div><h4 id="method.write" class="method"><code>pub fn <a href="#method.write" class="fnname">write</a>(&amp;self) -&gt; <a class="struct" href="../lock_api/struct.RwLockWriteGuard.html" title="struct lock_api::RwLockWriteGuard">RwLockWriteGuard</a>&lt;'_, R, T&gt;</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#460-464" title="goto source code">[src]</a></h4><div class="docblock"><p>Locks this <code>RwLock</code> with exclusive write access, blocking the current
thread until it can be acquired.</p>
<p>This function will not return while other writers or other readers
currently have access to the lock.</p>
<p>Returns an RAII guard which will drop the write access of this <code>RwLock</code>
when dropped.</p>
</div><h4 id="method.try_write" class="method"><code>pub fn <a href="#method.try_write" class="fnname">try_write</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.RwLockWriteGuard.html" title="struct lock_api::RwLockWriteGuard">RwLockWriteGuard</a>&lt;'_, R, T&gt;&gt;</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#474-481" title="goto source code">[src]</a></h4><div class="docblock"><p>Attempts to lock this <code>RwLock</code> with exclusive write access.</p>
<p>If the lock could not be acquired at this time, then <code>None</code> is returned.
Otherwise, an RAII guard is returned which will release the lock when
it is dropped.</p>
<p>This function does not block.</p>
</div><h4 id="method.get_mut" class="method"><code>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/rwlock.rs.html#488-490" 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>RwLock</code> mutably, no actual locking needs to
take place—the mutable borrow statically guarantees no locks exist.</p>
</div><h4 id="method.is_locked" class="method"><code>pub fn <a href="#method.is_locked" class="fnname">is_locked</a>(&amp;self) -&gt; bool</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#494-496" title="goto source code">[src]</a></h4><div class="docblock"><p>Checks whether this <code>RwLock</code> is currently locked in any way.</p>
</div><h4 id="method.force_unlock_read" class="method"><code>pub unsafe fn <a href="#method.force_unlock_read" class="fnname">force_unlock_read</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#510-512" title="goto source code">[src]</a></h4><div class="docblock"><p>Forcibly unlocks a read lock.</p>
<p>This is useful when combined with <code>mem::forget</code> to hold a lock without
the need to maintain a <code>RwLockReadGuard</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>RwLockReadGuard</code> but that guard has be discarded using <code>mem::forget</code>.
Behavior is undefined if a rwlock is read-unlocked when not read-locked.</p>
</div><h4 id="method.force_unlock_write" class="method"><code>pub unsafe fn <a href="#method.force_unlock_write" class="fnname">force_unlock_write</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#526-528" title="goto source code">[src]</a></h4><div class="docblock"><p>Forcibly unlocks a write lock.</p>
<p>This is useful when combined with <code>mem::forget</code> to hold a lock without
the need to maintain a <code>RwLockWriteGuard</code> object alive, for example when
dealing with FFI.</p>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method must only be called if the current thread logically owns a
<code>RwLockWriteGuard</code> but that guard has be discarded using <code>mem::forget</code>.
Behavior is undefined if a rwlock is write-unlocked when not write-locked.</p>
</div><h4 id="method.raw" class="method"><code>pub unsafe fn <a href="#method.raw" class="fnname">raw</a>(&amp;self) -&gt; &amp;R</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#540-542" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the underlying raw reader-writer lock object.</p>
<p>Note that you will most likely need to import the <code>RawRwLock</code> trait from
<code>lock_api</code> to be able to call functions on the raw
reader-writer lock.</p>
<h1 id="safety-2" class="section-header"><a href="#safety-2">Safety</a></h1>
<p>This method is unsafe because it allows unlocking a mutex while
still holding a reference to a lock guard.</p>
</div><h4 id="method.data_ptr" class="method"><code>pub fn <a href="#method.data_ptr" class="fnname">data_ptr</a>(&amp;self) -&gt; *mut T</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#557-559" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns a raw pointer to the underlying data.</p>
<p>This is useful when combined with <code>mem::forget</code> to hold a lock without
the need to maintain a <code>RwLockReadGuard</code> or <code>RwLockWriteGuard</code> object
alive, for example when dealing with FFI.</p>
<h1 id="safety-3" class="section-header"><a href="#safety-3">Safety</a></h1>
<p>You must ensure that there are no data races when dereferencing the
returned pointer, for example if the current thread logically owns a
<code>RwLockReadGuard</code> or <code>RwLockWriteGuard</code> but that guard has been discarded
using <code>mem::forget</code>.</p>
</div></div><h3 id="impl-3" class="impl"><code class="in-band">impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockFair.html" title="trait lock_api::RawRwLockFair">RawRwLockFair</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.RwLock.html" title="struct lock_api::RwLock">RwLock</a>&lt;R, T&gt;</code><a href="#impl-3" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#562-594" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.force_unlock_read_fair" class="method"><code>pub unsafe fn <a href="#method.force_unlock_read_fair" class="fnname">force_unlock_read_fair</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#575-577" title="goto source code">[src]</a></h4><div class="docblock"><p>Forcibly unlocks a read lock 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>RwLockReadGuard</code> object alive, for example when
dealing with FFI.</p>
<h1 id="safety-4" class="section-header"><a href="#safety-4">Safety</a></h1>
<p>This method must only be called if the current thread logically owns a
<code>RwLockReadGuard</code> but that guard has be discarded using <code>mem::forget</code>.
Behavior is undefined if a rwlock is read-unlocked when not read-locked.</p>
</div><h4 id="method.force_unlock_write_fair" class="method"><code>pub unsafe fn <a href="#method.force_unlock_write_fair" class="fnname">force_unlock_write_fair</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#591-593" title="goto source code">[src]</a></h4><div class="docblock"><p>Forcibly unlocks a write lock 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>RwLockWriteGuard</code> object alive, for example when
dealing with FFI.</p>
<h1 id="safety-5" class="section-header"><a href="#safety-5">Safety</a></h1>
<p>This method must only be called if the current thread logically owns a
<code>RwLockWriteGuard</code> but that guard has be discarded using <code>mem::forget</code>.
Behavior is undefined if a rwlock is write-unlocked when not write-locked.</p>
</div></div><h3 id="impl-4" class="impl"><code class="in-band">impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockTimed.html" title="trait lock_api::RawRwLockTimed">RawRwLockTimed</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.RwLock.html" title="struct lock_api::RwLock">RwLock</a>&lt;R, T&gt;</code><a href="#impl-4" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#596-660" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.try_read_for" class="method"><code>pub fn <a href="#method.try_read_for" class="fnname">try_read_for</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;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/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../lock_api/struct.RwLockReadGuard.html" title="struct lock_api::RwLockReadGuard">RwLockReadGuard</a>&lt;'_, R, T&gt;&gt;</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#604-611" title="goto source code">[src]</a></h4><div class="docblock"><p>Attempts to acquire this <code>RwLock</code> with shared read access until a timeout
is reached.</p>
<p>If the access could not be granted before the timeout expires, then
<code>None</code> is returned. Otherwise, an RAII guard is returned which will
release the shared access when it is dropped.</p>
</div><h4 id="method.try_read_until" class="method"><code>pub fn <a href="#method.try_read_until" class="fnname">try_read_until</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;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/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../lock_api/struct.RwLockReadGuard.html" title="struct lock_api::RwLockReadGuard">RwLockReadGuard</a>&lt;'_, R, T&gt;&gt;</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#620-627" title="goto source code">[src]</a></h4><div class="docblock"><p>Attempts to acquire this <code>RwLock</code> with shared read access until a timeout
is reached.</p>
<p>If the access could not be granted before the timeout expires, then
<code>None</code> is returned. Otherwise, an RAII guard is returned which will
release the shared access when it is dropped.</p>
</div><h4 id="method.try_write_for" class="method"><code>pub fn <a href="#method.try_write_for" class="fnname">try_write_for</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;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/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../lock_api/struct.RwLockWriteGuard.html" title="struct lock_api::RwLockWriteGuard">RwLockWriteGuard</a>&lt;'_, R, T&gt;&gt;</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#636-643" title="goto source code">[src]</a></h4><div class="docblock"><p>Attempts to acquire this <code>RwLock</code> with exclusive write access until a
timeout is reached.</p>
<p>If the access could not be granted before the timeout expires, then
<code>None</code> is returned. Otherwise, an RAII guard is returned which will
release the exclusive access when it is dropped.</p>
</div><h4 id="method.try_write_until" class="method"><code>pub fn <a href="#method.try_write_until" class="fnname">try_write_until</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;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/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../lock_api/struct.RwLockWriteGuard.html" title="struct lock_api::RwLockWriteGuard">RwLockWriteGuard</a>&lt;'_, R, T&gt;&gt;</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#652-659" title="goto source code">[src]</a></h4><div class="docblock"><p>Attempts to acquire this <code>RwLock</code> with exclusive write access until a
timeout is reached.</p>
<p>If the access could not be granted before the timeout expires, then
<code>None</code> is returned. Otherwise, an RAII guard is returned which will
release the exclusive access when it is dropped.</p>
</div></div><h3 id="impl-5" class="impl"><code class="in-band">impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockRecursive.html" title="trait lock_api::RawRwLockRecursive">RawRwLockRecursive</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.RwLock.html" title="struct lock_api::RwLock">RwLock</a>&lt;R, T&gt;</code><a href="#impl-5" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#662-704" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.read_recursive" class="method"><code>pub fn <a href="#method.read_recursive" class="fnname">read_recursive</a>(&amp;self) -&gt; <a class="struct" href="../lock_api/struct.RwLockReadGuard.html" title="struct lock_api::RwLockReadGuard">RwLockReadGuard</a>&lt;'_, R, T&gt;</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#679-683" title="goto source code">[src]</a></h4><div class="docblock"><p>Locks this <code>RwLock</code> with shared read access, blocking the current thread
until it can be acquired.</p>
<p>The calling thread will be blocked until there are no more writers which
hold the lock. There may be other readers currently inside the lock when
this method returns.</p>
<p>Unlike <code>read</code>, this method is 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>
<p>Returns an RAII guard which will release this threads shared access
once it is dropped.</p>
</div><h4 id="method.try_read_recursive" class="method"><code>pub fn <a href="#method.try_read_recursive" class="fnname">try_read_recursive</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.RwLockReadGuard.html" title="struct lock_api::RwLockReadGuard">RwLockReadGuard</a>&lt;'_, R, T&gt;&gt;</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#696-703" title="goto source code">[src]</a></h4><div class="docblock"><p>Attempts to acquire this <code>RwLock</code> with shared read access.</p>
<p>If the access could not be granted at this time, then <code>None</code> is returned.
Otherwise, an RAII guard is returned which will release the shared access
when it is dropped.</p>
<p>This method is guaranteed to succeed if another read lock is held at the
time of the call. See the documentation for <code>read_recursive</code> for details.</p>
<p>This function does not block.</p>
</div></div><h3 id="impl-6" class="impl"><code class="in-band">impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockRecursiveTimed.html" title="trait lock_api::RawRwLockRecursiveTimed">RawRwLockRecursiveTimed</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.RwLock.html" title="struct lock_api::RwLock">RwLock</a>&lt;R, T&gt;</code><a href="#impl-6" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#706-748" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.try_read_recursive_for" class="method"><code>pub fn <a href="#method.try_read_recursive_for" class="fnname">try_read_recursive_for</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;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/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../lock_api/struct.RwLockReadGuard.html" title="struct lock_api::RwLockReadGuard">RwLockReadGuard</a>&lt;'_, R, T&gt;&gt;</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#718-728" title="goto source code">[src]</a></h4><div class="docblock"><p>Attempts to acquire this <code>RwLock</code> with shared read access until a timeout
is reached.</p>
<p>If the access could not be granted before the timeout expires, then
<code>None</code> is returned. Otherwise, an RAII guard is returned which will
release the shared access when it is dropped.</p>
<p>This method is guaranteed to succeed without blocking if another read
lock is held at the time of the call. See the documentation for
<code>read_recursive</code> for details.</p>
</div><h4 id="method.try_read_recursive_until" class="method"><code>pub fn <a href="#method.try_read_recursive_until" class="fnname">try_read_recursive_until</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;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/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../lock_api/struct.RwLockReadGuard.html" title="struct lock_api::RwLockReadGuard">RwLockReadGuard</a>&lt;'_, R, T&gt;&gt;</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#737-747" title="goto source code">[src]</a></h4><div class="docblock"><p>Attempts to acquire this <code>RwLock</code> with shared read access until a timeout
is reached.</p>
<p>If the access could not be granted before the timeout expires, then
<code>None</code> is returned. Otherwise, an RAII guard is returned which will
release the shared access when it is dropped.</p>
</div></div><h3 id="impl-7" class="impl"><code class="in-band">impl&lt;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; <a class="struct" href="../lock_api/struct.RwLock.html" title="struct lock_api::RwLock">RwLock</a>&lt;R, T&gt;</code><a href="#impl-7" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#750-794" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.upgradable_read" class="method"><code>pub fn <a href="#method.upgradable_read" class="fnname">upgradable_read</a>(&amp;self) -&gt; <a class="struct" href="../lock_api/struct.RwLockUpgradableReadGuard.html" title="struct lock_api::RwLockUpgradableReadGuard">RwLockUpgradableReadGuard</a>&lt;'_, R, T&gt;</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#772-776" title="goto source code">[src]</a></h4><div class="docblock"><p>Locks this <code>RwLock</code> with upgradable read access, blocking the current thread
until it can be acquired.</p>
<p>The calling thread will be blocked until there are no more writers or other
upgradable reads which hold the lock. There may be other readers currently
inside the lock when this method returns.</p>
<p>Returns an RAII guard which will release this threads shared access
once it is dropped.</p>
</div><h4 id="method.try_upgradable_read" class="method"><code>pub fn <a href="#method.try_upgradable_read" class="fnname">try_upgradable_read</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.RwLockUpgradableReadGuard.html" title="struct lock_api::RwLockUpgradableReadGuard">RwLockUpgradableReadGuard</a>&lt;'_, R, T&gt;&gt;</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#786-793" title="goto source code">[src]</a></h4><div class="docblock"><p>Attempts to acquire this <code>RwLock</code> with upgradable read access.</p>
<p>If the access could not be granted at this time, then <code>None</code> is returned.
Otherwise, an RAII guard is returned which will release the shared access
when it is dropped.</p>
<p>This function does not block.</p>
</div></div><h3 id="impl-8" class="impl"><code class="in-band">impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLockUpgradeTimed.html" title="trait lock_api::RawRwLockUpgradeTimed">RawRwLockUpgradeTimed</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.RwLock.html" title="struct lock_api::RwLock">RwLock</a>&lt;R, T&gt;</code><a href="#impl-8" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#796-834" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.try_upgradable_read_for" class="method"><code>pub fn <a href="#method.try_upgradable_read_for" class="fnname">try_upgradable_read_for</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;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/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../lock_api/struct.RwLockUpgradableReadGuard.html" title="struct lock_api::RwLockUpgradableReadGuard">RwLockUpgradableReadGuard</a>&lt;'_, R, T&gt;&gt;</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#804-814" title="goto source code">[src]</a></h4><div class="docblock"><p>Attempts to acquire this <code>RwLock</code> with upgradable read access until a timeout
is reached.</p>
<p>If the access could not be granted before the timeout expires, then
<code>None</code> is returned. Otherwise, an RAII guard is returned which will
release the shared access when it is dropped.</p>
</div><h4 id="method.try_upgradable_read_until" class="method"><code>pub fn <a href="#method.try_upgradable_read_until" class="fnname">try_upgradable_read_until</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;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/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../lock_api/struct.RwLockUpgradableReadGuard.html" title="struct lock_api::RwLockUpgradableReadGuard">RwLockUpgradableReadGuard</a>&lt;'_, R, T&gt;&gt;</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#823-833" title="goto source code">[src]</a></h4><div class="docblock"><p>Attempts to acquire this <code>RwLock</code> with upgradable read access until a timeout
is reached.</p>
<p>If the access could not be granted before the timeout expires, then
<code>None</code> is returned. Otherwise, an RAII guard is returned which will
release the shared access when it is dropped.</p>
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Debug" class="impl"><code class="in-band">impl&lt;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> + <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.RwLock.html" title="struct lock_api::RwLock">RwLock</a>&lt;R, T&gt;</code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#850-868" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>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>&lt;'_&gt;) -&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#851-867" 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-Default" class="impl"><code class="in-band">impl&lt;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> + <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.RwLock.html" title="struct lock_api::RwLock">RwLock</a>&lt;R, T&gt;</code><a href="#impl-Default" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#836-841" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>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.RwLock.html" title="struct lock_api::RwLock">RwLock</a>&lt;R, T&gt;</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#838-840" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the “default value” for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</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.RwLock.html" title="struct lock_api::RwLock">RwLock</a>&lt;R, T&gt;</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#843-848" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>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.RwLock.html" title="struct lock_api::RwLock">RwLock</a>&lt;R, T&gt;</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#845-847" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-Send" class="impl"><code class="in-band">impl&lt;R:&nbsp;<a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</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.RwLock.html" title="struct lock_api::RwLock">RwLock</a>&lt;R, T&gt;</code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#345" 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.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</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> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</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.RwLock.html" title="struct lock_api::RwLock">RwLock</a>&lt;R, T&gt;</code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#346" 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;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.RwLock.html" title="struct lock_api::RwLock">RwLock</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-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#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub 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#132" 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><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#208-213" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#210" 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#216-220" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#217" 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-From%3C!%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;!&gt; for T</code><a href="#impl-From%3C!%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559-563" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: !) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#560" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><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/mod.rs.html#544-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>pub 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/mod.rs.html#545" 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/mod.rs.html#533-540" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub 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/mod.rs.html#537" 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/mod.rs.html#581-590" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>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>pub 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/mod.rs.html#587" 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/mod.rs.html#567-576" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>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>pub 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/mod.rs.html#573" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+19
View File
@@ -0,0 +1,19 @@
<!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="Helper trait which returns a non-zero thread ID."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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><div id="sidebar-vars" data-name="GetThreadId" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="">GetThreadId</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/remutex.rs.html#38-48" title="goto source code">[src]</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/nonzero/struct.NonZeroUsize.html" title="struct core::num::nonzero::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>const <a href="#associatedconstant.INIT" class="constant"><b>INIT</b></a>: Self</code><a class="srclink" href="../src/lock_api/remutex.rs.html#43" title="goto source code">[src]</a></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>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/nonzero/struct.NonZeroUsize.html" title="struct core::num::nonzero::NonZeroUsize">NonZeroUsize</a></code><a class="srclink" href="../src/lock_api/remutex.rs.html#47" title="goto source code">[src]</a></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" src="../implementors/lock_api/trait.GetThreadId.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
+32
View File
@@ -0,0 +1,32 @@
<!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="Basic operations for a mutex."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.is_locked">is_locked</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class="location"><a href="index.html">lock_api</a></p><div id="sidebar-vars" data-name="RawMutex" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="">RawMutex</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/mutex.rs.html#29-72" title="goto source code">[src]</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> unsafe fn <a href="#tymethod.unlock" class="fnname">unlock</a>(&amp;self);
fn <a href="#method.is_locked" class="fnname">is_locked</a>(&amp;self) -&gt; bool { ... }
}</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 cant 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>type <a href="#associatedtype.GuardMarker" class="type">GuardMarker</a></code><a class="srclink" href="../src/lock_api/mutex.rs.html#38" title="goto source code">[src]</a></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>const <a href="#associatedconstant.INIT" class="constant"><b>INIT</b></a>: Self</code><a class="srclink" href="../src/lock_api/mutex.rs.html#34" title="goto source code">[src]</a></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>fn <a href="#tymethod.lock" class="fnname">lock</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/mutex.rs.html#41" title="goto source code">[src]</a></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>fn <a href="#tymethod.try_lock" class="fnname">try_lock</a>(&amp;self) -&gt; bool</code><a class="srclink" href="../src/lock_api/mutex.rs.html#45" title="goto source code">[src]</a></h3><div class="docblock"><p>Attempts to acquire this mutex without blocking. Returns <code>true</code>
if the lock was successfully acquired and <code>false</code> otherwise.</p>
</div><h3 id="tymethod.unlock" class="method"><code>unsafe fn <a href="#tymethod.unlock" class="fnname">unlock</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/mutex.rs.html#58" title="goto source code">[src]</a></h3><div class="docblock"><p>Unlocks this mutex.</p>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method may only be called if the mutex is held in the current context, i.e. it must
be paired with a successful call to <a href="#tymethod.lock"><code>lock</code></a>, <a href="#tymethod.try_lock"><code>try_lock</code></a>, <a href="trait.RawMutexTimed.html#tymethod.try_lock_for"><code>try_lock_for</code></a> or <a href="trait.RawMutexTimed.html#tymethod.try_lock_until"><code>try_lock_until</code></a>.</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.is_locked" class="method"><code>fn <a href="#method.is_locked" class="fnname">is_locked</a>(&amp;self) -&gt; bool</code><a class="srclink" href="../src/lock_api/mutex.rs.html#62-71" title="goto source code">[src]</a></h3><div class="docblock"><p>Checks whether the mutex is currently locked.</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" src="../implementors/lock_api/trait.RawMutex.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
+25
View File
@@ -0,0 +1,25 @@
<!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="Additional methods for mutexes which support fair unlocking."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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><div id="sidebar-vars" data-name="RawMutexFair" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="">RawMutexFair</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/mutex.rs.html#80-107" title="goto source code">[src]</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> {
unsafe fn <a href="#tymethod.unlock_fair" class="fnname">unlock_fair</a>(&amp;self);
unsafe 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
“steal” 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>unsafe fn <a href="#tymethod.unlock_fair" class="fnname">unlock_fair</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/mutex.rs.html#89" title="goto source code">[src]</a></h3><div class="docblock"><p>Unlocks this mutex using a fair unlock protocol.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>This method may only be called if the mutex is held in the current context, see
the documentation of <a href="trait.RawMutex.html#tymethod.unlock"><code>unlock</code></a>.</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>unsafe fn <a href="#method.bump" class="fnname">bump</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/mutex.rs.html#103-106" title="goto source code">[src]</a></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>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method may only be called if the mutex is held in the current context, see
the documentation of <a href="trait.RawMutex.html#tymethod.unlock"><code>unlock</code></a>.</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" src="../implementors/lock_api/trait.RawMutexFair.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
+17
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="Additional methods for mutexes which support locking with timeouts."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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><div id="sidebar-vars" data-name="RawMutexTimed" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="">RawMutexTimed</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/mutex.rs.html#113-125" title="goto source code">[src]</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>type <a href="#associatedtype.Duration" class="type">Duration</a></code><a class="srclink" href="../src/lock_api/mutex.rs.html#115" title="goto source code">[src]</a></h3><div class="docblock"><p>Duration type used for <code>try_lock_for</code>.</p>
</div><h3 id="associatedtype.Instant" class="method"><code>type <a href="#associatedtype.Instant" class="type">Instant</a></code><a class="srclink" href="../src/lock_api/mutex.rs.html#118" title="goto source code">[src]</a></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>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><a class="srclink" href="../src/lock_api/mutex.rs.html#121" title="goto source code">[src]</a></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>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><a class="srclink" href="../src/lock_api/mutex.rs.html#124" title="goto source code">[src]</a></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" src="../implementors/lock_api/trait.RawMutexTimed.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
+40
View File
@@ -0,0 +1,40 @@
<!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="Basic operations for a reader-writer lock."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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_shared">lock_shared</a><a href="#tymethod.try_lock_shared">try_lock_shared</a><a href="#tymethod.unlock_shared">unlock_shared</a><a href="#tymethod.lock_exclusive">lock_exclusive</a><a href="#tymethod.try_lock_exclusive">try_lock_exclusive</a><a href="#tymethod.unlock_exclusive">unlock_exclusive</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.is_locked">is_locked</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class="location"><a href="index.html">lock_api</a></p><div id="sidebar-vars" data-name="RawRwLock" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="">RawRwLock</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#31-80" title="goto source code">[src]</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> unsafe 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> unsafe fn <a href="#tymethod.unlock_exclusive" class="fnname">unlock_exclusive</a>(&amp;self);
fn <a href="#method.is_locked" class="fnname">is_locked</a>(&amp;self) -&gt; bool { ... }
}</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 cant be acquired while an exclusive or shared
lock exists, and a shared lock cant 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>type <a href="#associatedtype.GuardMarker" class="type">GuardMarker</a></code><a class="srclink" href="../src/lock_api/rwlock.rs.html#40" title="goto source code">[src]</a></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>const <a href="#associatedconstant.INIT" class="constant"><b>INIT</b></a>: Self</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#36" title="goto source code">[src]</a></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>fn <a href="#tymethod.lock_shared" class="fnname">lock_shared</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#43" title="goto source code">[src]</a></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>fn <a href="#tymethod.try_lock_shared" class="fnname">try_lock_shared</a>(&amp;self) -&gt; bool</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#46" title="goto source code">[src]</a></h3><div class="docblock"><p>Attempts to acquire a shared lock without blocking.</p>
</div><h3 id="tymethod.unlock_shared" class="method"><code>unsafe fn <a href="#tymethod.unlock_shared" class="fnname">unlock_shared</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#53" title="goto source code">[src]</a></h3><div class="docblock"><p>Releases a shared lock.</p>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method may only be called if a shared lock is held in the current context.</p>
</div><h3 id="tymethod.lock_exclusive" class="method"><code>fn <a href="#tymethod.lock_exclusive" class="fnname">lock_exclusive</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#56" title="goto source code">[src]</a></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>fn <a href="#tymethod.try_lock_exclusive" class="fnname">try_lock_exclusive</a>(&amp;self) -&gt; bool</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#59" title="goto source code">[src]</a></h3><div class="docblock"><p>Attempts to acquire an exclusive lock without blocking.</p>
</div><h3 id="tymethod.unlock_exclusive" class="method"><code>unsafe fn <a href="#tymethod.unlock_exclusive" class="fnname">unlock_exclusive</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#66" title="goto source code">[src]</a></h3><div class="docblock"><p>Releases an exclusive lock.</p>
<h1 id="safety-2" class="section-header"><a href="#safety-2">Safety</a></h1>
<p>This method may only be called if an exclusive lock is held in the current context.</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.is_locked" class="method"><code>fn <a href="#method.is_locked" class="fnname">is_locked</a>(&amp;self) -&gt; bool</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#70-79" title="goto source code">[src]</a></h3><div class="docblock"><p>Checks if this <code>RwLock</code> is currently locked in any way.</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" src="../implementors/lock_api/trait.RawRwLock.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
@@ -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="Additional methods for RwLocks which support atomically downgrading an exclusive lock to a shared lock."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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><div id="sidebar-vars" data-name="RawRwLockDowngrade" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="">RawRwLockDowngrade</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#134-142" title="goto source code">[src]</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> {
unsafe 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>unsafe fn <a href="#tymethod.downgrade" class="fnname">downgrade</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#141" title="goto source code">[src]</a></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>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>This method may only be called if an exclusive lock is held in the current context.</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" src="../implementors/lock_api/trait.RawRwLockDowngrade.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
+34
View File
@@ -0,0 +1,34 @@
<!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="Additional methods for RwLocks which support fair unlocking."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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_shared_fair">unlock_shared_fair</a><a href="#tymethod.unlock_exclusive_fair">unlock_exclusive_fair</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.bump_shared">bump_shared</a><a href="#method.bump_exclusive">bump_exclusive</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class="location"><a href="index.html">lock_api</a></p><div id="sidebar-vars" data-name="RawRwLockFair" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="">RawRwLockFair</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#88-130" title="goto source code">[src]</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> {
unsafe fn <a href="#tymethod.unlock_shared_fair" class="fnname">unlock_shared_fair</a>(&amp;self);
<div class="item-spacer"></div> unsafe fn <a href="#tymethod.unlock_exclusive_fair" class="fnname">unlock_exclusive_fair</a>(&amp;self);
unsafe fn <a href="#method.bump_shared" class="fnname">bump_shared</a>(&amp;self) { ... }
<div class="item-spacer"></div> unsafe 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
“steal” 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>unsafe fn <a href="#tymethod.unlock_shared_fair" class="fnname">unlock_shared_fair</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#94" title="goto source code">[src]</a></h3><div class="docblock"><p>Releases a shared lock using a fair unlock protocol.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>This method may only be called if a shared lock is held in the current context.</p>
</div><h3 id="tymethod.unlock_exclusive_fair" class="method"><code>unsafe fn <a href="#tymethod.unlock_exclusive_fair" class="fnname">unlock_exclusive_fair</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#101" title="goto source code">[src]</a></h3><div class="docblock"><p>Releases an exclusive lock using a fair unlock protocol.</p>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method may only be called if an exclusive lock is held in the current context.</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>unsafe fn <a href="#method.bump_shared" class="fnname">bump_shared</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#112-115" title="goto source code">[src]</a></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>
<h1 id="safety-2" class="section-header"><a href="#safety-2">Safety</a></h1>
<p>This method may only be called if a shared lock is held in the current context.</p>
</div><h3 id="method.bump_exclusive" class="method"><code>unsafe fn <a href="#method.bump_exclusive" class="fnname">bump_exclusive</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#126-129" title="goto source code">[src]</a></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>
<h1 id="safety-3" class="section-header"><a href="#safety-3">Safety</a></h1>
<p>This method may only be called if an exclusive lock is held in the current context.</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" src="../implementors/lock_api/trait.RawRwLockFair.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
@@ -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="Additional methods for RwLocks which support recursive read locks."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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><div id="sidebar-vars" data-name="RawRwLockRecursive" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="">RawRwLockRecursive</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#175-181" title="goto source code">[src]</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>fn <a href="#tymethod.lock_shared_recursive" class="fnname">lock_shared_recursive</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#177" title="goto source code">[src]</a></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>fn <a href="#tymethod.try_lock_shared_recursive" class="fnname">try_lock_shared_recursive</a>(&amp;self) -&gt; bool</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#180" title="goto source code">[src]</a></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" src="../implementors/lock_api/trait.RawRwLockRecursive.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
@@ -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="Additional methods for RwLocks which support recursive read locks and timeouts."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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><div id="sidebar-vars" data-name="RawRwLockRecursiveTimed" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="">RawRwLockRecursiveTimed</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#184-192" title="goto source code">[src]</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>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><a class="srclink" href="../src/lock_api/rwlock.rs.html#187" title="goto source code">[src]</a></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>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><a class="srclink" href="../src/lock_api/rwlock.rs.html#191" title="goto source code">[src]</a></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" src="../implementors/lock_api/trait.RawRwLockRecursiveTimed.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
+21
View File
@@ -0,0 +1,21 @@
<!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="Additional methods for RwLocks which support locking with timeouts."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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_shared_for">try_lock_shared_for</a><a href="#tymethod.try_lock_shared_until">try_lock_shared_until</a><a href="#tymethod.try_lock_exclusive_for">try_lock_exclusive_for</a><a href="#tymethod.try_lock_exclusive_until">try_lock_exclusive_until</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class="location"><a href="index.html">lock_api</a></p><div id="sidebar-vars" data-name="RawRwLockTimed" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="">RawRwLockTimed</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#148-166" title="goto source code">[src]</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>type <a href="#associatedtype.Duration" class="type">Duration</a></code><a class="srclink" href="../src/lock_api/rwlock.rs.html#150" title="goto source code">[src]</a></h3><div class="docblock"><p>Duration type used for <code>try_lock_for</code>.</p>
</div><h3 id="associatedtype.Instant" class="method"><code>type <a href="#associatedtype.Instant" class="type">Instant</a></code><a class="srclink" href="../src/lock_api/rwlock.rs.html#153" title="goto source code">[src]</a></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>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><a class="srclink" href="../src/lock_api/rwlock.rs.html#156" title="goto source code">[src]</a></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>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><a class="srclink" href="../src/lock_api/rwlock.rs.html#159" title="goto source code">[src]</a></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>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><a class="srclink" href="../src/lock_api/rwlock.rs.html#162" title="goto source code">[src]</a></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>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><a class="srclink" href="../src/lock_api/rwlock.rs.html#165" title="goto source code">[src]</a></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" src="../implementors/lock_api/trait.RawRwLockTimed.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
+28
View File
@@ -0,0 +1,28 @@
<!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="Additional methods for RwLocks which support atomically upgrading a shared lock to an exclusive lock."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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.unlock_upgradable">unlock_upgradable</a><a href="#tymethod.upgrade">upgrade</a><a href="#tymethod.try_upgrade">try_upgrade</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class="location"><a href="index.html">lock_api</a></p><div id="sidebar-vars" data-name="RawRwLockUpgrade" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="">RawRwLockUpgrade</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#200-228" title="goto source code">[src]</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> unsafe fn <a href="#tymethod.unlock_upgradable" class="fnname">unlock_upgradable</a>(&amp;self);
<div class="item-spacer"></div> unsafe fn <a href="#tymethod.upgrade" class="fnname">upgrade</a>(&amp;self);
<div class="item-spacer"></div> unsafe 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 “upgradable read lock” 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>fn <a href="#tymethod.lock_upgradable" class="fnname">lock_upgradable</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#202" title="goto source code">[src]</a></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>fn <a href="#tymethod.try_lock_upgradable" class="fnname">try_lock_upgradable</a>(&amp;self) -&gt; bool</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#205" title="goto source code">[src]</a></h3><div class="docblock"><p>Attempts to acquire an upgradable lock without blocking.</p>
</div><h3 id="tymethod.unlock_upgradable" class="method"><code>unsafe fn <a href="#tymethod.unlock_upgradable" class="fnname">unlock_upgradable</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#212" title="goto source code">[src]</a></h3><div class="docblock"><p>Releases an upgradable lock.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>This method may only be called if an upgradable lock is held in the current context.</p>
</div><h3 id="tymethod.upgrade" class="method"><code>unsafe fn <a href="#tymethod.upgrade" class="fnname">upgrade</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#219" title="goto source code">[src]</a></h3><div class="docblock"><p>Upgrades an upgradable lock to an exclusive lock.</p>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method may only be called if an upgradable lock is held in the current context.</p>
</div><h3 id="tymethod.try_upgrade" class="method"><code>unsafe fn <a href="#tymethod.try_upgrade" class="fnname">try_upgrade</a>(&amp;self) -&gt; bool</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#227" title="goto source code">[src]</a></h3><div class="docblock"><p>Attempts to upgrade an upgradable lock to an exclusive lock without
blocking.</p>
<h1 id="safety-2" class="section-header"><a href="#safety-2">Safety</a></h1>
<p>This method may only be called if an upgradable lock is held in the current context.</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" src="../implementors/lock_api/trait.RawRwLockUpgrade.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
@@ -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="Additional methods for RwLocks which support upgradable locks and lock downgrading."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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_upgradable">downgrade_upgradable</a><a href="#tymethod.downgrade_to_upgradable">downgrade_to_upgradable</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class="location"><a href="index.html">lock_api</a></p><div id="sidebar-vars" data-name="RawRwLockUpgradeDowngrade" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="">RawRwLockUpgradeDowngrade</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#257-271" title="goto source code">[src]</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> {
unsafe fn <a href="#tymethod.downgrade_upgradable" class="fnname">downgrade_upgradable</a>(&amp;self);
<div class="item-spacer"></div> unsafe 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>unsafe fn <a href="#tymethod.downgrade_upgradable" class="fnname">downgrade_upgradable</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#263" title="goto source code">[src]</a></h3><div class="docblock"><p>Downgrades an upgradable lock to a shared lock.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>This method may only be called if an upgradable lock is held in the current context.</p>
</div><h3 id="tymethod.downgrade_to_upgradable" class="method"><code>unsafe fn <a href="#tymethod.downgrade_to_upgradable" class="fnname">downgrade_to_upgradable</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#270" title="goto source code">[src]</a></h3><div class="docblock"><p>Downgrades an exclusive lock to an upgradable lock.</p>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method may only be called if an exclusive lock is held in the current context.</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" src="../implementors/lock_api/trait.RawRwLockUpgradeDowngrade.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
@@ -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="Additional methods for RwLocks which support upgradable locks and fair unlocking."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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><div id="sidebar-vars" data-name="RawRwLockUpgradeFair" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="">RawRwLockUpgradeFair</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#232-253" title="goto source code">[src]</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> {
unsafe fn <a href="#tymethod.unlock_upgradable_fair" class="fnname">unlock_upgradable_fair</a>(&amp;self);
unsafe 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>unsafe fn <a href="#tymethod.unlock_upgradable_fair" class="fnname">unlock_upgradable_fair</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#238" title="goto source code">[src]</a></h3><div class="docblock"><p>Releases an upgradable lock using a fair unlock protocol.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>This method may only be called if an upgradable lock is held in the current context.</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>unsafe fn <a href="#method.bump_upgradable" class="fnname">bump_upgradable</a>(&amp;self)</code><a class="srclink" href="../src/lock_api/rwlock.rs.html#249-252" title="goto source code">[src]</a></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>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method may only be called if an upgradable lock is held in the current context.</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" src="../implementors/lock_api/trait.RawRwLockUpgradeFair.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>
@@ -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="Additional methods for RwLocks which support upgradable locks and locking with timeouts."><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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><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><div id="sidebar-vars" data-name="RawRwLockUpgradeTimed" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="">RawRwLockUpgradeTimed</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#275-297" title="goto source code">[src]</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> unsafe 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> unsafe 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>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><a class="srclink" href="../src/lock_api/rwlock.rs.html#277" title="goto source code">[src]</a></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>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><a class="srclink" href="../src/lock_api/rwlock.rs.html#280" title="goto source code">[src]</a></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>unsafe 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><a class="srclink" href="../src/lock_api/rwlock.rs.html#288" title="goto source code">[src]</a></h3><div class="docblock"><p>Attempts to upgrade an upgradable lock to an exclusive lock until a
timeout is reached.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>This method may only be called if an upgradable lock is held in the current context.</p>
</div><h3 id="tymethod.try_upgrade_until" class="method"><code>unsafe 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><a class="srclink" href="../src/lock_api/rwlock.rs.html#296" title="goto source code">[src]</a></h3><div class="docblock"><p>Attempts to upgrade an upgradable lock to an exclusive lock until a
timeout is reached.</p>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method may only be called if an upgradable lock is held in the current context.</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" src="../implementors/lock_api/trait.RawRwLockUpgradeTimed.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html>