mirror of
https://github.com/NotAShelf/mpvrc.git
synced 2026-04-19 00:59:52 +00:00
deploy: de38ae62916547ad097c066f94a32e9ba7790eeb
This commit is contained in:
commit
9a86359447
28502 changed files with 1261284 additions and 0 deletions
1
parking_lot/all.html
Normal file
1
parking_lot/all.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<!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"><title>List of all items in this crate</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc mod sys"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h3><a href="#structs">Crate Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#functions" title="Functions">Functions</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><h1>List of all items</h1><h3 id="structs">Structs</h3><ul class="all-items"><li><a href="struct.Condvar.html">Condvar</a></li><li><a href="struct.Once.html">Once</a></li><li><a href="struct.RawFairMutex.html">RawFairMutex</a></li><li><a href="struct.RawMutex.html">RawMutex</a></li><li><a href="struct.RawRwLock.html">RawRwLock</a></li><li><a href="struct.RawThreadId.html">RawThreadId</a></li><li><a href="struct.WaitTimeoutResult.html">WaitTimeoutResult</a></li></ul><h3 id="enums">Enums</h3><ul class="all-items"><li><a href="enum.OnceState.html">OnceState</a></li></ul><h3 id="functions">Functions</h3><ul class="all-items"><li><a href="fn.const_fair_mutex.html">const_fair_mutex</a></li><li><a href="fn.const_mutex.html">const_mutex</a></li><li><a href="fn.const_reentrant_mutex.html">const_reentrant_mutex</a></li><li><a href="fn.const_rwlock.html">const_rwlock</a></li></ul><h3 id="types">Type Aliases</h3><ul class="all-items"><li><a href="type.FairMutex.html">FairMutex</a></li><li><a href="type.FairMutexGuard.html">FairMutexGuard</a></li><li><a href="type.MappedFairMutexGuard.html">MappedFairMutexGuard</a></li><li><a href="type.MappedMutexGuard.html">MappedMutexGuard</a></li><li><a href="type.MappedReentrantMutexGuard.html">MappedReentrantMutexGuard</a></li><li><a href="type.MappedRwLockReadGuard.html">MappedRwLockReadGuard</a></li><li><a href="type.MappedRwLockWriteGuard.html">MappedRwLockWriteGuard</a></li><li><a href="type.Mutex.html">Mutex</a></li><li><a href="type.MutexGuard.html">MutexGuard</a></li><li><a href="type.ReentrantMutex.html">ReentrantMutex</a></li><li><a href="type.ReentrantMutexGuard.html">ReentrantMutexGuard</a></li><li><a href="type.RwLock.html">RwLock</a></li><li><a href="type.RwLockReadGuard.html">RwLockReadGuard</a></li><li><a href="type.RwLockUpgradableReadGuard.html">RwLockUpgradableReadGuard</a></li><li><a href="type.RwLockWriteGuard.html">RwLockWriteGuard</a></li></ul></section></div></main></body></html>
|
||||
11
parking_lot/condvar/struct.Condvar.html
Normal file
11
parking_lot/condvar/struct.Condvar.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/struct.Condvar.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/struct.Condvar.html">../../parking_lot/struct.Condvar.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/struct.Condvar.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/condvar/struct.WaitTimeoutResult.html
Normal file
11
parking_lot/condvar/struct.WaitTimeoutResult.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/struct.WaitTimeoutResult.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/struct.WaitTimeoutResult.html">../../parking_lot/struct.WaitTimeoutResult.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/struct.WaitTimeoutResult.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
29
parking_lot/enum.OnceState.html
Normal file
29
parking_lot/enum.OnceState.html
Normal file
File diff suppressed because one or more lines are too long
11
parking_lot/fair_mutex/fn.const_fair_mutex.html
Normal file
11
parking_lot/fair_mutex/fn.const_fair_mutex.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/fn.const_fair_mutex.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/fn.const_fair_mutex.html">../../parking_lot/fn.const_fair_mutex.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/fn.const_fair_mutex.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/fair_mutex/type.FairMutex.html
Normal file
11
parking_lot/fair_mutex/type.FairMutex.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/type.FairMutex.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/type.FairMutex.html">../../parking_lot/type.FairMutex.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/type.FairMutex.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/fair_mutex/type.FairMutexGuard.html
Normal file
11
parking_lot/fair_mutex/type.FairMutexGuard.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/type.FairMutexGuard.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/type.FairMutexGuard.html">../../parking_lot/type.FairMutexGuard.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/type.FairMutexGuard.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/fair_mutex/type.MappedFairMutexGuard.html
Normal file
11
parking_lot/fair_mutex/type.MappedFairMutexGuard.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/type.MappedFairMutexGuard.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/type.MappedFairMutexGuard.html">../../parking_lot/type.MappedFairMutexGuard.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/type.MappedFairMutexGuard.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
3
parking_lot/fn.const_fair_mutex.html
Normal file
3
parking_lot/fn.const_fair_mutex.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="Creates a new fair mutex in an unlocked state ready for use."><title>const_fair_mutex in parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">parking_lot</a></span><h1>Function <span class="fn">const_fair_mutex</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/fair_mutex.rs.html#82-84">Source</a> </span></div><pre class="rust item-decl"><code>pub const fn const_fair_mutex<T>(val: T) -> <a class="type" href="type.FairMutex.html" title="type parking_lot::FairMutex">FairMutex</a><T></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a new fair mutex in an unlocked state ready for use.</p>
|
||||
<p>This allows creating a fair mutex in a constant context on stable Rust.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
3
parking_lot/fn.const_mutex.html
Normal file
3
parking_lot/fn.const_mutex.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="Creates a new mutex in an unlocked state ready for use."><title>const_mutex in parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">parking_lot</a></span><h1>Function <span class="fn">const_mutex</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/mutex.rs.html#91-93">Source</a> </span></div><pre class="rust item-decl"><code>pub const fn const_mutex<T>(val: T) -> <a class="type" href="type.Mutex.html" title="type parking_lot::Mutex">Mutex</a><T></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a new mutex in an unlocked state ready for use.</p>
|
||||
<p>This allows creating a mutex in a constant context on stable Rust.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
3
parking_lot/fn.const_reentrant_mutex.html
Normal file
3
parking_lot/fn.const_reentrant_mutex.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="Creates a new reentrant mutex in an unlocked state ready for use."><title>const_reentrant_mutex in parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">parking_lot</a></span><h1>Function <span class="fn">const_reentrant_mutex</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/remutex.rs.html#46-52">Source</a> </span></div><pre class="rust item-decl"><code>pub const fn const_reentrant_mutex<T>(val: T) -> <a class="type" href="type.ReentrantMutex.html" title="type parking_lot::ReentrantMutex">ReentrantMutex</a><T></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a new reentrant mutex in an unlocked state ready for use.</p>
|
||||
<p>This allows creating a reentrant mutex in a constant context on stable Rust.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
3
parking_lot/fn.const_rwlock.html
Normal file
3
parking_lot/fn.const_rwlock.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="Creates a new instance of an `RwLock<T>` which is unlocked."><title>const_rwlock in parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">parking_lot</a></span><h1>Function <span class="fn">const_rwlock</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/rwlock.rs.html#93-95">Source</a> </span></div><pre class="rust item-decl"><code>pub const fn const_rwlock<T>(val: T) -> <a class="type" href="type.RwLock.html" title="type parking_lot::RwLock">RwLock</a><T></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a new instance of an <code>RwLock<T></code> which is unlocked.</p>
|
||||
<p>This allows creating a <code>RwLock<T></code> in a constant context on stable Rust.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
18
parking_lot/index.html
Normal file
18
parking_lot/index.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="This library provides implementations of `Mutex`, `RwLock`, `Condvar` and `Once` that are smaller, faster and more flexible than those in the Rust standard library. It also provides a `ReentrantMutex` type."><title>parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#reexports">Crate Items</a></h3><ul class="block"><li><a href="#reexports" title="Re-exports">Re-exports</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#functions" title="Functions">Functions</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Crate <span>parking_lot</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/lib.rs.html#8-59">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This library provides implementations of <code>Mutex</code>, <code>RwLock</code>, <code>Condvar</code> and
|
||||
<code>Once</code> that are smaller, faster and more flexible than those in the Rust
|
||||
standard library. It also provides a <code>ReentrantMutex</code> type.</p>
|
||||
</div></details><h2 id="reexports" class="section-header">Re-exports<a href="#reexports" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name" id="reexport.lock_api"><code>pub use ::<a class="mod" href="../lock_api/index.html" title="mod lock_api">lock_api</a>;</code></div></li></ul><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.Condvar.html" title="struct parking_lot::Condvar">Condvar</a></div><div class="desc docblock-short">A Condition Variable</div></li><li><div class="item-name"><a class="struct" href="struct.Once.html" title="struct parking_lot::Once">Once</a></div><div class="desc docblock-short">A synchronization primitive which can be used to run a one-time
|
||||
initialization. Useful for one-time initialization for globals, FFI or
|
||||
related functionality.</div></li><li><div class="item-name"><a class="struct" href="struct.RawFairMutex.html" title="struct parking_lot::RawFairMutex">RawFair<wbr>Mutex</a></div><div class="desc docblock-short">Raw fair mutex type backed by the parking lot.</div></li><li><div class="item-name"><a class="struct" href="struct.RawMutex.html" title="struct parking_lot::RawMutex">RawMutex</a></div><div class="desc docblock-short">Raw mutex type backed by the parking lot.</div></li><li><div class="item-name"><a class="struct" href="struct.RawRwLock.html" title="struct parking_lot::RawRwLock">RawRw<wbr>Lock</a></div><div class="desc docblock-short">Raw reader-writer lock type backed by the parking lot.</div></li><li><div class="item-name"><a class="struct" href="struct.RawThreadId.html" title="struct parking_lot::RawThreadId">RawThread<wbr>Id</a></div><div class="desc docblock-short">Implementation of the <code>GetThreadId</code> trait for <code>lock_api::ReentrantMutex</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.WaitTimeoutResult.html" title="struct parking_lot::WaitTimeoutResult">Wait<wbr>Timeout<wbr>Result</a></div><div class="desc docblock-short">A type indicating whether a timed wait on a condition variable returned
|
||||
due to a time out or not.</div></li></ul><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.OnceState.html" title="enum parking_lot::OnceState">Once<wbr>State</a></div><div class="desc docblock-short">Current state of a <code>Once</code>.</div></li></ul><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="fn" href="fn.const_fair_mutex.html" title="fn parking_lot::const_fair_mutex">const_<wbr>fair_<wbr>mutex</a></div><div class="desc docblock-short">Creates a new fair mutex in an unlocked state ready for use.</div></li><li><div class="item-name"><a class="fn" href="fn.const_mutex.html" title="fn parking_lot::const_mutex">const_<wbr>mutex</a></div><div class="desc docblock-short">Creates a new mutex in an unlocked state ready for use.</div></li><li><div class="item-name"><a class="fn" href="fn.const_reentrant_mutex.html" title="fn parking_lot::const_reentrant_mutex">const_<wbr>reentrant_<wbr>mutex</a></div><div class="desc docblock-short">Creates a new reentrant mutex in an unlocked state ready for use.</div></li><li><div class="item-name"><a class="fn" href="fn.const_rwlock.html" title="fn parking_lot::const_rwlock">const_<wbr>rwlock</a></div><div class="desc docblock-short">Creates a new instance of an <code>RwLock<T></code> which is unlocked.</div></li></ul><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="type" href="type.FairMutex.html" title="type parking_lot::FairMutex">Fair<wbr>Mutex</a></div><div class="desc docblock-short">A mutual exclusive primitive that is always fair, useful for protecting shared data</div></li><li><div class="item-name"><a class="type" href="type.FairMutexGuard.html" title="type parking_lot::FairMutexGuard">Fair<wbr>Mutex<wbr>Guard</a></div><div class="desc docblock-short">An RAII implementation of a “scoped lock” of a mutex. When this structure is
|
||||
dropped (falls out of scope), the lock will be unlocked.</div></li><li><div class="item-name"><a class="type" href="type.MappedFairMutexGuard.html" title="type parking_lot::MappedFairMutexGuard">Mapped<wbr>Fair<wbr>Mutex<wbr>Guard</a></div><div class="desc docblock-short">An RAII mutex guard returned by <code>FairMutexGuard::map</code>, which can point to a
|
||||
subfield of the protected data.</div></li><li><div class="item-name"><a class="type" href="type.MappedMutexGuard.html" title="type parking_lot::MappedMutexGuard">Mapped<wbr>Mutex<wbr>Guard</a></div><div class="desc docblock-short">An RAII mutex guard returned by <code>MutexGuard::map</code>, which can point to a
|
||||
subfield of the protected data.</div></li><li><div class="item-name"><a class="type" href="type.MappedReentrantMutexGuard.html" title="type parking_lot::MappedReentrantMutexGuard">Mapped<wbr>Reentrant<wbr>Mutex<wbr>Guard</a></div><div class="desc docblock-short">An RAII mutex guard returned by <code>ReentrantMutexGuard::map</code>, which can point to a
|
||||
subfield of the protected data.</div></li><li><div class="item-name"><a class="type" href="type.MappedRwLockReadGuard.html" title="type parking_lot::MappedRwLockReadGuard">Mapped<wbr>RwLock<wbr>Read<wbr>Guard</a></div><div class="desc docblock-short">An RAII read lock guard returned by <code>RwLockReadGuard::map</code>, which can point to a
|
||||
subfield of the protected data.</div></li><li><div class="item-name"><a class="type" href="type.MappedRwLockWriteGuard.html" title="type parking_lot::MappedRwLockWriteGuard">Mapped<wbr>RwLock<wbr>Write<wbr>Guard</a></div><div class="desc docblock-short">An RAII write lock guard returned by <code>RwLockWriteGuard::map</code>, which can point to a
|
||||
subfield of the protected data.</div></li><li><div class="item-name"><a class="type" href="type.Mutex.html" title="type parking_lot::Mutex">Mutex</a></div><div class="desc docblock-short">A mutual exclusion primitive useful for protecting shared data</div></li><li><div class="item-name"><a class="type" href="type.MutexGuard.html" title="type parking_lot::MutexGuard">Mutex<wbr>Guard</a></div><div class="desc docblock-short">An RAII implementation of a “scoped lock” of a mutex. When this structure is
|
||||
dropped (falls out of scope), the lock will be unlocked.</div></li><li><div class="item-name"><a class="type" href="type.ReentrantMutex.html" title="type parking_lot::ReentrantMutex">Reentrant<wbr>Mutex</a></div><div class="desc docblock-short">A mutex which can be recursively locked by a single thread.</div></li><li><div class="item-name"><a class="type" href="type.ReentrantMutexGuard.html" title="type parking_lot::ReentrantMutexGuard">Reentrant<wbr>Mutex<wbr>Guard</a></div><div class="desc docblock-short">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.</div></li><li><div class="item-name"><a class="type" href="type.RwLock.html" title="type parking_lot::RwLock">RwLock</a></div><div class="desc docblock-short">A reader-writer lock</div></li><li><div class="item-name"><a class="type" href="type.RwLockReadGuard.html" title="type parking_lot::RwLockReadGuard">RwLock<wbr>Read<wbr>Guard</a></div><div class="desc docblock-short">RAII structure used to release the shared read access of a lock when
|
||||
dropped.</div></li><li><div class="item-name"><a class="type" href="type.RwLockUpgradableReadGuard.html" title="type parking_lot::RwLockUpgradableReadGuard">RwLock<wbr>Upgradable<wbr>Read<wbr>Guard</a></div><div class="desc docblock-short">RAII structure used to release the upgradable read access of a lock when
|
||||
dropped.</div></li><li><div class="item-name"><a class="type" href="type.RwLockWriteGuard.html" title="type parking_lot::RwLockWriteGuard">RwLock<wbr>Write<wbr>Guard</a></div><div class="desc docblock-short">RAII structure used to release the exclusive write access of a lock when
|
||||
dropped.</div></li></ul></section></div></main></body></html>
|
||||
11
parking_lot/mutex/fn.const_mutex.html
Normal file
11
parking_lot/mutex/fn.const_mutex.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/fn.const_mutex.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/fn.const_mutex.html">../../parking_lot/fn.const_mutex.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/fn.const_mutex.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/mutex/type.MappedMutexGuard.html
Normal file
11
parking_lot/mutex/type.MappedMutexGuard.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/type.MappedMutexGuard.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/type.MappedMutexGuard.html">../../parking_lot/type.MappedMutexGuard.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/type.MappedMutexGuard.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/mutex/type.Mutex.html
Normal file
11
parking_lot/mutex/type.Mutex.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/type.Mutex.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/type.Mutex.html">../../parking_lot/type.Mutex.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/type.Mutex.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/mutex/type.MutexGuard.html
Normal file
11
parking_lot/mutex/type.MutexGuard.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/type.MutexGuard.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/type.MutexGuard.html">../../parking_lot/type.MutexGuard.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/type.MutexGuard.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/once/enum.OnceState.html
Normal file
11
parking_lot/once/enum.OnceState.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/enum.OnceState.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/enum.OnceState.html">../../parking_lot/enum.OnceState.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/enum.OnceState.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/once/struct.Once.html
Normal file
11
parking_lot/once/struct.Once.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/struct.Once.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/struct.Once.html">../../parking_lot/struct.Once.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/struct.Once.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/raw_fair_mutex/struct.RawFairMutex.html
Normal file
11
parking_lot/raw_fair_mutex/struct.RawFairMutex.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/struct.RawFairMutex.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/struct.RawFairMutex.html">../../parking_lot/struct.RawFairMutex.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/struct.RawFairMutex.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/raw_mutex/struct.RawMutex.html
Normal file
11
parking_lot/raw_mutex/struct.RawMutex.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/struct.RawMutex.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/struct.RawMutex.html">../../parking_lot/struct.RawMutex.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/struct.RawMutex.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/raw_rwlock/struct.RawRwLock.html
Normal file
11
parking_lot/raw_rwlock/struct.RawRwLock.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/struct.RawRwLock.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/struct.RawRwLock.html">../../parking_lot/struct.RawRwLock.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/struct.RawRwLock.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/remutex/fn.const_reentrant_mutex.html
Normal file
11
parking_lot/remutex/fn.const_reentrant_mutex.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/fn.const_reentrant_mutex.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/fn.const_reentrant_mutex.html">../../parking_lot/fn.const_reentrant_mutex.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/fn.const_reentrant_mutex.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/remutex/struct.RawThreadId.html
Normal file
11
parking_lot/remutex/struct.RawThreadId.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/struct.RawThreadId.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/struct.RawThreadId.html">../../parking_lot/struct.RawThreadId.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/struct.RawThreadId.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/remutex/type.MappedReentrantMutexGuard.html
Normal file
11
parking_lot/remutex/type.MappedReentrantMutexGuard.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/type.MappedReentrantMutexGuard.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/type.MappedReentrantMutexGuard.html">../../parking_lot/type.MappedReentrantMutexGuard.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/type.MappedReentrantMutexGuard.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/remutex/type.ReentrantMutex.html
Normal file
11
parking_lot/remutex/type.ReentrantMutex.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/type.ReentrantMutex.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/type.ReentrantMutex.html">../../parking_lot/type.ReentrantMutex.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/type.ReentrantMutex.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/remutex/type.ReentrantMutexGuard.html
Normal file
11
parking_lot/remutex/type.ReentrantMutexGuard.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/type.ReentrantMutexGuard.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/type.ReentrantMutexGuard.html">../../parking_lot/type.ReentrantMutexGuard.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/type.ReentrantMutexGuard.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/rwlock/fn.const_rwlock.html
Normal file
11
parking_lot/rwlock/fn.const_rwlock.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/fn.const_rwlock.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/fn.const_rwlock.html">../../parking_lot/fn.const_rwlock.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/fn.const_rwlock.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/rwlock/type.MappedRwLockReadGuard.html
Normal file
11
parking_lot/rwlock/type.MappedRwLockReadGuard.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/type.MappedRwLockReadGuard.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/type.MappedRwLockReadGuard.html">../../parking_lot/type.MappedRwLockReadGuard.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/type.MappedRwLockReadGuard.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/rwlock/type.MappedRwLockWriteGuard.html
Normal file
11
parking_lot/rwlock/type.MappedRwLockWriteGuard.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/type.MappedRwLockWriteGuard.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/type.MappedRwLockWriteGuard.html">../../parking_lot/type.MappedRwLockWriteGuard.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/type.MappedRwLockWriteGuard.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/rwlock/type.RwLock.html
Normal file
11
parking_lot/rwlock/type.RwLock.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/type.RwLock.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/type.RwLock.html">../../parking_lot/type.RwLock.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/type.RwLock.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/rwlock/type.RwLockReadGuard.html
Normal file
11
parking_lot/rwlock/type.RwLockReadGuard.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/type.RwLockReadGuard.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/type.RwLockReadGuard.html">../../parking_lot/type.RwLockReadGuard.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/type.RwLockReadGuard.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/rwlock/type.RwLockUpgradableReadGuard.html
Normal file
11
parking_lot/rwlock/type.RwLockUpgradableReadGuard.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/type.RwLockUpgradableReadGuard.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/type.RwLockUpgradableReadGuard.html">../../parking_lot/type.RwLockUpgradableReadGuard.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/type.RwLockUpgradableReadGuard.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
11
parking_lot/rwlock/type.RwLockWriteGuard.html
Normal file
11
parking_lot/rwlock/type.RwLockWriteGuard.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../parking_lot/type.RwLockWriteGuard.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../parking_lot/type.RwLockWriteGuard.html">../../parking_lot/type.RwLockWriteGuard.html</a>...</p>
|
||||
<script>location.replace("../../parking_lot/type.RwLockWriteGuard.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
1
parking_lot/sidebar-items.js
Normal file
1
parking_lot/sidebar-items.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
window.SIDEBAR_ITEMS = {"enum":["OnceState"],"fn":["const_fair_mutex","const_mutex","const_reentrant_mutex","const_rwlock"],"struct":["Condvar","Once","RawFairMutex","RawMutex","RawRwLock","RawThreadId","WaitTimeoutResult"],"type":["FairMutex","FairMutexGuard","MappedFairMutexGuard","MappedMutexGuard","MappedReentrantMutexGuard","MappedRwLockReadGuard","MappedRwLockWriteGuard","Mutex","MutexGuard","ReentrantMutex","ReentrantMutexGuard","RwLock","RwLockReadGuard","RwLockUpgradableReadGuard","RwLockWriteGuard"]};
|
||||
205
parking_lot/struct.Condvar.html
Normal file
205
parking_lot/struct.Condvar.html
Normal file
File diff suppressed because one or more lines are too long
81
parking_lot/struct.Once.html
Normal file
81
parking_lot/struct.Once.html
Normal file
File diff suppressed because one or more lines are too long
14
parking_lot/struct.RawFairMutex.html
Normal file
14
parking_lot/struct.RawFairMutex.html
Normal file
File diff suppressed because one or more lines are too long
14
parking_lot/struct.RawMutex.html
Normal file
14
parking_lot/struct.RawMutex.html
Normal file
File diff suppressed because one or more lines are too long
19
parking_lot/struct.RawRwLock.html
Normal file
19
parking_lot/struct.RawRwLock.html
Normal file
File diff suppressed because one or more lines are too long
13
parking_lot/struct.RawThreadId.html
Normal file
13
parking_lot/struct.RawThreadId.html
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Implementation of the `GetThreadId` trait for `lock_api::ReentrantMutex`."><title>RawThreadId in parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">RawThread<wbr>Id</a></h2><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-GetThreadId-for-RawThreadId" title="GetThreadId">GetThreadId</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-RawThreadId" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-RawThreadId" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-RawThreadId" title="Send">Send</a></li><li><a href="#impl-Sync-for-RawThreadId" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-RawThreadId" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-RawThreadId" title="UnwindSafe">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow<T>">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut<T>">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E-for-T" title="From<T>">From<T></a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into<U>">Into<U></a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom<U>">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto<U>">TryInto<U></a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">parking_lot</a></span><h1>Struct <span class="struct">RawThreadId</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/remutex.rs.html#13">Source</a> </span></div><pre class="rust item-decl"><code>pub struct RawThreadId;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Implementation of the <code>GetThreadId</code> trait for <code>lock_api::ReentrantMutex</code>.</p>
|
||||
</div></details><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-GetThreadId-for-RawThreadId" class="impl"><a class="src rightside" href="../src/parking_lot/remutex.rs.html#15-28">Source</a><a href="#impl-GetThreadId-for-RawThreadId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../lock_api/remutex/trait.GetThreadId.html" title="trait lock_api::remutex::GetThreadId">GetThreadId</a> for <a class="struct" href="struct.RawThreadId.html" title="struct parking_lot::RawThreadId">RawThreadId</a></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedconstant.INIT" class="associatedconstant trait-impl"><a class="src rightside" href="../src/parking_lot/remutex.rs.html#16">Source</a><a href="#associatedconstant.INIT" class="anchor">§</a><h4 class="code-header">const <a href="../lock_api/remutex/trait.GetThreadId.html#associatedconstant.INIT" class="constant">INIT</a>: <a class="struct" href="struct.RawThreadId.html" title="struct parking_lot::RawThreadId">RawThreadId</a> = RawThreadId</h4></section></summary><div class='docblock'>Initial value.</div></details><details class="toggle method-toggle" open><summary><section id="method.nonzero_thread_id" class="method trait-impl"><a class="src rightside" href="../src/parking_lot/remutex.rs.html#18-27">Source</a><a href="#method.nonzero_thread_id" class="anchor">§</a><h4 class="code-header">fn <a href="../lock_api/remutex/trait.GetThreadId.html#tymethod.nonzero_thread_id" class="fn">nonzero_thread_id</a>(&self) -> <a class="type" href="https://doc.rust-lang.org/1.84.1/core/num/nonzero/type.NonZeroUsize.html" title="type core::num::nonzero::NonZeroUsize">NonZeroUsize</a></h4></section></summary><div class='docblock'>Returns a non-zero thread ID which identifies the current thread of
|
||||
execution.</div></details></div></details></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-RawThreadId" class="impl"><a href="#impl-Freeze-for-RawThreadId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.RawThreadId.html" title="struct parking_lot::RawThreadId">RawThreadId</a></h3></section><section id="impl-RefUnwindSafe-for-RawThreadId" class="impl"><a href="#impl-RefUnwindSafe-for-RawThreadId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.RawThreadId.html" title="struct parking_lot::RawThreadId">RawThreadId</a></h3></section><section id="impl-Send-for-RawThreadId" class="impl"><a href="#impl-Send-for-RawThreadId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.RawThreadId.html" title="struct parking_lot::RawThreadId">RawThreadId</a></h3></section><section id="impl-Sync-for-RawThreadId" class="impl"><a href="#impl-Sync-for-RawThreadId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.RawThreadId.html" title="struct parking_lot::RawThreadId">RawThreadId</a></h3></section><section id="impl-Unpin-for-RawThreadId" class="impl"><a href="#impl-Unpin-for-RawThreadId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.RawThreadId.html" title="struct parking_lot::RawThreadId">RawThreadId</a></h3></section><section id="impl-UnwindSafe-for-RawThreadId" class="impl"><a href="#impl-UnwindSafe-for-RawThreadId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.RawThreadId.html" title="struct parking_lot::RawThreadId">RawThreadId</a></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
|
||||
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/any.rs.html#139">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.84.1/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/borrow.rs.html#209">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T<div class="where">where
|
||||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/borrow.rs.html#211">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/borrow.rs.html#217">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<div class="where">where
|
||||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/borrow.rs.html#218">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#765">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#768">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#748-750">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T<div class="where">where
|
||||
U: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#758">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -> U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
|
||||
<p>That is, this conversion is whatever the implementation of
|
||||
<code><a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
|
||||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#805-807">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T<div class="where">where
|
||||
U: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#809">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#812">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#790-792">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T<div class="where">where
|
||||
U: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#794">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.1/src/core/convert/mod.rs.html#797">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main></body></html>
|
||||
17
parking_lot/struct.WaitTimeoutResult.html
Normal file
17
parking_lot/struct.WaitTimeoutResult.html
Normal file
File diff suppressed because one or more lines are too long
60
parking_lot/type.FairMutex.html
Normal file
60
parking_lot/type.FairMutex.html
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A mutual exclusive primitive that is always fair, useful for protecting shared data"><title>FairMutex in parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Fair<wbr>Mutex</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#differences-from-the-standard-library-mutex" title="Differences from the standard library `Mutex`">Differences from the standard library <code>Mutex</code></a></li><li><a href="#examples" title="Examples">Examples</a></li></ul><h3><a href="#aliased-type">Aliased type</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">parking_lot</a></span><h1>Type Alias <span class="type">FairMutex</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/fair_mutex.rs.html#77">Source</a> </span></div><pre class="rust item-decl"><code>pub type FairMutex<T> = <a class="struct" href="../lock_api/mutex/struct.Mutex.html" title="struct lock_api::mutex::Mutex">Mutex</a><<a class="struct" href="struct.RawFairMutex.html" title="struct parking_lot::RawFairMutex">RawFairMutex</a>, T>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A mutual exclusive primitive that is always fair, useful for protecting shared data</p>
|
||||
<p>This mutex will block threads waiting for the lock to become available. The
|
||||
mutex can be statically initialized or created by the <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>
|
||||
<p>The regular mutex provided by <code>parking_lot</code> uses eventual fairness
|
||||
(after some time it will default to the fair algorithm), but eventual
|
||||
fairness does not provide the same guarantees an always fair method would.
|
||||
Fair mutexes are generally slower, but sometimes needed.</p>
|
||||
<p>In a fair mutex the waiters form a queue, and the lock is always granted to
|
||||
the next requester in the queue, in first-in first-out order. This ensures
|
||||
that one thread cannot starve others by quickly re-acquiring the lock after
|
||||
releasing it.</p>
|
||||
<p>A fair mutex may not be interesting if threads have different priorities (this is known as
|
||||
priority inversion).</p>
|
||||
<h2 id="differences-from-the-standard-library-mutex"><a class="doc-anchor" href="#differences-from-the-standard-library-mutex">§</a>Differences from the standard library <code>Mutex</code></h2>
|
||||
<ul>
|
||||
<li>No poisoning, the lock is released normally on panic.</li>
|
||||
<li>Only requires 1 byte of space, whereas the standard library boxes the
|
||||
<code>FairMutex</code> due to platform limitations.</li>
|
||||
<li>Can be statically constructed.</li>
|
||||
<li>Does not require any drop glue when dropped.</li>
|
||||
<li>Inline fast path for the uncontended case.</li>
|
||||
<li>Efficient handling of micro-contention using adaptive spinning.</li>
|
||||
<li>Allows raw locking & unlocking without a guard.</li>
|
||||
</ul>
|
||||
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>parking_lot::FairMutex;
|
||||
<span class="kw">use </span>std::sync::{Arc, mpsc::channel};
|
||||
<span class="kw">use </span>std::thread;
|
||||
|
||||
<span class="kw">const </span>N: usize = <span class="number">10</span>;
|
||||
|
||||
<span class="comment">// Spawn a few threads to increment a shared variable (non-atomically), and
|
||||
// let the main thread know once all increments are done.
|
||||
//
|
||||
// Here we're using an Arc to share memory among threads, and the data inside
|
||||
// the Arc is protected with a mutex.
|
||||
</span><span class="kw">let </span>data = Arc::new(FairMutex::new(<span class="number">0</span>));
|
||||
|
||||
<span class="kw">let </span>(tx, rx) = channel();
|
||||
<span class="kw">for _ in </span><span class="number">0</span>..<span class="number">10 </span>{
|
||||
<span class="kw">let </span>(data, tx) = (Arc::clone(<span class="kw-2">&</span>data), tx.clone());
|
||||
thread::spawn(<span class="kw">move </span>|| {
|
||||
<span class="comment">// The shared state can only be accessed once the lock is held.
|
||||
// Our non-atomic increment is safe because we're the only thread
|
||||
// which can access the shared state when the lock is held.
|
||||
</span><span class="kw">let </span><span class="kw-2">mut </span>data = data.lock();
|
||||
<span class="kw-2">*</span>data += <span class="number">1</span>;
|
||||
<span class="kw">if </span><span class="kw-2">*</span>data == N {
|
||||
tx.send(()).unwrap();
|
||||
}
|
||||
<span class="comment">// the lock is unlocked here when `data` goes out of scope.
|
||||
</span>});
|
||||
}
|
||||
|
||||
rx.recv().unwrap();</code></pre></div>
|
||||
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>struct FairMutex<T> { <span class="comment">/* private fields */</span> }</code></pre><script src="../type.impl/lock_api/mutex/struct.Mutex.js" data-self-path="parking_lot::fair_mutex::FairMutex" async></script></section></div></main></body></html>
|
||||
5
parking_lot/type.FairMutexGuard.html
Normal file
5
parking_lot/type.FairMutexGuard.html
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="An RAII implementation of a “scoped lock” of a mutex. When this structure is dropped (falls out of scope), the lock will be unlocked."><title>FairMutexGuard in parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Fair<wbr>Mutex<wbr>Guard</a></h2><h3><a href="#aliased-type">Aliased type</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">parking_lot</a></span><h1>Type Alias <span class="type">FairMutexGuard</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/fair_mutex.rs.html#91">Source</a> </span></div><pre class="rust item-decl"><code>pub type FairMutexGuard<'a, T> = <a class="struct" href="../lock_api/mutex/struct.MutexGuard.html" title="struct lock_api::mutex::MutexGuard">MutexGuard</a><'a, <a class="struct" href="struct.RawFairMutex.html" title="struct parking_lot::RawFairMutex">RawFairMutex</a>, T>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><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>
|
||||
<p>The data protected by the mutex can be accessed through this guard via its
|
||||
<code>Deref</code> and <code>DerefMut</code> implementations.</p>
|
||||
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>struct FairMutexGuard<'a, T> { <span class="comment">/* private fields */</span> }</code></pre><script src="../type.impl/lock_api/mutex/struct.MutexGuard.js" data-self-path="parking_lot::fair_mutex::FairMutexGuard" async></script></section></div></main></body></html>
|
||||
7
parking_lot/type.MappedFairMutexGuard.html
Normal file
7
parking_lot/type.MappedFairMutexGuard.html
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="An RAII mutex guard returned by `FairMutexGuard::map`, which can point to a subfield of the protected data."><title>MappedFairMutexGuard in parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Mapped<wbr>Fair<wbr>Mutex<wbr>Guard</a></h2><h3><a href="#aliased-type">Aliased type</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">parking_lot</a></span><h1>Type Alias <span class="type">MappedFairMutexGuard</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/fair_mutex.rs.html#100">Source</a> </span></div><pre class="rust item-decl"><code>pub type MappedFairMutexGuard<'a, T> = <a class="struct" href="../lock_api/mutex/struct.MappedMutexGuard.html" title="struct lock_api::mutex::MappedMutexGuard">MappedMutexGuard</a><'a, <a class="struct" href="struct.RawFairMutex.html" title="struct parking_lot::RawFairMutex">RawFairMutex</a>, T>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An RAII mutex guard returned by <code>FairMutexGuard::map</code>, which can point to a
|
||||
subfield of the protected data.</p>
|
||||
<p>The main difference between <code>MappedFairMutexGuard</code> and <code>FairMutexGuard</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></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>struct MappedFairMutexGuard<'a, T> { <span class="comment">/* private fields */</span> }</code></pre><script src="../type.impl/lock_api/mutex/struct.MappedMutexGuard.js" data-self-path="parking_lot::fair_mutex::MappedFairMutexGuard" async></script></section></div></main></body></html>
|
||||
7
parking_lot/type.MappedMutexGuard.html
Normal file
7
parking_lot/type.MappedMutexGuard.html
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="An RAII mutex guard returned by `MutexGuard::map`, which can point to a subfield of the protected data."><title>MappedMutexGuard in parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Mapped<wbr>Mutex<wbr>Guard</a></h2><h3><a href="#aliased-type">Aliased type</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">parking_lot</a></span><h1>Type Alias <span class="type">MappedMutexGuard</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/mutex.rs.html#109">Source</a> </span></div><pre class="rust item-decl"><code>pub type MappedMutexGuard<'a, T> = <a class="struct" href="../lock_api/mutex/struct.MappedMutexGuard.html" title="struct lock_api::mutex::MappedMutexGuard">MappedMutexGuard</a><'a, <a class="struct" href="struct.RawMutex.html" title="struct parking_lot::RawMutex">RawMutex</a>, T>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><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></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>struct MappedMutexGuard<'a, T> { <span class="comment">/* private fields */</span> }</code></pre><script src="../type.impl/lock_api/mutex/struct.MappedMutexGuard.js" data-self-path="parking_lot::mutex::MappedMutexGuard" async></script></section></div></main></body></html>
|
||||
7
parking_lot/type.MappedReentrantMutexGuard.html
Normal file
7
parking_lot/type.MappedReentrantMutexGuard.html
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="An RAII mutex guard returned by `ReentrantMutexGuard::map`, which can point to a subfield of the protected data."><title>MappedReentrantMutexGuard in parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Mapped<wbr>Reentrant<wbr>Mutex<wbr>Guard</a></h2><h3><a href="#aliased-type">Aliased type</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">parking_lot</a></span><h1>Type Alias <span class="type">MappedReentrantMutexGuard</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/remutex.rs.html#68-69">Source</a> </span></div><pre class="rust item-decl"><code>pub type MappedReentrantMutexGuard<'a, T> = <a class="struct" href="../lock_api/remutex/struct.MappedReentrantMutexGuard.html" title="struct lock_api::remutex::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a><'a, <a class="struct" href="struct.RawMutex.html" title="struct parking_lot::RawMutex">RawMutex</a>, <a class="struct" href="struct.RawThreadId.html" title="struct parking_lot::RawThreadId">RawThreadId</a>, T>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><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></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>struct MappedReentrantMutexGuard<'a, T> { <span class="comment">/* private fields */</span> }</code></pre><script src="../type.impl/lock_api/remutex/struct.MappedReentrantMutexGuard.js" data-self-path="parking_lot::remutex::MappedReentrantMutexGuard" async></script></section></div></main></body></html>
|
||||
7
parking_lot/type.MappedRwLockReadGuard.html
Normal file
7
parking_lot/type.MappedRwLockReadGuard.html
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="An RAII read lock guard returned by `RwLockReadGuard::map`, which can point to a subfield of the protected data."><title>MappedRwLockReadGuard in parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Mapped<wbr>RwLock<wbr>Read<wbr>Guard</a></h2><h3><a href="#aliased-type">Aliased type</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">parking_lot</a></span><h1>Type Alias <span class="type">MappedRwLockReadGuard</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/rwlock.rs.html#112">Source</a> </span></div><pre class="rust item-decl"><code>pub type MappedRwLockReadGuard<'a, T> = <a class="struct" href="../lock_api/rwlock/struct.MappedRwLockReadGuard.html" title="struct lock_api::rwlock::MappedRwLockReadGuard">MappedRwLockReadGuard</a><'a, <a class="struct" href="struct.RawRwLock.html" title="struct parking_lot::RawRwLock">RawRwLock</a>, T>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><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></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>struct MappedRwLockReadGuard<'a, T> { <span class="comment">/* private fields */</span> }</code></pre><script src="../type.impl/lock_api/rwlock/struct.MappedRwLockReadGuard.js" data-self-path="parking_lot::rwlock::MappedRwLockReadGuard" async></script></section></div></main></body></html>
|
||||
7
parking_lot/type.MappedRwLockWriteGuard.html
Normal file
7
parking_lot/type.MappedRwLockWriteGuard.html
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="An RAII write lock guard returned by `RwLockWriteGuard::map`, which can point to a subfield of the protected data."><title>MappedRwLockWriteGuard in parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Mapped<wbr>RwLock<wbr>Write<wbr>Guard</a></h2><h3><a href="#aliased-type">Aliased type</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">parking_lot</a></span><h1>Type Alias <span class="type">MappedRwLockWriteGuard</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/rwlock.rs.html#121">Source</a> </span></div><pre class="rust item-decl"><code>pub type MappedRwLockWriteGuard<'a, T> = <a class="struct" href="../lock_api/rwlock/struct.MappedRwLockWriteGuard.html" title="struct lock_api::rwlock::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a><'a, <a class="struct" href="struct.RawRwLock.html" title="struct parking_lot::RawRwLock">RawRwLock</a>, T>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><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></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>struct MappedRwLockWriteGuard<'a, T> { <span class="comment">/* private fields */</span> }</code></pre><script src="../type.impl/lock_api/rwlock/struct.MappedRwLockWriteGuard.js" data-self-path="parking_lot::rwlock::MappedRwLockWriteGuard" async></script></section></div></main></body></html>
|
||||
67
parking_lot/type.Mutex.html
Normal file
67
parking_lot/type.Mutex.html
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A mutual exclusion primitive useful for protecting shared data"><title>Mutex in parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Mutex</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#fairness" title="Fairness">Fairness</a></li><li><a href="#differences-from-the-standard-library-mutex" title="Differences from the standard library `Mutex`">Differences from the standard library <code>Mutex</code></a></li><li><a href="#examples" title="Examples">Examples</a></li></ul><h3><a href="#aliased-type">Aliased type</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">parking_lot</a></span><h1>Type Alias <span class="type">Mutex</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/mutex.rs.html#86">Source</a> </span></div><pre class="rust item-decl"><code>pub type Mutex<T> = <a class="struct" href="../lock_api/mutex/struct.Mutex.html" title="struct lock_api::mutex::Mutex">Mutex</a><<a class="struct" href="struct.RawMutex.html" title="struct parking_lot::RawMutex">RawMutex</a>, T>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><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 be statically initialized or created by the <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>
|
||||
<h2 id="fairness"><a class="doc-anchor" href="#fairness">§</a>Fairness</h2>
|
||||
<p>A typical unfair lock can often end up in a situation where a single thread
|
||||
quickly acquires and releases the same mutex in succession, which can starve
|
||||
other threads waiting to acquire the mutex. While this improves throughput
|
||||
because it doesn’t force a context switch when a thread tries to re-acquire
|
||||
a mutex it has just released, this can starve other threads.</p>
|
||||
<p>This mutex uses <a href="https://trac.webkit.org/changeset/203350">eventual fairness</a>
|
||||
to ensure that the lock will be fair on average without sacrificing
|
||||
throughput. This is done by forcing a fair unlock on average every 0.5ms,
|
||||
which will force the lock to go to the next thread waiting for the mutex.</p>
|
||||
<p>Additionally, any critical section longer than 1ms will always use a fair
|
||||
unlock, which has a negligible impact on throughput considering the length
|
||||
of the critical section.</p>
|
||||
<p>You can also force a fair unlock by calling <code>MutexGuard::unlock_fair</code> when
|
||||
unlocking a mutex instead of simply dropping the <code>MutexGuard</code>.</p>
|
||||
<h2 id="differences-from-the-standard-library-mutex"><a class="doc-anchor" href="#differences-from-the-standard-library-mutex">§</a>Differences from the standard library <code>Mutex</code></h2>
|
||||
<ul>
|
||||
<li>No poisoning, the lock is released normally on panic.</li>
|
||||
<li>Only requires 1 byte of space, whereas the standard library boxes the
|
||||
<code>Mutex</code> due to platform limitations.</li>
|
||||
<li>Can be statically constructed.</li>
|
||||
<li>Does not require any drop glue when dropped.</li>
|
||||
<li>Inline fast path for the uncontended case.</li>
|
||||
<li>Efficient handling of micro-contention using adaptive spinning.</li>
|
||||
<li>Allows raw locking & unlocking without a guard.</li>
|
||||
<li>Supports eventual fairness so that the mutex is fair on average.</li>
|
||||
<li>Optionally allows making the mutex fair by calling <code>MutexGuard::unlock_fair</code>.</li>
|
||||
</ul>
|
||||
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>parking_lot::Mutex;
|
||||
<span class="kw">use </span>std::sync::{Arc, mpsc::channel};
|
||||
<span class="kw">use </span>std::thread;
|
||||
|
||||
<span class="kw">const </span>N: usize = <span class="number">10</span>;
|
||||
|
||||
<span class="comment">// Spawn a few threads to increment a shared variable (non-atomically), and
|
||||
// let the main thread know once all increments are done.
|
||||
//
|
||||
// Here we're using an Arc to share memory among threads, and the data inside
|
||||
// the Arc is protected with a mutex.
|
||||
</span><span class="kw">let </span>data = Arc::new(Mutex::new(<span class="number">0</span>));
|
||||
|
||||
<span class="kw">let </span>(tx, rx) = channel();
|
||||
<span class="kw">for _ in </span><span class="number">0</span>..<span class="number">10 </span>{
|
||||
<span class="kw">let </span>(data, tx) = (Arc::clone(<span class="kw-2">&</span>data), tx.clone());
|
||||
thread::spawn(<span class="kw">move </span>|| {
|
||||
<span class="comment">// The shared state can only be accessed once the lock is held.
|
||||
// Our non-atomic increment is safe because we're the only thread
|
||||
// which can access the shared state when the lock is held.
|
||||
</span><span class="kw">let </span><span class="kw-2">mut </span>data = data.lock();
|
||||
<span class="kw-2">*</span>data += <span class="number">1</span>;
|
||||
<span class="kw">if </span><span class="kw-2">*</span>data == N {
|
||||
tx.send(()).unwrap();
|
||||
}
|
||||
<span class="comment">// the lock is unlocked here when `data` goes out of scope.
|
||||
</span>});
|
||||
}
|
||||
|
||||
rx.recv().unwrap();</code></pre></div>
|
||||
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>struct Mutex<T> { <span class="comment">/* private fields */</span> }</code></pre><script src="../type.impl/lock_api/mutex/struct.Mutex.js" data-self-path="parking_lot::mutex::Mutex" async></script></section></div></main></body></html>
|
||||
5
parking_lot/type.MutexGuard.html
Normal file
5
parking_lot/type.MutexGuard.html
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="An RAII implementation of a “scoped lock” of a mutex. When this structure is dropped (falls out of scope), the lock will be unlocked."><title>MutexGuard in parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Mutex<wbr>Guard</a></h2><h3><a href="#aliased-type">Aliased type</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">parking_lot</a></span><h1>Type Alias <span class="type">MutexGuard</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/mutex.rs.html#100">Source</a> </span></div><pre class="rust item-decl"><code>pub type MutexGuard<'a, T> = <a class="struct" href="../lock_api/mutex/struct.MutexGuard.html" title="struct lock_api::mutex::MutexGuard">MutexGuard</a><'a, <a class="struct" href="struct.RawMutex.html" title="struct parking_lot::RawMutex">RawMutex</a>, T>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><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>
|
||||
<p>The data protected by the mutex can be accessed through this guard via its
|
||||
<code>Deref</code> and <code>DerefMut</code> implementations.</p>
|
||||
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>struct MutexGuard<'a, T> { <span class="comment">/* private fields */</span> }</code></pre><script src="../type.impl/lock_api/mutex/struct.MutexGuard.js" data-self-path="parking_lot::mutex::MutexGuard" async></script></section></div></main></body></html>
|
||||
11
parking_lot/type.ReentrantMutex.html
Normal file
11
parking_lot/type.ReentrantMutex.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="A mutex which can be recursively locked by a single thread."><title>ReentrantMutex in parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Reentrant<wbr>Mutex</a></h2><h3><a href="#aliased-type">Aliased type</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">parking_lot</a></span><h1>Type Alias <span class="type">ReentrantMutex</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/remutex.rs.html#41">Source</a> </span></div><pre class="rust item-decl"><code>pub type ReentrantMutex<T> = <a class="struct" href="../lock_api/remutex/struct.ReentrantMutex.html" title="struct lock_api::remutex::ReentrantMutex">ReentrantMutex</a><<a class="struct" href="struct.RawMutex.html" title="struct parking_lot::RawMutex">RawMutex</a>, <a class="struct" href="struct.RawThreadId.html" title="struct parking_lot::RawThreadId">RawThreadId</a>, T>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A mutex which can be recursively locked by a single thread.</p>
|
||||
<p>This type is identical to <code>Mutex</code> except for the following points:</p>
|
||||
<ul>
|
||||
<li>Locking multiple times from the same thread will work correctly instead of
|
||||
deadlocking.</li>
|
||||
<li><code>ReentrantMutexGuard</code> does not give mutable references to the locked data.
|
||||
Use a <code>RefCell</code> if you need this.</li>
|
||||
</ul>
|
||||
<p>See <a href="type.Mutex.html" title="type parking_lot::Mutex"><code>Mutex</code></a> for more details about the underlying mutex
|
||||
primitive.</p>
|
||||
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>struct ReentrantMutex<T> { <span class="comment">/* private fields */</span> }</code></pre><script src="../type.impl/lock_api/remutex/struct.ReentrantMutex.js" data-self-path="parking_lot::remutex::ReentrantMutex" async></script></section></div></main></body></html>
|
||||
5
parking_lot/type.ReentrantMutexGuard.html
Normal file
5
parking_lot/type.ReentrantMutexGuard.html
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="An RAII implementation of a “scoped lock” of a reentrant mutex. When this structure is dropped (falls out of scope), the lock will be unlocked."><title>ReentrantMutexGuard in parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Reentrant<wbr>Mutex<wbr>Guard</a></h2><h3><a href="#aliased-type">Aliased type</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">parking_lot</a></span><h1>Type Alias <span class="type">ReentrantMutexGuard</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/remutex.rs.html#59">Source</a> </span></div><pre class="rust item-decl"><code>pub type ReentrantMutexGuard<'a, T> = <a class="struct" href="../lock_api/remutex/struct.ReentrantMutexGuard.html" title="struct lock_api::remutex::ReentrantMutexGuard">ReentrantMutexGuard</a><'a, <a class="struct" href="struct.RawMutex.html" title="struct parking_lot::RawMutex">RawMutex</a>, <a class="struct" href="struct.RawThreadId.html" title="struct parking_lot::RawThreadId">RawThreadId</a>, T>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><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></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>struct ReentrantMutexGuard<'a, T> { <span class="comment">/* private fields */</span> }</code></pre><script src="../type.impl/lock_api/remutex/struct.ReentrantMutexGuard.js" data-self-path="parking_lot::remutex::ReentrantMutexGuard" async></script></section></div></main></body></html>
|
||||
67
parking_lot/type.RwLock.html
Normal file
67
parking_lot/type.RwLock.html
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A reader-writer lock"><title>RwLock in parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">RwLock</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#fairness" title="Fairness">Fairness</a></li><li><a href="#differences-from-the-standard-library-rwlock" title="Differences from the standard library `RwLock`">Differences from the standard library <code>RwLock</code></a></li><li><a href="#examples" title="Examples">Examples</a></li></ul><h3><a href="#aliased-type">Aliased type</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">parking_lot</a></span><h1>Type Alias <span class="type">RwLock</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/rwlock.rs.html#88">Source</a> </span></div><pre class="rust item-decl"><code>pub type RwLock<T> = <a class="struct" href="../lock_api/rwlock/struct.RwLock.html" title="struct lock_api::rwlock::RwLock">RwLock</a><<a class="struct" href="struct.RawRwLock.html" title="struct parking_lot::RawRwLock">RawRwLock</a>, T>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A reader-writer lock</p>
|
||||
<p>This type of lock allows a number of readers or at most one writer at any
|
||||
point in time. The write portion of this lock typically allows modification
|
||||
of the underlying data (exclusive access) and the read portion of this lock
|
||||
typically allows for read-only access (shared access).</p>
|
||||
<p>This lock uses a task-fair locking policy which avoids both reader and
|
||||
writer starvation. This means that readers trying to acquire the lock will
|
||||
block even if the lock is unlocked when there are writers waiting to acquire
|
||||
the lock. Because of this, attempts to recursively acquire a read lock
|
||||
within a single thread may result in a deadlock.</p>
|
||||
<p>The type parameter <code>T</code> represents the data that this lock protects. It is
|
||||
required that <code>T</code> satisfies <code>Send</code> to be shared across threads and <code>Sync</code> to
|
||||
allow concurrent access through readers. The RAII guards returned from the
|
||||
locking methods implement <code>Deref</code> (and <code>DerefMut</code> for the <code>write</code> methods)
|
||||
to allow access to the contained of the lock.</p>
|
||||
<h2 id="fairness"><a class="doc-anchor" href="#fairness">§</a>Fairness</h2>
|
||||
<p>A typical unfair lock can often end up in a situation where a single thread
|
||||
quickly acquires and releases the same lock in succession, which can starve
|
||||
other threads waiting to acquire the rwlock. While this improves throughput
|
||||
because it doesn’t force a context switch when a thread tries to re-acquire
|
||||
a rwlock it has just released, this can starve other threads.</p>
|
||||
<p>This rwlock uses <a href="https://trac.webkit.org/changeset/203350">eventual fairness</a>
|
||||
to ensure that the lock will be fair on average without sacrificing
|
||||
throughput. This is done by forcing a fair unlock on average every 0.5ms,
|
||||
which will force the lock to go to the next thread waiting for the rwlock.</p>
|
||||
<p>Additionally, any critical section longer than 1ms will always use a fair
|
||||
unlock, which has a negligible impact on throughput considering the length
|
||||
of the critical section.</p>
|
||||
<p>You can also force a fair unlock by calling <code>RwLockReadGuard::unlock_fair</code>
|
||||
or <code>RwLockWriteGuard::unlock_fair</code> when unlocking a mutex instead of simply
|
||||
dropping the guard.</p>
|
||||
<h2 id="differences-from-the-standard-library-rwlock"><a class="doc-anchor" href="#differences-from-the-standard-library-rwlock">§</a>Differences from the standard library <code>RwLock</code></h2>
|
||||
<ul>
|
||||
<li>Supports atomically downgrading a write lock into a read lock.</li>
|
||||
<li>Task-fair locking policy instead of an unspecified platform default.</li>
|
||||
<li>No poisoning, the lock is released normally on panic.</li>
|
||||
<li>Only requires 1 word of space, whereas the standard library boxes the
|
||||
<code>RwLock</code> due to platform limitations.</li>
|
||||
<li>Can be statically constructed.</li>
|
||||
<li>Does not require any drop glue when dropped.</li>
|
||||
<li>Inline fast path for the uncontended case.</li>
|
||||
<li>Efficient handling of micro-contention using adaptive spinning.</li>
|
||||
<li>Allows raw locking & unlocking without a guard.</li>
|
||||
<li>Supports eventual fairness so that the rwlock is fair on average.</li>
|
||||
<li>Optionally allows making the rwlock fair by calling
|
||||
<code>RwLockReadGuard::unlock_fair</code> and <code>RwLockWriteGuard::unlock_fair</code>.</li>
|
||||
</ul>
|
||||
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>parking_lot::RwLock;
|
||||
|
||||
<span class="kw">let </span>lock = RwLock::new(<span class="number">5</span>);
|
||||
|
||||
<span class="comment">// many reader locks can be held at once
|
||||
</span>{
|
||||
<span class="kw">let </span>r1 = lock.read();
|
||||
<span class="kw">let </span>r2 = lock.read();
|
||||
<span class="macro">assert_eq!</span>(<span class="kw-2">*</span>r1, <span class="number">5</span>);
|
||||
<span class="macro">assert_eq!</span>(<span class="kw-2">*</span>r2, <span class="number">5</span>);
|
||||
} <span class="comment">// read locks are dropped at this point
|
||||
|
||||
// only one write lock may be held, however
|
||||
</span>{
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>w = lock.write();
|
||||
<span class="kw-2">*</span>w += <span class="number">1</span>;
|
||||
<span class="macro">assert_eq!</span>(<span class="kw-2">*</span>w, <span class="number">6</span>);
|
||||
} <span class="comment">// write lock is dropped here</span></code></pre></div>
|
||||
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>struct RwLock<T> { <span class="comment">/* private fields */</span> }</code></pre><script src="../type.impl/lock_api/rwlock/struct.RwLock.js" data-self-path="parking_lot::rwlock::RwLock" async></script></section></div></main></body></html>
|
||||
3
parking_lot/type.RwLockReadGuard.html
Normal file
3
parking_lot/type.RwLockReadGuard.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="RAII structure used to release the shared read access of a lock when dropped."><title>RwLockReadGuard in parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">RwLock<wbr>Read<wbr>Guard</a></h2><h3><a href="#aliased-type">Aliased type</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">parking_lot</a></span><h1>Type Alias <span class="type">RwLockReadGuard</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/rwlock.rs.html#99">Source</a> </span></div><pre class="rust item-decl"><code>pub type RwLockReadGuard<'a, T> = <a class="struct" href="../lock_api/rwlock/struct.RwLockReadGuard.html" title="struct lock_api::rwlock::RwLockReadGuard">RwLockReadGuard</a><'a, <a class="struct" href="struct.RawRwLock.html" title="struct parking_lot::RawRwLock">RawRwLock</a>, T>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>RAII structure used to release the shared read access of a lock when
|
||||
dropped.</p>
|
||||
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>struct RwLockReadGuard<'a, T> { <span class="comment">/* private fields */</span> }</code></pre><script src="../type.impl/lock_api/rwlock/struct.RwLockReadGuard.js" data-self-path="parking_lot::rwlock::RwLockReadGuard" async></script></section></div></main></body></html>
|
||||
3
parking_lot/type.RwLockUpgradableReadGuard.html
Normal file
3
parking_lot/type.RwLockUpgradableReadGuard.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="RAII structure used to release the upgradable read access of a lock when dropped."><title>RwLockUpgradableReadGuard in parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">RwLock<wbr>Upgradable<wbr>Read<wbr>Guard</a></h2><h3><a href="#aliased-type">Aliased type</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">parking_lot</a></span><h1>Type Alias <span class="type">RwLockUpgradableReadGuard</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/rwlock.rs.html#125">Source</a> </span></div><pre class="rust item-decl"><code>pub type RwLockUpgradableReadGuard<'a, T> = <a class="struct" href="../lock_api/rwlock/struct.RwLockUpgradableReadGuard.html" title="struct lock_api::rwlock::RwLockUpgradableReadGuard">RwLockUpgradableReadGuard</a><'a, <a class="struct" href="struct.RawRwLock.html" title="struct parking_lot::RawRwLock">RawRwLock</a>, T>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>RAII structure used to release the upgradable read access of a lock when
|
||||
dropped.</p>
|
||||
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>struct RwLockUpgradableReadGuard<'a, T> { <span class="comment">/* private fields */</span> }</code></pre><script src="../type.impl/lock_api/rwlock/struct.RwLockUpgradableReadGuard.js" data-self-path="parking_lot::rwlock::RwLockUpgradableReadGuard" async></script></section></div></main></body></html>
|
||||
3
parking_lot/type.RwLockWriteGuard.html
Normal file
3
parking_lot/type.RwLockWriteGuard.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="RAII structure used to release the exclusive write access of a lock when dropped."><title>RwLockWriteGuard in parking_lot - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="parking_lot" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../parking_lot/index.html">parking_<wbr>lot</a><span class="version">0.12.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">RwLock<wbr>Write<wbr>Guard</a></h2><h3><a href="#aliased-type">Aliased type</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">parking_lot</a></span><h1>Type Alias <span class="type">RwLockWriteGuard</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/parking_lot/rwlock.rs.html#103">Source</a> </span></div><pre class="rust item-decl"><code>pub type RwLockWriteGuard<'a, T> = <a class="struct" href="../lock_api/rwlock/struct.RwLockWriteGuard.html" title="struct lock_api::rwlock::RwLockWriteGuard">RwLockWriteGuard</a><'a, <a class="struct" href="struct.RawRwLock.html" title="struct parking_lot::RawRwLock">RawRwLock</a>, T>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>RAII structure used to release the exclusive write access of a lock when
|
||||
dropped.</p>
|
||||
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>struct RwLockWriteGuard<'a, T> { <span class="comment">/* private fields */</span> }</code></pre><script src="../type.impl/lock_api/rwlock/struct.RwLockWriteGuard.js" data-self-path="parking_lot::rwlock::RwLockWriteGuard" async></script></section></div></main></body></html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue