doc: 2020-04-01 11:32:45 +0200: 478563f - Adding documentation
This commit is contained in:
3
lock_api/all.html
Normal file
3
lock_api/all.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span>
|
||||
</span>
|
||||
<span class='in-band'>List of all items</span></h1><h3 id='Structs'>Structs</h3><ul class='structs docblock'><li><a href='struct.GuardNoSend.html'>GuardNoSend</a></li><li><a href='struct.GuardSend.html'>GuardSend</a></li><li><a href='struct.MappedMutexGuard.html'>MappedMutexGuard</a></li><li><a href='struct.MappedReentrantMutexGuard.html'>MappedReentrantMutexGuard</a></li><li><a href='struct.MappedRwLockReadGuard.html'>MappedRwLockReadGuard</a></li><li><a href='struct.MappedRwLockWriteGuard.html'>MappedRwLockWriteGuard</a></li><li><a href='struct.Mutex.html'>Mutex</a></li><li><a href='struct.MutexGuard.html'>MutexGuard</a></li><li><a href='struct.ReentrantMutex.html'>ReentrantMutex</a></li><li><a href='struct.ReentrantMutexGuard.html'>ReentrantMutexGuard</a></li><li><a href='struct.RwLock.html'>RwLock</a></li><li><a href='struct.RwLockReadGuard.html'>RwLockReadGuard</a></li><li><a href='struct.RwLockUpgradableReadGuard.html'>RwLockUpgradableReadGuard</a></li><li><a href='struct.RwLockWriteGuard.html'>RwLockWriteGuard</a></li></ul><h3 id='Traits'>Traits</h3><ul class='traits docblock'><li><a href='trait.GetThreadId.html'>GetThreadId</a></li><li><a href='trait.RawMutex.html'>RawMutex</a></li><li><a href='trait.RawMutexFair.html'>RawMutexFair</a></li><li><a href='trait.RawMutexTimed.html'>RawMutexTimed</a></li><li><a href='trait.RawRwLock.html'>RawRwLock</a></li><li><a href='trait.RawRwLockDowngrade.html'>RawRwLockDowngrade</a></li><li><a href='trait.RawRwLockFair.html'>RawRwLockFair</a></li><li><a href='trait.RawRwLockRecursive.html'>RawRwLockRecursive</a></li><li><a href='trait.RawRwLockRecursiveTimed.html'>RawRwLockRecursiveTimed</a></li><li><a href='trait.RawRwLockTimed.html'>RawRwLockTimed</a></li><li><a href='trait.RawRwLockUpgrade.html'>RawRwLockUpgrade</a></li><li><a href='trait.RawRwLockUpgradeDowngrade.html'>RawRwLockUpgradeDowngrade</a></li><li><a href='trait.RawRwLockUpgradeFair.html'>RawRwLockUpgradeFair</a></li><li><a href='trait.RawRwLockUpgradeTimed.html'>RawRwLockUpgradeTimed</a></li></ul></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
115
lock_api/index.html
Normal file
115
lock_api/index.html
Normal file
@@ -0,0 +1,115 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `lock_api` crate."><meta name="keywords" content="rust, rustlang, rust-lang, lock_api"><title>lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Crate lock_api</p><div class="sidebar-elems"><a id='all-types' href='all.html'><p>See all lock_api's items</p></a><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'lock_api', ty: 'mod', relpath: '../'};</script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/lib.rs.html#8-107' title='goto source code'>[src]</a></span><span class='in-band'>Crate <a class="mod" href=''>lock_api</a></span></h1><div class='docblock'><p>This library provides type-safe and fully-featured <code>Mutex</code> and <code>RwLock</code>
|
||||
types which wrap a simple raw mutex or rwlock type. This has several
|
||||
benefits: not only does it eliminate a large portion of the work in
|
||||
implementing custom lock types, it also allows users to write code which is
|
||||
generic with regards to different lock implementations.</p>
|
||||
<p>Basic usage of this crate is very straightforward:</p>
|
||||
<ol>
|
||||
<li>Create a raw lock type. This should only contain the lock state, not any
|
||||
data protected by the lock.</li>
|
||||
<li>Implement the <code>RawMutex</code> trait for your custom lock type.</li>
|
||||
<li>Export your mutex as a type alias for <code>lock_api::Mutex</code>, and
|
||||
your mutex guard as a type alias for <code>lock_api::MutexGuard</code>.
|
||||
See the <a href="#example">example</a> below for details.</li>
|
||||
</ol>
|
||||
<p>This process is similar for RwLocks, except that two guards need to be
|
||||
exported instead of one. (Or 3 guards if your type supports upgradable read
|
||||
locks, see <a href="#extension-traits">extension traits</a> below for details)</p>
|
||||
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">lock_api</span>::{<span class="ident">RawMutex</span>, <span class="ident">Mutex</span>, <span class="ident">GuardSend</span>};
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">atomic</span>::{<span class="ident">AtomicBool</span>, <span class="ident">Ordering</span>};
|
||||
|
||||
<span class="comment">// 1. Define our raw lock type</span>
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">RawSpinlock</span>(<span class="ident">AtomicBool</span>);
|
||||
|
||||
<span class="comment">// 2. Implement RawMutex for this type</span>
|
||||
<span class="kw">unsafe</span> <span class="kw">impl</span> <span class="ident">RawMutex</span> <span class="kw">for</span> <span class="ident">RawSpinlock</span> {
|
||||
<span class="kw">const</span> <span class="ident">INIT</span>: <span class="ident">RawSpinlock</span> <span class="op">=</span> <span class="ident">RawSpinlock</span>(<span class="ident">AtomicBool</span>::<span class="ident">new</span>(<span class="bool-val">false</span>));
|
||||
|
||||
<span class="comment">// A spinlock guard can be sent to another thread and unlocked there</span>
|
||||
<span class="kw">type</span> <span class="ident">GuardMarker</span> <span class="op">=</span> <span class="ident">GuardSend</span>;
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">lock</span>(<span class="kw-2">&</span><span class="self">self</span>) {
|
||||
<span class="comment">// Note: This isn'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">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
|
||||
<span class="self">self</span>.<span class="number">0</span>.<span class="ident">swap</span>(<span class="bool-val">true</span>, <span class="ident">Ordering</span>::<span class="ident">Acquire</span>)
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">unlock</span>(<span class="kw-2">&</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"><</span><span class="ident">T</span><span class="op">></span> <span class="op">=</span> <span class="ident">lock_api</span>::<span class="ident">Mutex</span><span class="op"><</span><span class="ident">RawSpinlock</span>, <span class="ident">T</span><span class="op">></span>;
|
||||
<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">SpinlockGuard</span><span class="op"><</span><span class="lifetime">'a</span>, <span class="ident">T</span><span class="op">></span> <span class="op">=</span> <span class="ident">lock_api</span>::<span class="ident">MutexGuard</span><span class="op"><</span><span class="lifetime">'a</span>, <span class="ident">RawSpinlock</span>, <span class="ident">T</span><span class="op">></span>;</pre></div>
|
||||
<h1 id="extension-traits" class="section-header"><a href="#extension-traits">Extension traits</a></h1>
|
||||
<p>In addition to basic locking & 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.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><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
10
lock_api/mutex/struct.MappedMutexGuard.html
Normal file
10
lock_api/mutex/struct.MappedMutexGuard.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.MappedMutexGuard.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/struct.MappedMutexGuard.html">../../lock_api/struct.MappedMutexGuard.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/struct.MappedMutexGuard.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/mutex/struct.Mutex.html
Normal file
10
lock_api/mutex/struct.Mutex.html
Normal 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>
|
||||
10
lock_api/mutex/struct.MutexGuard.html
Normal file
10
lock_api/mutex/struct.MutexGuard.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.MutexGuard.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/struct.MutexGuard.html">../../lock_api/struct.MutexGuard.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/struct.MutexGuard.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/mutex/trait.RawMutex.html
Normal file
10
lock_api/mutex/trait.RawMutex.html
Normal 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>
|
||||
10
lock_api/mutex/trait.RawMutexFair.html
Normal file
10
lock_api/mutex/trait.RawMutexFair.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawMutexFair.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/trait.RawMutexFair.html">../../lock_api/trait.RawMutexFair.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/trait.RawMutexFair.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/mutex/trait.RawMutexTimed.html
Normal file
10
lock_api/mutex/trait.RawMutexTimed.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawMutexTimed.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/trait.RawMutexTimed.html">../../lock_api/trait.RawMutexTimed.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/trait.RawMutexTimed.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/remutex/struct.MappedReentrantMutexGuard.html
Normal file
10
lock_api/remutex/struct.MappedReentrantMutexGuard.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.MappedReentrantMutexGuard.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/struct.MappedReentrantMutexGuard.html">../../lock_api/struct.MappedReentrantMutexGuard.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/struct.MappedReentrantMutexGuard.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/remutex/struct.ReentrantMutex.html
Normal file
10
lock_api/remutex/struct.ReentrantMutex.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.ReentrantMutex.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/struct.ReentrantMutex.html">../../lock_api/struct.ReentrantMutex.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/struct.ReentrantMutex.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/remutex/struct.ReentrantMutexGuard.html
Normal file
10
lock_api/remutex/struct.ReentrantMutexGuard.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.ReentrantMutexGuard.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/struct.ReentrantMutexGuard.html">../../lock_api/struct.ReentrantMutexGuard.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/struct.ReentrantMutexGuard.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/remutex/trait.GetThreadId.html
Normal file
10
lock_api/remutex/trait.GetThreadId.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.GetThreadId.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/trait.GetThreadId.html">../../lock_api/trait.GetThreadId.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/trait.GetThreadId.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/rwlock/struct.MappedRwLockReadGuard.html
Normal file
10
lock_api/rwlock/struct.MappedRwLockReadGuard.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.MappedRwLockReadGuard.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/struct.MappedRwLockReadGuard.html">../../lock_api/struct.MappedRwLockReadGuard.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/struct.MappedRwLockReadGuard.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/rwlock/struct.MappedRwLockWriteGuard.html
Normal file
10
lock_api/rwlock/struct.MappedRwLockWriteGuard.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.MappedRwLockWriteGuard.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/struct.MappedRwLockWriteGuard.html">../../lock_api/struct.MappedRwLockWriteGuard.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/struct.MappedRwLockWriteGuard.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/rwlock/struct.RwLock.html
Normal file
10
lock_api/rwlock/struct.RwLock.html
Normal 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>
|
||||
10
lock_api/rwlock/struct.RwLockReadGuard.html
Normal file
10
lock_api/rwlock/struct.RwLockReadGuard.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.RwLockReadGuard.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/struct.RwLockReadGuard.html">../../lock_api/struct.RwLockReadGuard.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/struct.RwLockReadGuard.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/rwlock/struct.RwLockUpgradableReadGuard.html
Normal file
10
lock_api/rwlock/struct.RwLockUpgradableReadGuard.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.RwLockUpgradableReadGuard.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/struct.RwLockUpgradableReadGuard.html">../../lock_api/struct.RwLockUpgradableReadGuard.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/struct.RwLockUpgradableReadGuard.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/rwlock/struct.RwLockWriteGuard.html
Normal file
10
lock_api/rwlock/struct.RwLockWriteGuard.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/struct.RwLockWriteGuard.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/struct.RwLockWriteGuard.html">../../lock_api/struct.RwLockWriteGuard.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/struct.RwLockWriteGuard.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/rwlock/trait.RawRwLock.html
Normal file
10
lock_api/rwlock/trait.RawRwLock.html
Normal 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>
|
||||
10
lock_api/rwlock/trait.RawRwLockDowngrade.html
Normal file
10
lock_api/rwlock/trait.RawRwLockDowngrade.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawRwLockDowngrade.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/trait.RawRwLockDowngrade.html">../../lock_api/trait.RawRwLockDowngrade.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/trait.RawRwLockDowngrade.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/rwlock/trait.RawRwLockFair.html
Normal file
10
lock_api/rwlock/trait.RawRwLockFair.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawRwLockFair.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/trait.RawRwLockFair.html">../../lock_api/trait.RawRwLockFair.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/trait.RawRwLockFair.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/rwlock/trait.RawRwLockRecursive.html
Normal file
10
lock_api/rwlock/trait.RawRwLockRecursive.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawRwLockRecursive.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/trait.RawRwLockRecursive.html">../../lock_api/trait.RawRwLockRecursive.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/trait.RawRwLockRecursive.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/rwlock/trait.RawRwLockRecursiveTimed.html
Normal file
10
lock_api/rwlock/trait.RawRwLockRecursiveTimed.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawRwLockRecursiveTimed.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/trait.RawRwLockRecursiveTimed.html">../../lock_api/trait.RawRwLockRecursiveTimed.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/trait.RawRwLockRecursiveTimed.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/rwlock/trait.RawRwLockTimed.html
Normal file
10
lock_api/rwlock/trait.RawRwLockTimed.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawRwLockTimed.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/trait.RawRwLockTimed.html">../../lock_api/trait.RawRwLockTimed.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/trait.RawRwLockTimed.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/rwlock/trait.RawRwLockUpgrade.html
Normal file
10
lock_api/rwlock/trait.RawRwLockUpgrade.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawRwLockUpgrade.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/trait.RawRwLockUpgrade.html">../../lock_api/trait.RawRwLockUpgrade.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/trait.RawRwLockUpgrade.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/rwlock/trait.RawRwLockUpgradeDowngrade.html
Normal file
10
lock_api/rwlock/trait.RawRwLockUpgradeDowngrade.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawRwLockUpgradeDowngrade.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/trait.RawRwLockUpgradeDowngrade.html">../../lock_api/trait.RawRwLockUpgradeDowngrade.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/trait.RawRwLockUpgradeDowngrade.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/rwlock/trait.RawRwLockUpgradeFair.html
Normal file
10
lock_api/rwlock/trait.RawRwLockUpgradeFair.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawRwLockUpgradeFair.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/trait.RawRwLockUpgradeFair.html">../../lock_api/trait.RawRwLockUpgradeFair.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/trait.RawRwLockUpgradeFair.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
10
lock_api/rwlock/trait.RawRwLockUpgradeTimed.html
Normal file
10
lock_api/rwlock/trait.RawRwLockUpgradeTimed.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../lock_api/trait.RawRwLockUpgradeTimed.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../lock_api/trait.RawRwLockUpgradeTimed.html">../../lock_api/trait.RawRwLockUpgradeTimed.html</a>...</p>
|
||||
<script>location.replace("../../lock_api/trait.RawRwLockUpgradeTimed.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
1
lock_api/sidebar-items.js
Normal file
1
lock_api/sidebar-items.js
Normal file
@@ -0,0 +1 @@
|
||||
initSidebarItems({"struct":[["GuardNoSend","Marker type which indicates that the Guard type for a lock is not `Send`."],["GuardSend","Marker type which indicates that the Guard type for a lock is `Send`."],["MappedMutexGuard","An RAII mutex guard returned by `MutexGuard::map`, which can point to a subfield of the protected data."],["MappedReentrantMutexGuard","An RAII mutex guard returned by `ReentrantMutexGuard::map`, which can point to a subfield of the protected data."],["MappedRwLockReadGuard","An RAII read lock guard returned by `RwLockReadGuard::map`, which can point to a subfield of the protected data."],["MappedRwLockWriteGuard","An RAII write lock guard returned by `RwLockWriteGuard::map`, which can point to a subfield of the protected data."],["Mutex","A mutual exclusion primitive useful for protecting shared data"],["MutexGuard","An RAII implementation of a \"scoped lock\" of a mutex. When this structure is dropped (falls out of scope), the lock will be unlocked."],["ReentrantMutex","A mutex which can be recursively locked by a single thread."],["ReentrantMutexGuard","An RAII implementation of a \"scoped lock\" of a reentrant mutex. When this structure is dropped (falls out of scope), the lock will be unlocked."],["RwLock","A reader-writer lock"],["RwLockReadGuard","RAII structure used to release the shared read access of a lock when dropped."],["RwLockUpgradableReadGuard","RAII structure used to release the upgradable read access of a lock when dropped."],["RwLockWriteGuard","RAII structure used to release the exclusive write access of a lock when dropped."]],"trait":[["GetThreadId","Helper trait which returns a non-zero thread ID."],["RawMutex","Basic operations for a mutex."],["RawMutexFair","Additional methods for mutexes which support fair unlocking."],["RawMutexTimed","Additional methods for mutexes which support locking with timeouts."],["RawRwLock","Basic operations for a reader-writer lock."],["RawRwLockDowngrade","Additional methods for RwLocks which support atomically downgrading an exclusive lock to a shared lock."],["RawRwLockFair","Additional methods for RwLocks which support fair unlocking."],["RawRwLockRecursive","Additional methods for RwLocks which support recursive read locks."],["RawRwLockRecursiveTimed","Additional methods for RwLocks which support recursive read locks and timeouts."],["RawRwLockTimed","Additional methods for RwLocks which support locking with timeouts."],["RawRwLockUpgrade","Additional methods for RwLocks which support atomically upgrading a shared lock to an exclusive lock."],["RawRwLockUpgradeDowngrade","Additional methods for RwLocks which support upgradable locks and lock downgrading."],["RawRwLockUpgradeFair","Additional methods for RwLocks which support upgradable locks and fair unlocking."],["RawRwLockUpgradeTimed","Additional methods for RwLocks which support upgradable locks and locking with timeouts."]]});
|
||||
11
lock_api/struct.GuardNoSend.html
Normal file
11
lock_api/struct.GuardNoSend.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `GuardNoSend` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, GuardNoSend"><title>lock_api::GuardNoSend - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct GuardNoSend</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a><a href="#impl-Unpin">Unpin</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'GuardNoSend', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/lib.rs.html#98' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>GuardNoSend</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct GuardNoSend(_);</pre></div><div class='docblock'><p>Marker type which indicates that the Guard type for a lock is not <code>Send</code>.</p>
|
||||
</div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../lock_api/struct.GuardNoSend.html" title="struct lock_api::GuardNoSend">GuardNoSend</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../lock_api/struct.GuardNoSend.html" title="struct lock_api::GuardNoSend">GuardNoSend</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><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<T> <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> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <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#109-111' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> &T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </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#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> &mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> 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#564-568' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-567' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </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#553-560' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-559' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </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#601-610' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<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><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#607-609' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </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#587-596' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<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><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#593-595' 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><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
11
lock_api/struct.GuardSend.html
Normal file
11
lock_api/struct.GuardSend.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `GuardSend` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, GuardSend"><title>lock_api::GuardSend - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct GuardSend</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'GuardSend', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/lib.rs.html#95' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>GuardSend</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct GuardSend(_);</pre></div><div class='docblock'><p>Marker type which indicates that the Guard type for a lock is <code>Send</code>.</p>
|
||||
</div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-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<T> <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> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <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#109-111' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> &T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </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#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> &mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> 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#564-568' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-567' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </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#553-560' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-559' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </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#601-610' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<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><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#607-609' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </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#587-596' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<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><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#593-595' 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><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
46
lock_api/struct.MappedMutexGuard.html
Normal file
46
lock_api/struct.MappedMutexGuard.html
Normal file
@@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `MappedMutexGuard` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, MappedMutexGuard"><title>lock_api::MappedMutexGuard - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct MappedMutexGuard</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.map">map</a><a href="#method.try_map">try_map</a><a href="#method.unlock_fair">unlock_fair</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-DerefMut">DerefMut</a><a href="#impl-Display">Display</a><a href="#impl-Drop">Drop</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Unpin">Unpin</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'MappedMutexGuard', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/mutex.rs.html#506-510' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>MappedMutexGuard</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'><span class="docblock attributes top-attr">#[must_use = "if unused the Mutex will immediately unlock"]
|
||||
</span>pub struct MappedMutexGuard<'a, R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> { /* fields omitted */ }</pre></div><div class='docblock'><p>An RAII mutex guard returned by <code>MutexGuard::map</code>, which can point to a
|
||||
subfield of the protected data.</p>
|
||||
<p>The main difference between <code>MappedMutexGuard</code> and <code>MutexGuard</code> is that the
|
||||
former doesn't support temporarily unlocking and re-locking, since that
|
||||
could introduce soundness issues if the locked object is modified by another
|
||||
thread.</p>
|
||||
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl<'a, R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <a class="struct" href="../lock_api/struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a><'a, R, T></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#521-571' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.map' class="method"><code id='map.v'>pub fn <a href='#method.map' class='fnname'>map</a><U: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F>(s: Self, f: F) -> <a class="struct" href="../lock_api/struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a><'a, R, U> <span class="where fmt-newline">where<br> 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>(&mut T) -> &mut U, </span></code><a class='srclink' href='../src/lock_api/mutex.rs.html#531-543' title='goto source code'>[src]</a></h4><div class='docblock'><p>Makes a new <code>MappedMutexGuard</code> for a component of the locked data.</p>
|
||||
<p>This operation cannot fail as the <code>MappedMutexGuard</code> passed
|
||||
in already locked the mutex.</p>
|
||||
<p>This is an associated function that needs to be
|
||||
used as <code>MappedMutexGuard::map(...)</code>. A method would interfere with methods of
|
||||
the same name on the contents of the locked data.</p>
|
||||
</div><h4 id='method.try_map' class="method"><code id='try_map.v'>pub fn <a href='#method.try_map' class='fnname'>try_map</a><U: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F>(<br> s: Self, <br> f: F<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../lock_api/struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a><'a, R, U>, Self> <span class="where fmt-newline">where<br> 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>(&mut T) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&mut U>, </span></code><a class='srclink' href='../src/lock_api/mutex.rs.html#555-570' 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<'a, R: <a class="trait" href="../lock_api/trait.RawMutexFair.html" title="trait lock_api::RawMutexFair">RawMutexFair</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <a class="struct" href="../lock_api/struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a><'a, R, T></code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#573-591' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.unlock_fair' class="method"><code id='unlock_fair.v'>pub fn <a href='#method.unlock_fair' class='fnname'>unlock_fair</a>(s: Self)</code><a class='srclink' href='../src/lock_api/mutex.rs.html#587-590' title='goto source code'>[src]</a></h4><div class='docblock'><p>Unlocks the mutex using a fair unlock protocol.</p>
|
||||
<p>By default, mutexes are unfair and allow the current thread to re-lock
|
||||
the mutex before another has the chance to acquire the lock, even if
|
||||
that thread has been blocked on the mutex for a long time. This is the
|
||||
default because it allows much higher throughput as it avoids forcing a
|
||||
context switch on every mutex unlock. This can result in one thread
|
||||
acquiring a mutex many more times than other threads.</p>
|
||||
<p>However in some cases it can be beneficial to ensure fairness by forcing
|
||||
the lock to pass on to a waiting thread if there is one. This is done by
|
||||
using this method instead of dropping the <code>MutexGuard</code> normally.</p>
|
||||
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl<'a, R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T: <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> <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><'a, R, T></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#615-619' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <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#616-618' 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<'a, R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <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><'a, R, T></code><a href='#impl-Deref' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#593-599' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><code id='Target.t'>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = T</code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||||
</div><h4 id='method.deref' class="method hidden"><code id='deref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&self) -> &T</code><a class='srclink' href='../src/lock_api/mutex.rs.html#596-598' 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<'a, R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <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><'a, R, T></code><a href='#impl-DerefMut' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#601-606' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deref_mut' class="method hidden"><code id='deref_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html#tymethod.deref_mut' class='fnname'>deref_mut</a>(&mut self) -> &mut T</code><a class='srclink' href='../src/lock_api/mutex.rs.html#603-605' 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<'a, R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T: <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> <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><'a, R, T></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#621-627' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <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#624-626' 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<'a, R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <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><'a, R, T></code><a href='#impl-Drop' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#608-613' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.drop' class="method hidden"><code id='drop.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&mut self)</code><a class='srclink' href='../src/lock_api/mutex.rs.html#610-612' 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<'a, R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <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><'a, R, T> <span class="where fmt-newline">where<br> 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>, </span></code><a href='#impl-Send' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#516-519' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl<'a, R: <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: ?<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> <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><'a, R, T></code><a href='#impl-Sync' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#512-515' 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<'a, R, T: ?<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.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><'a, R, T></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<T> <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> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <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#109-111' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> &T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </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#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> &mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> 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#564-568' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-567' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </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#553-560' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-559' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </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#601-610' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<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><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#607-609' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </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#587-596' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<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><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#593-595' 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><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
45
lock_api/struct.MappedReentrantMutexGuard.html
Normal file
45
lock_api/struct.MappedReentrantMutexGuard.html
Normal file
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `MappedReentrantMutexGuard` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, MappedReentrantMutexGuard"><title>lock_api::MappedReentrantMutexGuard - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct MappedReentrantMutexGuard</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.map">map</a><a href="#method.try_map">try_map</a><a href="#method.unlock_fair">unlock_fair</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-Display">Display</a><a href="#impl-Drop">Drop</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">!Send</a><a href="#impl-Unpin">Unpin</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'MappedReentrantMutexGuard', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/remutex.rs.html#591-595' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>MappedReentrantMutexGuard</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'><span class="docblock attributes top-attr">#[must_use = "if unused the ReentrantMutex will immediately unlock"]
|
||||
</span>pub struct MappedReentrantMutexGuard<'a, R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, G: <a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a>, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> { /* fields omitted */ }</pre></div><div class='docblock'><p>An RAII mutex guard returned by <code>ReentrantMutexGuard::map</code>, which can point to a
|
||||
subfield of the protected data.</p>
|
||||
<p>The main difference between <code>MappedReentrantMutexGuard</code> and <code>ReentrantMutexGuard</code> is that the
|
||||
former doesn't support temporarily unlocking and re-locking, since that
|
||||
could introduce soundness issues if the locked object is modified by another
|
||||
thread.</p>
|
||||
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl<'a, R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G: <a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <a class="struct" href="../lock_api/struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a><'a, R, G, T></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#602-657' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.map' class="method"><code id='map.v'>pub fn <a href='#method.map' class='fnname'>map</a><U: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F>(<br> s: Self, <br> f: F<br>) -> <a class="struct" href="../lock_api/struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a><'a, R, G, U> <span class="where fmt-newline">where<br> 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>(&T) -> &U, </span></code><a class='srclink' href='../src/lock_api/remutex.rs.html#614-626' title='goto source code'>[src]</a></h4><div class='docblock'><p>Makes a new <code>MappedReentrantMutexGuard</code> for a component of the locked data.</p>
|
||||
<p>This operation cannot fail as the <code>MappedReentrantMutexGuard</code> passed
|
||||
in already locked the mutex.</p>
|
||||
<p>This is an associated function that needs to be
|
||||
used as <code>MappedReentrantMutexGuard::map(...)</code>. A method would interfere with methods of
|
||||
the same name on the contents of the locked data.</p>
|
||||
</div><h4 id='method.try_map' class="method"><code id='try_map.v'>pub fn <a href='#method.try_map' class='fnname'>try_map</a><U: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F>(<br> s: Self, <br> f: F<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../lock_api/struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a><'a, R, G, U>, Self> <span class="where fmt-newline">where<br> 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>(&T) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&U>, </span></code><a class='srclink' href='../src/lock_api/remutex.rs.html#638-656' 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<'a, R: <a class="trait" href="../lock_api/trait.RawMutexFair.html" title="trait lock_api::RawMutexFair">RawMutexFair</a> + 'a, G: <a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <a class="struct" href="../lock_api/struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a><'a, R, G, T></code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#659-679' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.unlock_fair' class="method"><code id='unlock_fair.v'>pub fn <a href='#method.unlock_fair' class='fnname'>unlock_fair</a>(s: Self)</code><a class='srclink' href='../src/lock_api/remutex.rs.html#675-678' title='goto source code'>[src]</a></h4><div class='docblock'><p>Unlocks the mutex using a fair unlock protocol.</p>
|
||||
<p>By default, mutexes are unfair and allow the current thread to re-lock
|
||||
the mutex before another has the chance to acquire the lock, even if
|
||||
that thread has been blocked on the mutex for a long time. This is the
|
||||
default because it allows much higher throughput as it avoids forcing a
|
||||
context switch on every mutex unlock. This can result in one thread
|
||||
acquiring a mutex many more times than other threads.</p>
|
||||
<p>However in some cases it can be beneficial to ensure fairness by forcing
|
||||
the lock to pass on to a waiting thread if there is one. This is done by
|
||||
using this method instead of dropping the <code>ReentrantMutexGuard</code> normally.</p>
|
||||
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl<'a, R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G: <a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T: <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> <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><'a, R, G, T></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#700-706' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <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#703-705' 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<'a, R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G: <a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <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><'a, R, G, T></code><a href='#impl-Deref' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#681-689' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><code id='Target.t'>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = T</code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||||
</div><h4 id='method.deref' class="method hidden"><code id='deref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&self) -> &T</code><a class='srclink' href='../src/lock_api/remutex.rs.html#686-688' 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<'a, R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G: <a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T: <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> <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><'a, R, G, T></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#708-714' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <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#711-713' 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<'a, R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G: <a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <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><'a, R, G, T></code><a href='#impl-Drop' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#691-698' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.drop' class="method hidden"><code id='drop.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&mut self)</code><a class='srclink' href='../src/lock_api/remutex.rs.html#695-697' 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<'a, R: <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: <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: ?<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> <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><'a, R, G, T></code><a href='#impl-Sync' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#597-600' 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, R, G, T> !<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><'a, R, G, T></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, R, G, T: ?<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.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><'a, R, G, T></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<T> <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> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <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#109-111' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> &T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </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#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> &mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> 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#564-568' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-567' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </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#553-560' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-559' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </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#601-610' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<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><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#607-609' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </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#587-596' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<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><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#593-595' 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><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
45
lock_api/struct.MappedRwLockReadGuard.html
Normal file
45
lock_api/struct.MappedRwLockReadGuard.html
Normal file
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `MappedRwLockReadGuard` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, MappedRwLockReadGuard"><title>lock_api::MappedRwLockReadGuard - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct MappedRwLockReadGuard</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.map">map</a><a href="#method.try_map">try_map</a><a href="#method.unlock_fair">unlock_fair</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-Display">Display</a><a href="#impl-Drop">Drop</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Unpin">Unpin</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'MappedRwLockReadGuard', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#1335-1339' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>MappedRwLockReadGuard</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'><span class="docblock attributes top-attr">#[must_use = "if unused the RwLock will immediately unlock"]
|
||||
</span>pub struct MappedRwLockReadGuard<'a, R: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a>, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> { /* fields omitted */ }</pre></div><div class='docblock'><p>An RAII read lock guard returned by <code>RwLockReadGuard::map</code>, which can point to a
|
||||
subfield of the protected data.</p>
|
||||
<p>The main difference between <code>MappedRwLockReadGuard</code> and <code>RwLockReadGuard</code> is that the
|
||||
former doesn't support temporarily unlocking and re-locking, since that
|
||||
could introduce soundness issues if the locked object is modified by another
|
||||
thread.</p>
|
||||
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl<'a, R: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <a class="struct" href="../lock_api/struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a><'a, R, T></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1347-1397' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.map' class="method"><code id='map.v'>pub fn <a href='#method.map' class='fnname'>map</a><U: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F>(s: Self, f: F) -> <a class="struct" href="../lock_api/struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a><'a, R, U> <span class="where fmt-newline">where<br> 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>(&T) -> &U, </span></code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1357-1369' title='goto source code'>[src]</a></h4><div class='docblock'><p>Make a new <code>MappedRwLockReadGuard</code> for a component of the locked data.</p>
|
||||
<p>This operation cannot fail as the <code>MappedRwLockReadGuard</code> passed
|
||||
in already locked the data.</p>
|
||||
<p>This is an associated function that needs to be
|
||||
used as <code>MappedRwLockReadGuard::map(...)</code>. A method would interfere with methods of
|
||||
the same name on the contents of the locked data.</p>
|
||||
</div><h4 id='method.try_map' class="method"><code id='try_map.v'>pub fn <a href='#method.try_map' class='fnname'>try_map</a><U: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F>(<br> s: Self, <br> f: F<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../lock_api/struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a><'a, R, U>, Self> <span class="where fmt-newline">where<br> 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>(&T) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&U>, </span></code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1381-1396' 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<'a, R: <a class="trait" href="../lock_api/trait.RawRwLockFair.html" title="trait lock_api::RawRwLockFair">RawRwLockFair</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <a class="struct" href="../lock_api/struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a><'a, R, T></code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1399-1417' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.unlock_fair' class="method"><code id='unlock_fair.v'>pub fn <a href='#method.unlock_fair' class='fnname'>unlock_fair</a>(s: Self)</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1413-1416' title='goto source code'>[src]</a></h4><div class='docblock'><p>Unlocks the <code>RwLock</code> using a fair unlock protocol.</p>
|
||||
<p>By default, <code>RwLock</code> is unfair and allow the current thread to re-lock
|
||||
the <code>RwLock</code> before another has the chance to acquire the lock, even if
|
||||
that thread has been blocked on the <code>RwLock</code> for a long time. This is
|
||||
the default because it allows much higher throughput as it avoids
|
||||
forcing a context switch on every <code>RwLock</code> unlock. This can result in one
|
||||
thread acquiring a <code>RwLock</code> many more times than other threads.</p>
|
||||
<p>However in some cases it can be beneficial to ensure fairness by forcing
|
||||
the lock to pass on to a waiting thread if there is one. This is done by
|
||||
using this method instead of dropping the <code>MappedRwLockReadGuard</code> normally.</p>
|
||||
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl<'a, R: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T: <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> <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><'a, R, T></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1434-1440' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <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#1437-1439' 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<'a, R: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <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><'a, R, T></code><a href='#impl-Deref' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1419-1425' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><code id='Target.t'>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = T</code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||||
</div><h4 id='method.deref' class="method hidden"><code id='deref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&self) -> &T</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1422-1424' 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<'a, R: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T: <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> <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><'a, R, T></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1442-1448' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <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#1445-1447' 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<'a, R: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <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><'a, R, T></code><a href='#impl-Drop' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1427-1432' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.drop' class="method hidden"><code id='drop.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&mut self)</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1429-1431' 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<'a, R: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <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><'a, R, T> <span class="where fmt-newline">where<br> 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>, </span></code><a href='#impl-Send' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1342-1345' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl<'a, R: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T: ?<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> <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><'a, R, T></code><a href='#impl-Sync' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1341' 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<'a, R, T: ?<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.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><'a, R, T></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<T> <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> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <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#109-111' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> &T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </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#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> &mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> 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#564-568' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-567' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </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#553-560' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-559' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </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#601-610' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<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><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#607-609' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </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#587-596' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<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><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#593-595' 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><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
52
lock_api/struct.MappedRwLockWriteGuard.html
Normal file
52
lock_api/struct.MappedRwLockWriteGuard.html
Normal file
@@ -0,0 +1,52 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `MappedRwLockWriteGuard` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, MappedRwLockWriteGuard"><title>lock_api::MappedRwLockWriteGuard - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct MappedRwLockWriteGuard</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.downgrade">downgrade</a><a href="#method.map">map</a><a href="#method.try_map">try_map</a><a href="#method.unlock_fair">unlock_fair</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-DerefMut">DerefMut</a><a href="#impl-Display">Display</a><a href="#impl-Drop">Drop</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Unpin">Unpin</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'MappedRwLockWriteGuard', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#1464-1468' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>MappedRwLockWriteGuard</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'><span class="docblock attributes top-attr">#[must_use = "if unused the RwLock will immediately unlock"]
|
||||
</span>pub struct MappedRwLockWriteGuard<'a, R: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a>, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> { /* fields omitted */ }</pre></div><div class='docblock'><p>An RAII write lock guard returned by <code>RwLockWriteGuard::map</code>, which can point to a
|
||||
subfield of the protected data.</p>
|
||||
<p>The main difference between <code>MappedRwLockWriteGuard</code> and <code>RwLockWriteGuard</code> is that the
|
||||
former doesn't support temporarily unlocking and re-locking, since that
|
||||
could introduce soundness issues if the locked object is modified by another
|
||||
thread.</p>
|
||||
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl<'a, R: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <a class="struct" href="../lock_api/struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a><'a, R, T></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1479-1529' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.map' class="method"><code id='map.v'>pub fn <a href='#method.map' class='fnname'>map</a><U: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F>(s: Self, f: F) -> <a class="struct" href="../lock_api/struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a><'a, R, U> <span class="where fmt-newline">where<br> 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>(&mut T) -> &mut U, </span></code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1489-1501' title='goto source code'>[src]</a></h4><div class='docblock'><p>Make a new <code>MappedRwLockWriteGuard</code> for a component of the locked data.</p>
|
||||
<p>This operation cannot fail as the <code>MappedRwLockWriteGuard</code> passed
|
||||
in already locked the data.</p>
|
||||
<p>This is an associated function that needs to be
|
||||
used as <code>MappedRwLockWriteGuard::map(...)</code>. A method would interfere with methods of
|
||||
the same name on the contents of the locked data.</p>
|
||||
</div><h4 id='method.try_map' class="method"><code id='try_map.v'>pub fn <a href='#method.try_map' class='fnname'>try_map</a><U: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F>(<br> s: Self, <br> f: F<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../lock_api/struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a><'a, R, U>, Self> <span class="where fmt-newline">where<br> 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>(&mut T) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&mut U>, </span></code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1513-1528' 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<'a, R: <a class="trait" href="../lock_api/trait.RawRwLockDowngrade.html" title="trait lock_api::RawRwLockDowngrade">RawRwLockDowngrade</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <a class="struct" href="../lock_api/struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a><'a, R, T></code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1531-1553' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.downgrade' class="method"><code id='downgrade.v'>pub fn <a href='#method.downgrade' class='fnname'>downgrade</a>(s: Self) -> <a class="struct" href="../lock_api/struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a><'a, R, T></code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1542-1552' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab deprecated'>Deprecated since 0.3.3: <p>This function is unsound and will be removed in the future, see issue #198</p>
|
||||
</div></div><div class='docblock'><p>Atomically downgrades a write lock into a read lock without allowing any
|
||||
writers to take exclusive access of the lock in the meantime.</p>
|
||||
<p>Note that if there are any writers currently waiting to take the lock
|
||||
then other readers may not be able to acquire the lock even if it was
|
||||
downgraded.</p>
|
||||
</div></div><h3 id='impl-2' class='impl'><code class='in-band'>impl<'a, R: <a class="trait" href="../lock_api/trait.RawRwLockFair.html" title="trait lock_api::RawRwLockFair">RawRwLockFair</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <a class="struct" href="../lock_api/struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a><'a, R, T></code><a href='#impl-2' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1555-1573' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.unlock_fair' class="method"><code id='unlock_fair.v'>pub fn <a href='#method.unlock_fair' class='fnname'>unlock_fair</a>(s: Self)</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1569-1572' title='goto source code'>[src]</a></h4><div class='docblock'><p>Unlocks the <code>RwLock</code> using a fair unlock protocol.</p>
|
||||
<p>By default, <code>RwLock</code> is unfair and allow the current thread to re-lock
|
||||
the <code>RwLock</code> before another has the chance to acquire the lock, even if
|
||||
that thread has been blocked on the <code>RwLock</code> for a long time. This is
|
||||
the default because it allows much higher throughput as it avoids
|
||||
forcing a context switch on every <code>RwLock</code> unlock. This can result in one
|
||||
thread acquiring a <code>RwLock</code> many more times than other threads.</p>
|
||||
<p>However in some cases it can be beneficial to ensure fairness by forcing
|
||||
the lock to pass on to a waiting thread if there is one. This is done by
|
||||
using this method instead of dropping the <code>MappedRwLockWriteGuard</code> normally.</p>
|
||||
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl<'a, R: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T: <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> <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><'a, R, T></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1597-1603' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <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#1600-1602' 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<'a, R: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <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><'a, R, T></code><a href='#impl-Deref' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1575-1581' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><code id='Target.t'>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = T</code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||||
</div><h4 id='method.deref' class="method hidden"><code id='deref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&self) -> &T</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1578-1580' 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<'a, R: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <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><'a, R, T></code><a href='#impl-DerefMut' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1583-1588' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deref_mut' class="method hidden"><code id='deref_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html#tymethod.deref_mut' class='fnname'>deref_mut</a>(&mut self) -> &mut T</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1585-1587' 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<'a, R: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T: <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> <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><'a, R, T></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1605-1611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <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#1608-1610' 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<'a, R: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <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><'a, R, T></code><a href='#impl-Drop' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1590-1595' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.drop' class="method hidden"><code id='drop.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&mut self)</code><a class='srclink' href='../src/lock_api/rwlock.rs.html#1592-1594' 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<'a, R: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <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><'a, R, T> <span class="where fmt-newline">where<br> 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>, </span></code><a href='#impl-Send' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1474-1477' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl<'a, R: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T: ?<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> <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><'a, R, T></code><a href='#impl-Sync' class='anchor'></a><a class='srclink' href='../src/lock_api/rwlock.rs.html#1470-1473' 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<'a, R, T: ?<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.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><'a, R, T></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<T> <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> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <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#109-111' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> &T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </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#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> &mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> 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#564-568' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-567' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </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#553-560' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-559' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </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#601-610' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<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><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#607-609' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </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#587-596' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<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><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#593-595' 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><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
68
lock_api/struct.Mutex.html
Normal file
68
lock_api/struct.Mutex.html
Normal file
@@ -0,0 +1,68 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Mutex` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, Mutex"><title>lock_api::Mutex - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Mutex</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.force_unlock">force_unlock</a><a href="#method.force_unlock_fair">force_unlock_fair</a><a href="#method.get_mut">get_mut</a><a href="#method.into_inner">into_inner</a><a href="#method.lock">lock</a><a href="#method.new">new</a><a href="#method.raw">raw</a><a href="#method.try_lock">try_lock</a><a href="#method.try_lock_for">try_lock_for</a><a href="#method.try_lock_until">try_lock_until</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-From%3CT%3E">From<T></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<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3C!%3E">From<!></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'Mutex', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/mutex.rs.html#97-100' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>Mutex</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Mutex<R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> { /* fields omitted */ }</pre></div><div class='docblock'><p>A mutual exclusion primitive useful for protecting shared data</p>
|
||||
<p>This mutex will block threads waiting for the lock to become available. The
|
||||
mutex can also be statically initialized or created via a <code>new</code>
|
||||
constructor. Each mutex has a type parameter which represents the data that
|
||||
it is protecting. The data can only be accessed through the RAII guards
|
||||
returned from <code>lock</code> and <code>try_lock</code>, which guarantees that the data is only
|
||||
ever accessed when the mutex is locked.</p>
|
||||
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl<R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T> <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a><R, T></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#105-131' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code id='new.v'>pub fn <a href='#method.new' class='fnname'>new</a>(val: T) -> <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a><R, T></code><a class='srclink' href='../src/lock_api/mutex.rs.html#119-124' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates a new mutex in an unlocked state ready for use.</p>
|
||||
</div><h4 id='method.into_inner' class="method"><code id='into_inner.v'>pub fn <a href='#method.into_inner' class='fnname'>into_inner</a>(self) -> T</code><a class='srclink' href='../src/lock_api/mutex.rs.html#128-130' 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<R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a><R, T></code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#133-216' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.lock' class="method"><code id='lock.v'>pub fn <a href='#method.lock' class='fnname'>lock</a>(&self) -> <a class="struct" href="../lock_api/struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a><R, T></code><a class='srclink' href='../src/lock_api/mutex.rs.html#155-159' title='goto source code'>[src]</a></h4><div class='docblock'><p>Acquires a mutex, blocking the current thread until it is able to do so.</p>
|
||||
<p>This function will block the local thread until it is available to acquire
|
||||
the mutex. Upon returning, the thread is the only thread with the mutex
|
||||
held. An RAII guard is returned to allow scoped unlock of the lock. When
|
||||
the guard goes out of scope, the mutex will be unlocked.</p>
|
||||
<p>Attempts to lock a mutex in the thread which already holds the lock will
|
||||
result in a deadlock.</p>
|
||||
</div><h4 id='method.try_lock' class="method"><code id='try_lock.v'>pub fn <a href='#method.try_lock' class='fnname'>try_lock</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../lock_api/struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a><R, T>></code><a class='srclink' href='../src/lock_api/mutex.rs.html#169-176' title='goto source code'>[src]</a></h4><div class='docblock'><p>Attempts to acquire this lock.</p>
|
||||
<p>If the lock could not be acquired at this time, then <code>None</code> is returned.
|
||||
Otherwise, an RAII guard is returned. The lock will be unlocked when the
|
||||
guard is dropped.</p>
|
||||
<p>This function does not block.</p>
|
||||
</div><h4 id='method.get_mut' class="method"><code id='get_mut.v'>pub fn <a href='#method.get_mut' class='fnname'>get_mut</a>(&mut self) -> &mut T</code><a class='srclink' href='../src/lock_api/mutex.rs.html#183-185' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a mutable reference to the underlying data.</p>
|
||||
<p>Since this call borrows the <code>Mutex</code> mutably, no actual locking needs to
|
||||
take place---the mutable borrow statically guarantees no locks exist.</p>
|
||||
</div><h4 id='method.force_unlock' class="method"><code id='force_unlock.v'>pub unsafe fn <a href='#method.force_unlock' class='fnname'>force_unlock</a>(&self)</code><a class='srclink' href='../src/lock_api/mutex.rs.html#199-201' title='goto source code'>[src]</a></h4><div class='docblock'><p>Forcibly unlocks the mutex.</p>
|
||||
<p>This is useful when combined with <code>mem::forget</code> to hold a lock without
|
||||
the need to maintain a <code>MutexGuard</code> object alive, for example when
|
||||
dealing with FFI.</p>
|
||||
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
|
||||
<p>This method must only be called if the current thread logically owns a
|
||||
<code>MutexGuard</code> but that guard has be discarded using <code>mem::forget</code>.
|
||||
Behavior is undefined if a mutex is unlocked when not locked.</p>
|
||||
</div><h4 id='method.raw' class="method"><code id='raw.v'>pub unsafe fn <a href='#method.raw' class='fnname'>raw</a>(&self) -> &R</code><a class='srclink' href='../src/lock_api/mutex.rs.html#213-215' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the underlying raw mutex object.</p>
|
||||
<p>Note that you will most likely need to import the <code>RawMutex</code> trait from
|
||||
<code>lock_api</code> to be able to call functions on the raw mutex.</p>
|
||||
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
|
||||
<p>This method is unsafe because it allows unlocking a mutex while
|
||||
still holding a reference to a <code>MutexGuard</code>.</p>
|
||||
</div></div><h3 id='impl-2' class='impl'><code class='in-band'>impl<R: <a class="trait" href="../lock_api/trait.RawMutexFair.html" title="trait lock_api::RawMutexFair">RawMutexFair</a>, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a><R, T></code><a href='#impl-2' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#218-234' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.force_unlock_fair' class="method"><code id='force_unlock_fair.v'>pub unsafe fn <a href='#method.force_unlock_fair' class='fnname'>force_unlock_fair</a>(&self)</code><a class='srclink' href='../src/lock_api/mutex.rs.html#231-233' title='goto source code'>[src]</a></h4><div class='docblock'><p>Forcibly unlocks the mutex using a fair unlock procotol.</p>
|
||||
<p>This is useful when combined with <code>mem::forget</code> to hold a lock without
|
||||
the need to maintain a <code>MutexGuard</code> object alive, for example when
|
||||
dealing with FFI.</p>
|
||||
<h1 id="safety-2" class="section-header"><a href="#safety-2">Safety</a></h1>
|
||||
<p>This method must only be called if the current thread logically owns a
|
||||
<code>MutexGuard</code> but that guard has be discarded using <code>mem::forget</code>.
|
||||
Behavior is undefined if a mutex is unlocked when not locked.</p>
|
||||
</div></div><h3 id='impl-3' class='impl'><code class='in-band'>impl<R: <a class="trait" href="../lock_api/trait.RawMutexTimed.html" title="trait lock_api::RawMutexTimed">RawMutexTimed</a>, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a><R, T></code><a href='#impl-3' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#236-266' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.try_lock_for' class="method"><code id='try_lock_for.v'>pub fn <a href='#method.try_lock_for' class='fnname'>try_lock_for</a>(&self, timeout: R::<a class="type" href="../lock_api/trait.RawMutexTimed.html#associatedtype.Duration" title="type lock_api::RawMutexTimed::Duration">Duration</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../lock_api/struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a><R, T>></code><a class='srclink' href='../src/lock_api/mutex.rs.html#243-250' title='goto source code'>[src]</a></h4><div class='docblock'><p>Attempts to acquire this lock until a timeout is reached.</p>
|
||||
<p>If the lock could not be acquired before the timeout expired, then
|
||||
<code>None</code> is returned. Otherwise, an RAII guard is returned. The lock will
|
||||
be unlocked when the guard is dropped.</p>
|
||||
</div><h4 id='method.try_lock_until' class="method"><code id='try_lock_until.v'>pub fn <a href='#method.try_lock_until' class='fnname'>try_lock_until</a>(&self, timeout: R::<a class="type" href="../lock_api/trait.RawMutexTimed.html#associatedtype.Instant" title="type lock_api::RawMutexTimed::Instant">Instant</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../lock_api/struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a><R, T>></code><a class='srclink' href='../src/lock_api/mutex.rs.html#258-265' title='goto source code'>[src]</a></h4><div class='docblock'><p>Attempts to acquire this lock until a timeout is reached.</p>
|
||||
<p>If the lock could not be acquired before the timeout expired, then
|
||||
<code>None</code> is returned. Otherwise, an RAII guard is returned. The lock will
|
||||
be unlocked when the guard is dropped.</p>
|
||||
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl<R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T: ?<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>> <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><R, T></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#282-300' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <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#283-299' 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<R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T: ?<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>> <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><R, T></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#268-273' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a><R, T></code><a class='srclink' href='../src/lock_api/mutex.rs.html#270-272' 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<R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a><R, T></code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#275-280' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a><R, T></code><a class='srclink' href='../src/lock_api/mutex.rs.html#277-279' 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<R: <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: ?<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.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><R, T></code><a href='#impl-Send' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#102' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl<R: <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: ?<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> for <a class="struct" href="../lock_api/struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a><R, T></code><a href='#impl-Sync' class='anchor'></a><a class='srclink' href='../src/lock_api/mutex.rs.html#103' 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<R, T: ?<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.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><R, T> <span class="where fmt-newline">where<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </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<T> <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> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <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#109-111' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> &T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </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#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> &mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><!> 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#579-583' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: !) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#580-582' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> 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#564-568' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-2' class="method hidden"><code id='from.v-2'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-567' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </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#553-560' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-559' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </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#601-610' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<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><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#607-609' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </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#587-596' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<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><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#593-595' 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><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
56
lock_api/struct.MutexGuard.html
Normal file
56
lock_api/struct.MutexGuard.html
Normal file
File diff suppressed because one or more lines are too long
73
lock_api/struct.ReentrantMutex.html
Normal file
73
lock_api/struct.ReentrantMutex.html
Normal file
File diff suppressed because one or more lines are too long
55
lock_api/struct.ReentrantMutexGuard.html
Normal file
55
lock_api/struct.ReentrantMutexGuard.html
Normal file
@@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ReentrantMutexGuard` struct in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, ReentrantMutexGuard"><title>lock_api::ReentrantMutexGuard - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct ReentrantMutexGuard</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.bump">bump</a><a href="#method.map">map</a><a href="#method.remutex">remutex</a><a href="#method.try_map">try_map</a><a href="#method.unlock_fair">unlock_fair</a><a href="#method.unlocked">unlocked</a><a href="#method.unlocked_fair">unlocked_fair</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-Display">Display</a><a href="#impl-Drop">Drop</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">!Send</a><a href="#impl-Unpin">Unpin</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'ReentrantMutexGuard', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/remutex.rs.html#410-413' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>lock_api</a>::<wbr><a class="struct" href=''>ReentrantMutexGuard</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'><span class="docblock attributes top-attr">#[must_use = "if unused the ReentrantMutex will immediately unlock"]
|
||||
</span>pub struct ReentrantMutexGuard<'a, R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, G: <a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a>, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> { /* 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='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl<'a, R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G: <a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <a class="struct" href="../lock_api/struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a><'a, R, G, T></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#420-492' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.remutex' class="method"><code id='remutex.v'>pub fn <a href='#method.remutex' class='fnname'>remutex</a>(s: &Self) -> &'a <a class="struct" href="../lock_api/struct.ReentrantMutex.html" title="struct lock_api::ReentrantMutex">ReentrantMutex</a><R, G, T></code><a class='srclink' href='../src/lock_api/remutex.rs.html#422-424' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a reference to the original <code>ReentrantMutex</code> object.</p>
|
||||
</div><h4 id='method.map' class="method"><code id='map.v'>pub fn <a href='#method.map' class='fnname'>map</a><U: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F>(<br> s: Self, <br> f: F<br>) -> <a class="struct" href="../lock_api/struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a><'a, R, G, U> <span class="where fmt-newline">where<br> 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>(&T) -> &U, </span></code><a class='srclink' href='../src/lock_api/remutex.rs.html#435-447' title='goto source code'>[src]</a></h4><div class='docblock'><p>Makes a new <code>MappedReentrantMutexGuard</code> for a component of the locked data.</p>
|
||||
<p>This operation cannot fail as the <code>ReentrantMutexGuard</code> passed
|
||||
in already locked the mutex.</p>
|
||||
<p>This is an associated function that needs to be
|
||||
used as <code>ReentrantMutexGuard::map(...)</code>. A method would interfere with methods of
|
||||
the same name on the contents of the locked data.</p>
|
||||
</div><h4 id='method.try_map' class="method"><code id='try_map.v'>pub fn <a href='#method.try_map' class='fnname'>try_map</a><U: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F>(<br> s: Self, <br> f: F<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../lock_api/struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a><'a, R, G, U>, Self> <span class="where fmt-newline">where<br> 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>(&mut T) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&mut U>, </span></code><a class='srclink' href='../src/lock_api/remutex.rs.html#459-477' title='goto source code'>[src]</a></h4><div class='docblock'><p>Attempts to make a new <code>MappedReentrantMutexGuard</code> for a component of the
|
||||
locked data. The original guard is return if the closure returns <code>None</code>.</p>
|
||||
<p>This operation cannot fail as the <code>ReentrantMutexGuard</code> passed
|
||||
in already locked the mutex.</p>
|
||||
<p>This is an associated function that needs to be
|
||||
used as <code>ReentrantMutexGuard::map(...)</code>. A method would interfere with methods of
|
||||
the same name on the contents of the locked data.</p>
|
||||
</div><h4 id='method.unlocked' class="method"><code id='unlocked.v'>pub fn <a href='#method.unlocked' class='fnname'>unlocked</a><F, U>(s: &mut Self, f: F) -> U <span class="where fmt-newline">where<br> 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>() -> U, </span></code><a class='srclink' href='../src/lock_api/remutex.rs.html#484-491' 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>&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<'a, R: <a class="trait" href="../lock_api/trait.RawMutexFair.html" title="trait lock_api::RawMutexFair">RawMutexFair</a> + 'a, G: <a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <a class="struct" href="../lock_api/struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a><'a, R, G, T></code><a href='#impl-1' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#494-540' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.unlock_fair' class="method"><code id='unlock_fair.v'>pub fn <a href='#method.unlock_fair' class='fnname'>unlock_fair</a>(s: Self)</code><a class='srclink' href='../src/lock_api/remutex.rs.html#510-513' title='goto source code'>[src]</a></h4><div class='docblock'><p>Unlocks the mutex using a fair unlock protocol.</p>
|
||||
<p>By default, mutexes are unfair and allow the current thread to re-lock
|
||||
the mutex before another has the chance to acquire the lock, even if
|
||||
that thread has been blocked on the mutex for a long time. This is the
|
||||
default because it allows much higher throughput as it avoids forcing a
|
||||
context switch on every mutex unlock. This can result in one thread
|
||||
acquiring a mutex many more times than other threads.</p>
|
||||
<p>However in some cases it can be beneficial to ensure fairness by forcing
|
||||
the lock to pass on to a waiting thread if there is one. This is done by
|
||||
using this method instead of dropping the <code>ReentrantMutexGuard</code> normally.</p>
|
||||
</div><h4 id='method.unlocked_fair' class="method"><code id='unlocked_fair.v'>pub fn <a href='#method.unlocked_fair' class='fnname'>unlocked_fair</a><F, U>(s: &mut Self, f: F) -> U <span class="where fmt-newline">where<br> 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>() -> U, </span></code><a class='srclink' href='../src/lock_api/remutex.rs.html#522-529' 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>&mut</code> guarantees that there exist no other
|
||||
references to the data protected by the mutex.</p>
|
||||
</div><h4 id='method.bump' class="method"><code id='bump.v'>pub fn <a href='#method.bump' class='fnname'>bump</a>(s: &mut Self)</code><a class='srclink' href='../src/lock_api/remutex.rs.html#537-539' title='goto source code'>[src]</a></h4><div class='docblock'><p>Temporarily yields the mutex to a waiting thread if there is one.</p>
|
||||
<p>This method is functionally equivalent to calling <code>unlock_fair</code> followed
|
||||
by <code>lock</code>, however it can be much more efficient in the case where there
|
||||
are no waiting threads.</p>
|
||||
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl<'a, R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G: <a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T: <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> <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><'a, R, G, T></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#561-567' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <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#564-566' 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<'a, R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G: <a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <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><'a, R, G, T></code><a href='#impl-Deref' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#542-550' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><code id='Target.t'>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = T</code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||||
</div><h4 id='method.deref' class="method hidden"><code id='deref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&self) -> &T</code><a class='srclink' href='../src/lock_api/remutex.rs.html#547-549' 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<'a, R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G: <a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T: <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> <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><'a, R, G, T></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#569-575' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <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#572-574' 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<'a, R: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G: <a class="trait" href="../lock_api/trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a> <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><'a, R, G, T></code><a href='#impl-Drop' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#552-559' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.drop' class="method hidden"><code id='drop.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&mut self)</code><a class='srclink' href='../src/lock_api/remutex.rs.html#556-558' 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<'a, R: <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: <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: ?<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> <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><'a, R, G, T></code><a href='#impl-Sync' class='anchor'></a><a class='srclink' href='../src/lock_api/remutex.rs.html#415-418' 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, R, G, T> !<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><'a, R, G, T></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, R, G, T: ?<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.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><'a, R, G, T></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<T> <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> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <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#109-111' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> &T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </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#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> &mut T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' 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<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> 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#564-568' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-567' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </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#553-560' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-559' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </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#601-610' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<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><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#607-609' 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<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </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#587-596' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<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><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#593-595' 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><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
167
lock_api/struct.RwLock.html
Normal file
167
lock_api/struct.RwLock.html
Normal file
File diff suppressed because one or more lines are too long
54
lock_api/struct.RwLockReadGuard.html
Normal file
54
lock_api/struct.RwLockReadGuard.html
Normal file
File diff suppressed because one or more lines are too long
58
lock_api/struct.RwLockUpgradableReadGuard.html
Normal file
58
lock_api/struct.RwLockUpgradableReadGuard.html
Normal file
File diff suppressed because one or more lines are too long
64
lock_api/struct.RwLockWriteGuard.html
Normal file
64
lock_api/struct.RwLockWriteGuard.html
Normal file
File diff suppressed because one or more lines are too long
18
lock_api/trait.GetThreadId.html
Normal file
18
lock_api/trait.GetThreadId.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `GetThreadId` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, GetThreadId"><title>lock_api::GetThreadId - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait GetThreadId</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-const">Associated Constants</a><div class="sidebar-links"><a href="#associatedconstant.INIT">INIT</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.nonzero_thread_id">nonzero_thread_id</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'GetThreadId', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/remutex.rs.html#38-48' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>GetThreadId</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait GetThreadId {
|
||||
const <a href='#associatedconstant.INIT' class="constant"><b>INIT</b></a>: Self;
|
||||
|
||||
fn <a href='#tymethod.nonzero_thread_id' class='fnname'>nonzero_thread_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/num/struct.NonZeroUsize.html" title="struct core::num::NonZeroUsize">NonZeroUsize</a>;
|
||||
}</pre></div><div class='docblock'><p>Helper trait which returns a non-zero thread ID.</p>
|
||||
<p>The simplest way to implement this trait is to return the address of a
|
||||
thread-local variable.</p>
|
||||
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
|
||||
<p>Implementations of this trait must ensure that no two active threads share
|
||||
the same thread ID. However the ID of a thread that has exited can be
|
||||
re-used since that thread is no longer active.</p>
|
||||
</div>
|
||||
<h2 id='associated-const' class='small-section-header'>Associated Constants<a href='#associated-const' class='anchor'></a></h2><div class='methods'><h3 id='associatedconstant.INIT' class='method'><code id='INIT.v'>const <a href='#associatedconstant.INIT' class="constant"><b>INIT</b></a>: Self</code></h3><div class='docblock'><p>Initial value.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.nonzero_thread_id' class='method'><code id='nonzero_thread_id.v'>fn <a href='#tymethod.nonzero_thread_id' class='fnname'>nonzero_thread_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/num/struct.NonZeroUsize.html" title="struct core::num::NonZeroUsize">NonZeroUsize</a></code></h3><div class='docblock'><p>Returns a non-zero thread ID which identifies the current thread of
|
||||
execution.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../implementors/lock_api/trait.GetThreadId.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
25
lock_api/trait.RawMutex.html
Normal file
25
lock_api/trait.RawMutex.html
Normal 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="API documentation for the Rust `RawMutex` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawMutex"><title>lock_api::RawMutex - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawMutex</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-types">Associated Types</a><div class="sidebar-links"><a href="#associatedtype.GuardMarker">GuardMarker</a></div><a class="sidebar-title" href="#associated-const">Associated Constants</a><div class="sidebar-links"><a href="#associatedconstant.INIT">INIT</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.lock">lock</a><a href="#tymethod.try_lock">try_lock</a><a href="#tymethod.unlock">unlock</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawMutex', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/mutex.rs.html#29-48' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawMutex</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawMutex {
|
||||
type <a href='#associatedtype.GuardMarker' class="type">GuardMarker</a>;
|
||||
|
||||
const <a href='#associatedconstant.INIT' class="constant"><b>INIT</b></a>: Self;
|
||||
|
||||
fn <a href='#tymethod.lock' class='fnname'>lock</a>(&self);
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock' class='fnname'>try_lock</a>(&self) -> bool;
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.unlock' class='fnname'>unlock</a>(&self);
|
||||
}</pre></div><div class='docblock'><p>Basic operations for a mutex.</p>
|
||||
<p>Types implementing this trait can be used by <code>Mutex</code> to form a safe and
|
||||
fully-functioning mutex type.</p>
|
||||
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
|
||||
<p>Implementations of this trait must ensure that the mutex is actually
|
||||
exclusive: a lock can't be acquired while the mutex is already locked.</p>
|
||||
</div>
|
||||
<h2 id='associated-types' class='small-section-header'>Associated Types<a href='#associated-types' class='anchor'></a></h2><div class='methods'><h3 id='associatedtype.GuardMarker' class='method'><code id='GuardMarker.t'>type <a href='#associatedtype.GuardMarker' class="type">GuardMarker</a></code></h3><div class='docblock'><p>Marker type which determines whether a lock guard should be <code>Send</code>. Use
|
||||
one of the <code>GuardSend</code> or <code>GuardNoSend</code> helper types here.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='associated-const' class='small-section-header'>Associated Constants<a href='#associated-const' class='anchor'></a></h2><div class='methods'><h3 id='associatedconstant.INIT' class='method'><code id='INIT.v'>const <a href='#associatedconstant.INIT' class="constant"><b>INIT</b></a>: Self</code></h3><div class='docblock'><p>Initial value for an unlocked mutex.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.lock' class='method'><code id='lock.v'>fn <a href='#tymethod.lock' class='fnname'>lock</a>(&self)</code></h3><div class='docblock'><p>Acquires this mutex, blocking the current thread until it is able to do so.</p>
|
||||
</div><h3 id='tymethod.try_lock' class='method'><code id='try_lock.v'>fn <a href='#tymethod.try_lock' class='fnname'>try_lock</a>(&self) -> bool</code></h3><div class='docblock'><p>Attempts to acquire this mutex without blocking.</p>
|
||||
</div><h3 id='tymethod.unlock' class='method'><code id='unlock.v'>fn <a href='#tymethod.unlock' class='fnname'>unlock</a>(&self)</code></h3><div class='docblock'><p>Unlocks this mutex.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../implementors/lock_api/trait.RawMutex.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
18
lock_api/trait.RawMutexFair.html
Normal file
18
lock_api/trait.RawMutexFair.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `RawMutexFair` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawMutexFair"><title>lock_api::RawMutexFair - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawMutexFair</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.unlock_fair">unlock_fair</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.bump">bump</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawMutexFair', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/mutex.rs.html#56-69' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawMutexFair</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawMutexFair: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> {
|
||||
fn <a href='#tymethod.unlock_fair' class='fnname'>unlock_fair</a>(&self);
|
||||
|
||||
fn <a href='#method.bump' class='fnname'>bump</a>(&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 id='unlock_fair.v'>fn <a href='#tymethod.unlock_fair' class='fnname'>unlock_fair</a>(&self)</code></h3><div class='docblock'><p>Unlocks this mutex using a fair unlock protocol.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='provided-methods' class='small-section-header'>Provided methods<a href='#provided-methods' class='anchor'></a></h2><div class='methods'><h3 id='method.bump' class='method'><code id='bump.v'>fn <a href='#method.bump' class='fnname'>bump</a>(&self)</code></h3><div class='docblock'><p>Temporarily yields the mutex to a waiting thread if there is one.</p>
|
||||
<p>This method is functionally equivalent to calling <code>unlock_fair</code> followed
|
||||
by <code>lock</code>, however it can be much more efficient in the case where there
|
||||
are no waiting threads.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../implementors/lock_api/trait.RawMutexFair.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
16
lock_api/trait.RawMutexTimed.html
Normal file
16
lock_api/trait.RawMutexTimed.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `RawMutexTimed` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawMutexTimed"><title>lock_api::RawMutexTimed - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawMutexTimed</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-types">Associated Types</a><div class="sidebar-links"><a href="#associatedtype.Duration">Duration</a><a href="#associatedtype.Instant">Instant</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.try_lock_for">try_lock_for</a><a href="#tymethod.try_lock_until">try_lock_until</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawMutexTimed', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/mutex.rs.html#75-87' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawMutexTimed</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawMutexTimed: <a class="trait" href="../lock_api/trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> {
|
||||
type <a href='#associatedtype.Duration' class="type">Duration</a>;
|
||||
type <a href='#associatedtype.Instant' class="type">Instant</a>;
|
||||
fn <a href='#tymethod.try_lock_for' class='fnname'>try_lock_for</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawMutexTimed.html#associatedtype.Duration" title="type lock_api::RawMutexTimed::Duration">Duration</a>) -> bool;
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock_until' class='fnname'>try_lock_until</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawMutexTimed.html#associatedtype.Instant" title="type lock_api::RawMutexTimed::Instant">Instant</a>) -> bool;
|
||||
}</pre></div><div class='docblock'><p>Additional methods for mutexes which support locking with timeouts.</p>
|
||||
<p>The <code>Duration</code> and <code>Instant</code> types are specified as associated types so that
|
||||
this trait is usable even in <code>no_std</code> environments.</p>
|
||||
</div>
|
||||
<h2 id='associated-types' class='small-section-header'>Associated Types<a href='#associated-types' class='anchor'></a></h2><div class='methods'><h3 id='associatedtype.Duration' class='method'><code id='Duration.t'>type <a href='#associatedtype.Duration' class="type">Duration</a></code></h3><div class='docblock'><p>Duration type used for <code>try_lock_for</code>.</p>
|
||||
</div><h3 id='associatedtype.Instant' class='method'><code id='Instant.t'>type <a href='#associatedtype.Instant' class="type">Instant</a></code></h3><div class='docblock'><p>Instant type used for <code>try_lock_until</code>.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.try_lock_for' class='method'><code id='try_lock_for.v'>fn <a href='#tymethod.try_lock_for' class='fnname'>try_lock_for</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawMutexTimed.html#associatedtype.Duration" title="type lock_api::RawMutexTimed::Duration">Duration</a>) -> bool</code></h3><div class='docblock'><p>Attempts to acquire this lock until a timeout is reached.</p>
|
||||
</div><h3 id='tymethod.try_lock_until' class='method'><code id='try_lock_until.v'>fn <a href='#tymethod.try_lock_until' class='fnname'>try_lock_until</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawMutexTimed.html#associatedtype.Instant" title="type lock_api::RawMutexTimed::Instant">Instant</a>) -> bool</code></h3><div class='docblock'><p>Attempts to acquire this lock until a timeout is reached.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../implementors/lock_api/trait.RawMutexTimed.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
33
lock_api/trait.RawRwLock.html
Normal file
33
lock_api/trait.RawRwLock.html
Normal file
@@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `RawRwLock` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLock"><title>lock_api::RawRwLock - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawRwLock</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-types">Associated Types</a><div class="sidebar-links"><a href="#associatedtype.GuardMarker">GuardMarker</a></div><a class="sidebar-title" href="#associated-const">Associated Constants</a><div class="sidebar-links"><a href="#associatedconstant.INIT">INIT</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.lock_exclusive">lock_exclusive</a><a href="#tymethod.lock_shared">lock_shared</a><a href="#tymethod.try_lock_exclusive">try_lock_exclusive</a><a href="#tymethod.try_lock_shared">try_lock_shared</a><a href="#tymethod.unlock_exclusive">unlock_exclusive</a><a href="#tymethod.unlock_shared">unlock_shared</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawRwLock', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#31-59' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawRwLock</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawRwLock {
|
||||
type <a href='#associatedtype.GuardMarker' class="type">GuardMarker</a>;
|
||||
|
||||
const <a href='#associatedconstant.INIT' class="constant"><b>INIT</b></a>: Self;
|
||||
|
||||
fn <a href='#tymethod.lock_shared' class='fnname'>lock_shared</a>(&self);
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock_shared' class='fnname'>try_lock_shared</a>(&self) -> bool;
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.unlock_shared' class='fnname'>unlock_shared</a>(&self);
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.lock_exclusive' class='fnname'>lock_exclusive</a>(&self);
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock_exclusive' class='fnname'>try_lock_exclusive</a>(&self) -> bool;
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.unlock_exclusive' class='fnname'>unlock_exclusive</a>(&self);
|
||||
}</pre></div><div class='docblock'><p>Basic operations for a reader-writer lock.</p>
|
||||
<p>Types implementing this trait can be used by <code>RwLock</code> to form a safe and
|
||||
fully-functioning <code>RwLock</code> type.</p>
|
||||
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
|
||||
<p>Implementations of this trait must ensure that the <code>RwLock</code> is actually
|
||||
exclusive: an exclusive lock can't be acquired while an exclusive or shared
|
||||
lock exists, and a shared lock can't be acquire while an exclusive lock
|
||||
exists.</p>
|
||||
</div>
|
||||
<h2 id='associated-types' class='small-section-header'>Associated Types<a href='#associated-types' class='anchor'></a></h2><div class='methods'><h3 id='associatedtype.GuardMarker' class='method'><code id='GuardMarker.t'>type <a href='#associatedtype.GuardMarker' class="type">GuardMarker</a></code></h3><div class='docblock'><p>Marker type which determines whether a lock guard should be <code>Send</code>. Use
|
||||
one of the <code>GuardSend</code> or <code>GuardNoSend</code> helper types here.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='associated-const' class='small-section-header'>Associated Constants<a href='#associated-const' class='anchor'></a></h2><div class='methods'><h3 id='associatedconstant.INIT' class='method'><code id='INIT.v'>const <a href='#associatedconstant.INIT' class="constant"><b>INIT</b></a>: Self</code></h3><div class='docblock'><p>Initial value for an unlocked <code>RwLock</code>.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.lock_shared' class='method'><code id='lock_shared.v'>fn <a href='#tymethod.lock_shared' class='fnname'>lock_shared</a>(&self)</code></h3><div class='docblock'><p>Acquires a shared lock, blocking the current thread until it is able to do so.</p>
|
||||
</div><h3 id='tymethod.try_lock_shared' class='method'><code id='try_lock_shared.v'>fn <a href='#tymethod.try_lock_shared' class='fnname'>try_lock_shared</a>(&self) -> bool</code></h3><div class='docblock'><p>Attempts to acquire a shared lock without blocking.</p>
|
||||
</div><h3 id='tymethod.unlock_shared' class='method'><code id='unlock_shared.v'>fn <a href='#tymethod.unlock_shared' class='fnname'>unlock_shared</a>(&self)</code></h3><div class='docblock'><p>Releases a shared lock.</p>
|
||||
</div><h3 id='tymethod.lock_exclusive' class='method'><code id='lock_exclusive.v'>fn <a href='#tymethod.lock_exclusive' class='fnname'>lock_exclusive</a>(&self)</code></h3><div class='docblock'><p>Acquires an exclusive lock, blocking the current thread until it is able to do so.</p>
|
||||
</div><h3 id='tymethod.try_lock_exclusive' class='method'><code id='try_lock_exclusive.v'>fn <a href='#tymethod.try_lock_exclusive' class='fnname'>try_lock_exclusive</a>(&self) -> bool</code></h3><div class='docblock'><p>Attempts to acquire an exclusive lock without blocking.</p>
|
||||
</div><h3 id='tymethod.unlock_exclusive' class='method'><code id='unlock_exclusive.v'>fn <a href='#tymethod.unlock_exclusive' class='fnname'>unlock_exclusive</a>(&self)</code></h3><div class='docblock'><p>Releases an exclusive lock.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../implementors/lock_api/trait.RawRwLock.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
9
lock_api/trait.RawRwLockDowngrade.html
Normal file
9
lock_api/trait.RawRwLockDowngrade.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `RawRwLockDowngrade` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockDowngrade"><title>lock_api::RawRwLockDowngrade - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawRwLockDowngrade</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.downgrade">downgrade</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawRwLockDowngrade', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#97-101' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawRwLockDowngrade</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawRwLockDowngrade: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> {
|
||||
fn <a href='#tymethod.downgrade' class='fnname'>downgrade</a>(&self);
|
||||
}</pre></div><div class='docblock'><p>Additional methods for RwLocks which support atomically downgrading an
|
||||
exclusive lock to a shared lock.</p>
|
||||
</div>
|
||||
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.downgrade' class='method'><code id='downgrade.v'>fn <a href='#tymethod.downgrade' class='fnname'>downgrade</a>(&self)</code></h3><div class='docblock'><p>Atomically downgrades an exclusive lock into a shared lock without
|
||||
allowing any thread to take an exclusive lock in the meantime.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../implementors/lock_api/trait.RawRwLockDowngrade.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
25
lock_api/trait.RawRwLockFair.html
Normal file
25
lock_api/trait.RawRwLockFair.html
Normal 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="API documentation for the Rust `RawRwLockFair` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockFair"><title>lock_api::RawRwLockFair - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawRwLockFair</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.unlock_exclusive_fair">unlock_exclusive_fair</a><a href="#tymethod.unlock_shared_fair">unlock_shared_fair</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.bump_exclusive">bump_exclusive</a><a href="#method.bump_shared">bump_shared</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawRwLockFair', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#67-93' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawRwLockFair</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawRwLockFair: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> {
|
||||
fn <a href='#tymethod.unlock_shared_fair' class='fnname'>unlock_shared_fair</a>(&self);
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.unlock_exclusive_fair' class='fnname'>unlock_exclusive_fair</a>(&self);
|
||||
|
||||
fn <a href='#method.bump_shared' class='fnname'>bump_shared</a>(&self) { ... }
|
||||
<div class='item-spacer'></div> fn <a href='#method.bump_exclusive' class='fnname'>bump_exclusive</a>(&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 id='unlock_shared_fair.v'>fn <a href='#tymethod.unlock_shared_fair' class='fnname'>unlock_shared_fair</a>(&self)</code></h3><div class='docblock'><p>Releases a shared lock using a fair unlock protocol.</p>
|
||||
</div><h3 id='tymethod.unlock_exclusive_fair' class='method'><code id='unlock_exclusive_fair.v'>fn <a href='#tymethod.unlock_exclusive_fair' class='fnname'>unlock_exclusive_fair</a>(&self)</code></h3><div class='docblock'><p>Releases an exclusive lock using a fair unlock protocol.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='provided-methods' class='small-section-header'>Provided methods<a href='#provided-methods' class='anchor'></a></h2><div class='methods'><h3 id='method.bump_shared' class='method'><code id='bump_shared.v'>fn <a href='#method.bump_shared' class='fnname'>bump_shared</a>(&self)</code></h3><div class='docblock'><p>Temporarily yields a shared lock to a waiting thread if there is one.</p>
|
||||
<p>This method is functionally equivalent to calling <code>unlock_shared_fair</code> followed
|
||||
by <code>lock_shared</code>, however it can be much more efficient in the case where there
|
||||
are no waiting threads.</p>
|
||||
</div><h3 id='method.bump_exclusive' class='method'><code id='bump_exclusive.v'>fn <a href='#method.bump_exclusive' class='fnname'>bump_exclusive</a>(&self)</code></h3><div class='docblock'><p>Temporarily yields an exclusive lock to a waiting thread if there is one.</p>
|
||||
<p>This method is functionally equivalent to calling <code>unlock_exclusive_fair</code> followed
|
||||
by <code>lock_exclusive</code>, however it can be much more efficient in the case where there
|
||||
are no waiting threads.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../implementors/lock_api/trait.RawRwLockFair.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
14
lock_api/trait.RawRwLockRecursive.html
Normal file
14
lock_api/trait.RawRwLockRecursive.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `RawRwLockRecursive` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockRecursive"><title>lock_api::RawRwLockRecursive - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawRwLockRecursive</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.lock_shared_recursive">lock_shared_recursive</a><a href="#tymethod.try_lock_shared_recursive">try_lock_shared_recursive</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawRwLockRecursive', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#134-140' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawRwLockRecursive</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawRwLockRecursive: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> {
|
||||
fn <a href='#tymethod.lock_shared_recursive' class='fnname'>lock_shared_recursive</a>(&self);
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock_shared_recursive' class='fnname'>try_lock_shared_recursive</a>(&self) -> bool;
|
||||
}</pre></div><div class='docblock'><p>Additional methods for RwLocks which support recursive read locks.</p>
|
||||
<p>These are guaranteed to succeed without blocking if
|
||||
another read lock is held at the time of the call. This allows a thread
|
||||
to recursively lock a <code>RwLock</code>. However using this method can cause
|
||||
writers to starve since readers no longer block if a writer is waiting
|
||||
for the lock.</p>
|
||||
</div>
|
||||
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.lock_shared_recursive' class='method'><code id='lock_shared_recursive.v'>fn <a href='#tymethod.lock_shared_recursive' class='fnname'>lock_shared_recursive</a>(&self)</code></h3><div class='docblock'><p>Acquires a shared lock without deadlocking in case of a recursive lock.</p>
|
||||
</div><h3 id='tymethod.try_lock_shared_recursive' class='method'><code id='try_lock_shared_recursive.v'>fn <a href='#tymethod.try_lock_shared_recursive' class='fnname'>try_lock_shared_recursive</a>(&self) -> bool</code></h3><div class='docblock'><p>Attempts to acquire a shared lock without deadlocking in case of a recursive lock.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../implementors/lock_api/trait.RawRwLockRecursive.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
11
lock_api/trait.RawRwLockRecursiveTimed.html
Normal file
11
lock_api/trait.RawRwLockRecursiveTimed.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `RawRwLockRecursiveTimed` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockRecursiveTimed"><title>lock_api::RawRwLockRecursiveTimed - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawRwLockRecursiveTimed</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.try_lock_shared_recursive_for">try_lock_shared_recursive_for</a><a href="#tymethod.try_lock_shared_recursive_until">try_lock_shared_recursive_until</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawRwLockRecursiveTimed', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#143-151' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawRwLockRecursiveTimed</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawRwLockRecursiveTimed: <a class="trait" href="../lock_api/trait.RawRwLockRecursive.html" title="trait lock_api::RawRwLockRecursive">RawRwLockRecursive</a> + <a class="trait" href="../lock_api/trait.RawRwLockTimed.html" title="trait lock_api::RawRwLockTimed">RawRwLockTimed</a> {
|
||||
fn <a href='#tymethod.try_lock_shared_recursive_for' class='fnname'>try_lock_shared_recursive_for</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -> bool;
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock_shared_recursive_until' class='fnname'>try_lock_shared_recursive_until</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -> bool;
|
||||
}</pre></div><div class='docblock'><p>Additional methods for RwLocks which support recursive read locks and timeouts.</p>
|
||||
</div>
|
||||
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.try_lock_shared_recursive_for' class='method'><code id='try_lock_shared_recursive_for.v'>fn <a href='#tymethod.try_lock_shared_recursive_for' class='fnname'>try_lock_shared_recursive_for</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -> bool</code></h3><div class='docblock'><p>Attempts to acquire a shared lock until a timeout is reached, without
|
||||
deadlocking in case of a recursive lock.</p>
|
||||
</div><h3 id='tymethod.try_lock_shared_recursive_until' class='method'><code id='try_lock_shared_recursive_until.v'>fn <a href='#tymethod.try_lock_shared_recursive_until' class='fnname'>try_lock_shared_recursive_until</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -> bool</code></h3><div class='docblock'><p>Attempts to acquire a shared lock until a timeout is reached, without
|
||||
deadlocking in case of a recursive lock.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../implementors/lock_api/trait.RawRwLockRecursiveTimed.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
20
lock_api/trait.RawRwLockTimed.html
Normal file
20
lock_api/trait.RawRwLockTimed.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `RawRwLockTimed` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockTimed"><title>lock_api::RawRwLockTimed - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawRwLockTimed</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-types">Associated Types</a><div class="sidebar-links"><a href="#associatedtype.Duration">Duration</a><a href="#associatedtype.Instant">Instant</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.try_lock_exclusive_for">try_lock_exclusive_for</a><a href="#tymethod.try_lock_exclusive_until">try_lock_exclusive_until</a><a href="#tymethod.try_lock_shared_for">try_lock_shared_for</a><a href="#tymethod.try_lock_shared_until">try_lock_shared_until</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawRwLockTimed', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#107-125' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawRwLockTimed</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawRwLockTimed: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> {
|
||||
type <a href='#associatedtype.Duration' class="type">Duration</a>;
|
||||
type <a href='#associatedtype.Instant' class="type">Instant</a>;
|
||||
fn <a href='#tymethod.try_lock_shared_for' class='fnname'>try_lock_shared_for</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -> bool;
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock_shared_until' class='fnname'>try_lock_shared_until</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -> bool;
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock_exclusive_for' class='fnname'>try_lock_exclusive_for</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -> bool;
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock_exclusive_until' class='fnname'>try_lock_exclusive_until</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -> bool;
|
||||
}</pre></div><div class='docblock'><p>Additional methods for RwLocks which support locking with timeouts.</p>
|
||||
<p>The <code>Duration</code> and <code>Instant</code> types are specified as associated types so that
|
||||
this trait is usable even in <code>no_std</code> environments.</p>
|
||||
</div>
|
||||
<h2 id='associated-types' class='small-section-header'>Associated Types<a href='#associated-types' class='anchor'></a></h2><div class='methods'><h3 id='associatedtype.Duration' class='method'><code id='Duration.t'>type <a href='#associatedtype.Duration' class="type">Duration</a></code></h3><div class='docblock'><p>Duration type used for <code>try_lock_for</code>.</p>
|
||||
</div><h3 id='associatedtype.Instant' class='method'><code id='Instant.t'>type <a href='#associatedtype.Instant' class="type">Instant</a></code></h3><div class='docblock'><p>Instant type used for <code>try_lock_until</code>.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.try_lock_shared_for' class='method'><code id='try_lock_shared_for.v'>fn <a href='#tymethod.try_lock_shared_for' class='fnname'>try_lock_shared_for</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -> bool</code></h3><div class='docblock'><p>Attempts to acquire a shared lock until a timeout is reached.</p>
|
||||
</div><h3 id='tymethod.try_lock_shared_until' class='method'><code id='try_lock_shared_until.v'>fn <a href='#tymethod.try_lock_shared_until' class='fnname'>try_lock_shared_until</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -> bool</code></h3><div class='docblock'><p>Attempts to acquire a shared lock until a timeout is reached.</p>
|
||||
</div><h3 id='tymethod.try_lock_exclusive_for' class='method'><code id='try_lock_exclusive_for.v'>fn <a href='#tymethod.try_lock_exclusive_for' class='fnname'>try_lock_exclusive_for</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -> bool</code></h3><div class='docblock'><p>Attempts to acquire an exclusive lock until a timeout is reached.</p>
|
||||
</div><h3 id='tymethod.try_lock_exclusive_until' class='method'><code id='try_lock_exclusive_until.v'>fn <a href='#tymethod.try_lock_exclusive_until' class='fnname'>try_lock_exclusive_until</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -> bool</code></h3><div class='docblock'><p>Attempts to acquire an exclusive lock until a timeout is reached.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../implementors/lock_api/trait.RawRwLockTimed.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
20
lock_api/trait.RawRwLockUpgrade.html
Normal file
20
lock_api/trait.RawRwLockUpgrade.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `RawRwLockUpgrade` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockUpgrade"><title>lock_api::RawRwLockUpgrade - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawRwLockUpgrade</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.lock_upgradable">lock_upgradable</a><a href="#tymethod.try_lock_upgradable">try_lock_upgradable</a><a href="#tymethod.try_upgrade">try_upgrade</a><a href="#tymethod.unlock_upgradable">unlock_upgradable</a><a href="#tymethod.upgrade">upgrade</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawRwLockUpgrade', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#159-175' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawRwLockUpgrade</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawRwLockUpgrade: <a class="trait" href="../lock_api/trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> {
|
||||
fn <a href='#tymethod.lock_upgradable' class='fnname'>lock_upgradable</a>(&self);
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock_upgradable' class='fnname'>try_lock_upgradable</a>(&self) -> bool;
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.unlock_upgradable' class='fnname'>unlock_upgradable</a>(&self);
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.upgrade' class='fnname'>upgrade</a>(&self);
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.try_upgrade' class='fnname'>try_upgrade</a>(&self) -> 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 id='lock_upgradable.v'>fn <a href='#tymethod.lock_upgradable' class='fnname'>lock_upgradable</a>(&self)</code></h3><div class='docblock'><p>Acquires an upgradable lock, blocking the current thread until it is able to do so.</p>
|
||||
</div><h3 id='tymethod.try_lock_upgradable' class='method'><code id='try_lock_upgradable.v'>fn <a href='#tymethod.try_lock_upgradable' class='fnname'>try_lock_upgradable</a>(&self) -> bool</code></h3><div class='docblock'><p>Attempts to acquire an upgradable lock without blocking.</p>
|
||||
</div><h3 id='tymethod.unlock_upgradable' class='method'><code id='unlock_upgradable.v'>fn <a href='#tymethod.unlock_upgradable' class='fnname'>unlock_upgradable</a>(&self)</code></h3><div class='docblock'><p>Releases an upgradable lock.</p>
|
||||
</div><h3 id='tymethod.upgrade' class='method'><code id='upgrade.v'>fn <a href='#tymethod.upgrade' class='fnname'>upgrade</a>(&self)</code></h3><div class='docblock'><p>Upgrades an upgradable lock to an exclusive lock.</p>
|
||||
</div><h3 id='tymethod.try_upgrade' class='method'><code id='try_upgrade.v'>fn <a href='#tymethod.try_upgrade' class='fnname'>try_upgrade</a>(&self) -> bool</code></h3><div class='docblock'><p>Attempts to upgrade an upgradable lock to an exclusive lock without
|
||||
blocking.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../implementors/lock_api/trait.RawRwLockUpgrade.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
10
lock_api/trait.RawRwLockUpgradeDowngrade.html
Normal file
10
lock_api/trait.RawRwLockUpgradeDowngrade.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `RawRwLockUpgradeDowngrade` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockUpgradeDowngrade"><title>lock_api::RawRwLockUpgradeDowngrade - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawRwLockUpgradeDowngrade</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.downgrade_to_upgradable">downgrade_to_upgradable</a><a href="#tymethod.downgrade_upgradable">downgrade_upgradable</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawRwLockUpgradeDowngrade', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#196-202' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawRwLockUpgradeDowngrade</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawRwLockUpgradeDowngrade: <a class="trait" href="../lock_api/trait.RawRwLockUpgrade.html" title="trait lock_api::RawRwLockUpgrade">RawRwLockUpgrade</a> + <a class="trait" href="../lock_api/trait.RawRwLockDowngrade.html" title="trait lock_api::RawRwLockDowngrade">RawRwLockDowngrade</a> {
|
||||
fn <a href='#tymethod.downgrade_upgradable' class='fnname'>downgrade_upgradable</a>(&self);
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.downgrade_to_upgradable' class='fnname'>downgrade_to_upgradable</a>(&self);
|
||||
}</pre></div><div class='docblock'><p>Additional methods for RwLocks which support upgradable locks and lock
|
||||
downgrading.</p>
|
||||
</div>
|
||||
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.downgrade_upgradable' class='method'><code id='downgrade_upgradable.v'>fn <a href='#tymethod.downgrade_upgradable' class='fnname'>downgrade_upgradable</a>(&self)</code></h3><div class='docblock'><p>Downgrades an upgradable lock to a shared lock.</p>
|
||||
</div><h3 id='tymethod.downgrade_to_upgradable' class='method'><code id='downgrade_to_upgradable.v'>fn <a href='#tymethod.downgrade_to_upgradable' class='fnname'>downgrade_to_upgradable</a>(&self)</code></h3><div class='docblock'><p>Downgrades an exclusive lock to an upgradable lock.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../implementors/lock_api/trait.RawRwLockUpgradeDowngrade.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
15
lock_api/trait.RawRwLockUpgradeFair.html
Normal file
15
lock_api/trait.RawRwLockUpgradeFair.html
Normal 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="API documentation for the Rust `RawRwLockUpgradeFair` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockUpgradeFair"><title>lock_api::RawRwLockUpgradeFair - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawRwLockUpgradeFair</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.unlock_upgradable_fair">unlock_upgradable_fair</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.bump_upgradable">bump_upgradable</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawRwLockUpgradeFair', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#179-192' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawRwLockUpgradeFair</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawRwLockUpgradeFair: <a class="trait" href="../lock_api/trait.RawRwLockUpgrade.html" title="trait lock_api::RawRwLockUpgrade">RawRwLockUpgrade</a> + <a class="trait" href="../lock_api/trait.RawRwLockFair.html" title="trait lock_api::RawRwLockFair">RawRwLockFair</a> {
|
||||
fn <a href='#tymethod.unlock_upgradable_fair' class='fnname'>unlock_upgradable_fair</a>(&self);
|
||||
|
||||
fn <a href='#method.bump_upgradable' class='fnname'>bump_upgradable</a>(&self) { ... }
|
||||
}</pre></div><div class='docblock'><p>Additional methods for RwLocks which support upgradable locks and fair
|
||||
unlocking.</p>
|
||||
</div>
|
||||
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.unlock_upgradable_fair' class='method'><code id='unlock_upgradable_fair.v'>fn <a href='#tymethod.unlock_upgradable_fair' class='fnname'>unlock_upgradable_fair</a>(&self)</code></h3><div class='docblock'><p>Releases an upgradable lock using a fair unlock protocol.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='provided-methods' class='small-section-header'>Provided methods<a href='#provided-methods' class='anchor'></a></h2><div class='methods'><h3 id='method.bump_upgradable' class='method'><code id='bump_upgradable.v'>fn <a href='#method.bump_upgradable' class='fnname'>bump_upgradable</a>(&self)</code></h3><div class='docblock'><p>Temporarily yields an upgradable lock to a waiting thread if there is one.</p>
|
||||
<p>This method is functionally equivalent to calling <code>unlock_upgradable_fair</code> followed
|
||||
by <code>lock_upgradable</code>, however it can be much more efficient in the case where there
|
||||
are no waiting threads.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../implementors/lock_api/trait.RawRwLockUpgradeFair.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
16
lock_api/trait.RawRwLockUpgradeTimed.html
Normal file
16
lock_api/trait.RawRwLockUpgradeTimed.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `RawRwLockUpgradeTimed` trait in crate `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockUpgradeTimed"><title>lock_api::RawRwLockUpgradeTimed - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../lock_api/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Trait RawRwLockUpgradeTimed</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.try_lock_upgradable_for">try_lock_upgradable_for</a><a href="#tymethod.try_lock_upgradable_until">try_lock_upgradable_until</a><a href="#tymethod.try_upgrade_for">try_upgrade_for</a><a href="#tymethod.try_upgrade_until">try_upgrade_until</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>lock_api</a></p><script>window.sidebarCurrent = {name: 'RawRwLockUpgradeTimed', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/lock_api/rwlock.rs.html#206-220' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>lock_api</a>::<wbr><a class="trait" href=''>RawRwLockUpgradeTimed</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub unsafe trait RawRwLockUpgradeTimed: <a class="trait" href="../lock_api/trait.RawRwLockUpgrade.html" title="trait lock_api::RawRwLockUpgrade">RawRwLockUpgrade</a> + <a class="trait" href="../lock_api/trait.RawRwLockTimed.html" title="trait lock_api::RawRwLockTimed">RawRwLockTimed</a> {
|
||||
fn <a href='#tymethod.try_lock_upgradable_for' class='fnname'>try_lock_upgradable_for</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -> bool;
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.try_lock_upgradable_until' class='fnname'>try_lock_upgradable_until</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -> bool;
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.try_upgrade_for' class='fnname'>try_upgrade_for</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -> bool;
|
||||
<div class='item-spacer'></div> fn <a href='#tymethod.try_upgrade_until' class='fnname'>try_upgrade_until</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -> bool;
|
||||
}</pre></div><div class='docblock'><p>Additional methods for RwLocks which support upgradable locks and locking
|
||||
with timeouts.</p>
|
||||
</div>
|
||||
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.try_lock_upgradable_for' class='method'><code id='try_lock_upgradable_for.v'>fn <a href='#tymethod.try_lock_upgradable_for' class='fnname'>try_lock_upgradable_for</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -> bool</code></h3><div class='docblock'><p>Attempts to acquire an upgradable lock until a timeout is reached.</p>
|
||||
</div><h3 id='tymethod.try_lock_upgradable_until' class='method'><code id='try_lock_upgradable_until.v'>fn <a href='#tymethod.try_lock_upgradable_until' class='fnname'>try_lock_upgradable_until</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -> bool</code></h3><div class='docblock'><p>Attempts to acquire an upgradable lock until a timeout is reached.</p>
|
||||
</div><h3 id='tymethod.try_upgrade_for' class='method'><code id='try_upgrade_for.v'>fn <a href='#tymethod.try_upgrade_for' class='fnname'>try_upgrade_for</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -> bool</code></h3><div class='docblock'><p>Attempts to upgrade an upgradable lock to an exclusive lock until a
|
||||
timeout is reached.</p>
|
||||
</div><h3 id='tymethod.try_upgrade_until' class='method'><code id='try_upgrade_until.v'>fn <a href='#tymethod.try_upgrade_until' class='fnname'>try_upgrade_until</a>(&self, timeout: Self::<a class="type" href="../lock_api/trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -> bool</code></h3><div class='docblock'><p>Attempts to upgrade an upgradable lock to an exclusive lock until a
|
||||
timeout is reached.</p>
|
||||
</div></div><span class='loading-content'>Loading content...</span>
|
||||
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../implementors/lock_api/trait.RawRwLockUpgradeTimed.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "lock_api";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
||||
Reference in New Issue
Block a user