deploy: de38ae62916547ad097c066f94a32e9ba7790eeb

This commit is contained in:
NotAShelf 2025-02-05 00:10:33 +00:00
commit 9a86359447
28502 changed files with 1261284 additions and 0 deletions

View 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_core" 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_core/index.html">parking_<wbr>lot_<wbr>core</a><span class="version">0.9.10</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="#constants" title="Constants">Constants</a></li><li><a href="#functions" title="Functions">Functions</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.ParkToken.html">ParkToken</a></li><li><a href="struct.SpinWait.html">SpinWait</a></li><li><a href="struct.UnparkResult.html">UnparkResult</a></li><li><a href="struct.UnparkToken.html">UnparkToken</a></li></ul><h3 id="enums">Enums</h3><ul class="all-items"><li><a href="enum.FilterOp.html">FilterOp</a></li><li><a href="enum.ParkResult.html">ParkResult</a></li><li><a href="enum.RequeueOp.html">RequeueOp</a></li></ul><h3 id="functions">Functions</h3><ul class="all-items"><li><a href="deadlock/fn.acquire_resource.html">deadlock::acquire_resource</a></li><li><a href="deadlock/fn.release_resource.html">deadlock::release_resource</a></li><li><a href="fn.park.html">park</a></li><li><a href="fn.unpark_all.html">unpark_all</a></li><li><a href="fn.unpark_filter.html">unpark_filter</a></li><li><a href="fn.unpark_one.html">unpark_one</a></li><li><a href="fn.unpark_requeue.html">unpark_requeue</a></li></ul><h3 id="constants">Constants</h3><ul class="all-items"><li><a href="constant.DEFAULT_PARK_TOKEN.html">DEFAULT_PARK_TOKEN</a></li><li><a href="constant.DEFAULT_UNPARK_TOKEN.html">DEFAULT_UNPARK_TOKEN</a></li></ul></section></div></main></body></html>

View file

@ -0,0 +1,2 @@
<!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 default park token to use."><title>DEFAULT_PARK_TOKEN in parking_lot_core - 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_core" 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 constant"><!--[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_core/index.html">parking_<wbr>lot_<wbr>core</a><span class="version">0.9.10</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_core</a></span><h1>Constant <span class="constant">DEFAULT_PARK_TOKEN</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_core/parking_lot.rs.html#560">Source</a> </span></div><pre class="rust item-decl"><code>pub const DEFAULT_PARK_TOKEN: <a class="struct" href="struct.ParkToken.html" title="struct parking_lot_core::ParkToken">ParkToken</a>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A default park token to use.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,2 @@
<!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 default unpark token to use."><title>DEFAULT_UNPARK_TOKEN in parking_lot_core - 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_core" 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 constant"><!--[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_core/index.html">parking_<wbr>lot_<wbr>core</a><span class="version">0.9.10</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_core</a></span><h1>Constant <span class="constant">DEFAULT_UNPARK_TOKEN</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_core/parking_lot.rs.html#557">Source</a> </span></div><pre class="rust item-decl"><code>pub const DEFAULT_UNPARK_TOKEN: <a class="struct" href="struct.UnparkToken.html" title="struct parking_lot_core::UnparkToken">UnparkToken</a>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A default unpark token to use.</p>
</div></details></section></div></main></body></html>

View 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="Acquire a resource identified by key in the deadlock detector Noop if `deadlock_detection` feature isnt enabled."><title>acquire_resource in parking_lot_core::deadlock - 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_core" 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_core/index.html">parking_<wbr>lot_<wbr>core</a><span class="version">0.9.10</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">acquire_<wbr>resource</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#safety" title="Safety">Safety</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In parking_<wbr>lot_<wbr>core::<wbr>deadlock</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_core</a>::<wbr><a href="index.html">deadlock</a></span><h1>Function <span class="fn">acquire_resource</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_core/parking_lot.rs.html#1112-1115">Source</a> </span></div><pre class="rust item-decl"><code>pub unsafe fn acquire_resource(_key: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Acquire a resource identified by key in the deadlock detector
Noop if <code>deadlock_detection</code> feature isnt enabled.</p>
<h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
<p>Call after the resource is acquired</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,7 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Release a resource identified by key in the deadlock detector. Noop if `deadlock_detection` feature isnt enabled."><title>release_resource in parking_lot_core::deadlock - 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_core" 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_core/index.html">parking_<wbr>lot_<wbr>core</a><span class="version">0.9.10</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">release_<wbr>resource</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li><li><a href="#safety" title="Safety">Safety</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In parking_<wbr>lot_<wbr>core::<wbr>deadlock</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_core</a>::<wbr><a href="index.html">deadlock</a></span><h1>Function <span class="fn">release_resource</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_core/parking_lot.rs.html#1128-1131">Source</a> </span></div><pre class="rust item-decl"><code>pub unsafe fn release_resource(_key: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Release a resource identified by key in the deadlock detector.
Noop if <code>deadlock_detection</code> feature isnt enabled.</p>
<h2 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h2>
<p>Panics if the resource was already released or wasnt acquired in this thread.</p>
<h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
<p>Call before the resource is released</p>
</div></details></section></div></main></body></html>

View 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="[Experimental] Deadlock detection"><title>parking_lot_core::deadlock - 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_core" 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 mod"><!--[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_core/index.html">parking_<wbr>lot_<wbr>core</a><span class="version">0.9.10</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module deadlock</a></h2><h3><a href="#functions">Module Items</a></h3><ul class="block"><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate parking_<wbr>lot_<wbr>core</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_core</a></span><h1>Module <span>deadlock</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_core/parking_lot.rs.html#1098">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>[Experimental] Deadlock detection</p>
<p>Enabled via the <code>deadlock_detection</code> feature flag.</p>
</div></details><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.acquire_resource.html" title="fn parking_lot_core::deadlock::acquire_resource">acquire_<wbr>resource</a><sup title="unsafe function"></sup></div><div class="desc docblock-short">Acquire a resource identified by key in the deadlock detector
Noop if <code>deadlock_detection</code> feature isnt enabled.</div></li><li><div class="item-name"><a class="fn" href="fn.release_resource.html" title="fn parking_lot_core::deadlock::release_resource">release_<wbr>resource</a><sup title="unsafe function"></sup></div><div class="desc docblock-short">Release a resource identified by key in the deadlock detector.
Noop if <code>deadlock_detection</code> feature isnt enabled.</div></li></ul></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"fn":["acquire_resource","release_resource"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,29 @@
<!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="Parks the current thread in the queue associated with the given key."><title>park in parking_lot_core - 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_core" 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_core/index.html">parking_<wbr>lot_<wbr>core</a><span class="version">0.9.10</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">park</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#safety" title="Safety">Safety</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot_<wbr>core</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_core</a></span><h1>Function <span class="fn">park</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_core/parking_lot.rs.html#591-706">Source</a> </span></div><pre class="rust item-decl"><code>pub unsafe fn park(
key: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>,
validate: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a>,
before_sleep: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(),
timed_out: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a>),
park_token: <a class="struct" href="struct.ParkToken.html" title="struct parking_lot_core::ParkToken">ParkToken</a>,
timeout: <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.84.1/std/time/struct.Instant.html" title="struct std::time::Instant">Instant</a>&gt;,
) -&gt; <a class="enum" href="enum.ParkResult.html" title="enum parking_lot_core::ParkResult">ParkResult</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Parks the current thread in the queue associated with the given key.</p>
<p>The <code>validate</code> function is called while the queue is locked and can abort
the operation by returning false. If <code>validate</code> returns true then the
current thread is appended to the queue and the queue is unlocked.</p>
<p>The <code>before_sleep</code> function is called after the queue is unlocked but before
the thread is put to sleep. The thread will then sleep until it is unparked
or the given timeout is reached.</p>
<p>The <code>timed_out</code> function is also called while the queue is locked, but only
if the timeout was reached. It is passed the key of the queue it was in when
it timed out, which may be different from the original key if
<code>unpark_requeue</code> was called. It is also passed a bool which indicates
whether it was the last thread in the queue.</p>
<h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
<p>You should only call this function with an address that you control, since
you could otherwise interfere with the operation of other synchronization
primitives.</p>
<p>The <code>validate</code> and <code>timed_out</code> functions are called while the queue is
locked and must not panic or call into any function in <code>parking_lot</code>.</p>
<p>The <code>before_sleep</code> function is called outside the queue lock and is allowed
to call <code>unpark_one</code>, <code>unpark_all</code>, <code>unpark_requeue</code> or <code>unpark_filter</code>, but
it is not allowed to call <code>park</code> or panic.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Unparks all threads in the queue associated with the given key."><title>unpark_all in parking_lot_core - 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_core" 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_core/index.html">parking_<wbr>lot_<wbr>core</a><span class="version">0.9.10</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">unpark_<wbr>all</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#safety" title="Safety">Safety</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot_<wbr>core</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_core</a></span><h1>Function <span class="fn">unpark_all</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_core/parking_lot.rs.html#813-858">Source</a> </span></div><pre class="rust item-decl"><code>pub unsafe fn unpark_all(key: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>, unpark_token: <a class="struct" href="struct.UnparkToken.html" title="struct parking_lot_core::UnparkToken">UnparkToken</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Unparks all threads in the queue associated with the given key.</p>
<p>The given <code>UnparkToken</code> is passed to all unparked threads.</p>
<p>This function returns the number of threads that were unparked.</p>
<h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
<p>You should only call this function with an address that you control, since
you could otherwise interfere with the operation of other synchronization
primitives.</p>
<p>The <code>parking_lot</code> functions are not re-entrant and calling this method
from the context of an asynchronous signal handler may result in undefined
behavior, including corruption of internal state and/or deadlocks.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,25 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Unparks a number of threads from the front of the queue associated with `key` depending on the results of a filter function which inspects the `ParkToken` associated with each thread."><title>unpark_filter in parking_lot_core - 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_core" 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_core/index.html">parking_<wbr>lot_<wbr>core</a><span class="version">0.9.10</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">unpark_<wbr>filter</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#safety" title="Safety">Safety</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot_<wbr>core</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_core</a></span><h1>Function <span class="fn">unpark_filter</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_core/parking_lot.rs.html#1020-1093">Source</a> </span></div><pre class="rust item-decl"><code>pub unsafe fn unpark_filter(
key: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>,
filter: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="struct" href="struct.ParkToken.html" title="struct parking_lot_core::ParkToken">ParkToken</a>) -&gt; <a class="enum" href="enum.FilterOp.html" title="enum parking_lot_core::FilterOp">FilterOp</a>,
callback: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(<a class="struct" href="struct.UnparkResult.html" title="struct parking_lot_core::UnparkResult">UnparkResult</a>) -&gt; <a class="struct" href="struct.UnparkToken.html" title="struct parking_lot_core::UnparkToken">UnparkToken</a>,
) -&gt; <a class="struct" href="struct.UnparkResult.html" title="struct parking_lot_core::UnparkResult">UnparkResult</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Unparks a number of threads from the front of the queue associated with
<code>key</code> depending on the results of a filter function which inspects the
<code>ParkToken</code> associated with each thread.</p>
<p>The <code>filter</code> function is called for each thread in the queue or until
<code>FilterOp::Stop</code> is returned. This function is passed the <code>ParkToken</code>
associated with a particular thread, which is unparked if <code>FilterOp::Unpark</code>
is returned.</p>
<p>The <code>callback</code> function is also called while both queues are locked. It is
passed an <code>UnparkResult</code> indicating the number of threads that were unparked
and whether there are still parked threads in the queue. This <code>UnparkResult</code>
value is also returned by <code>unpark_filter</code>.</p>
<p>The <code>callback</code> function should return an <code>UnparkToken</code> value which will be
passed to all threads that are unparked. If no thread is unparked then the
returned value is ignored.</p>
<h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
<p>You should only call this function with an address that you control, since
you could otherwise interfere with the operation of other synchronization
primitives.</p>
<p>The <code>filter</code> and <code>callback</code> functions are called while the queue is locked
and must not panic or call into any function in <code>parking_lot</code>.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,21 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Unparks one thread from the queue associated with the given key."><title>unpark_one in parking_lot_core - 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_core" 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_core/index.html">parking_<wbr>lot_<wbr>core</a><span class="version">0.9.10</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">unpark_<wbr>one</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#safety" title="Safety">Safety</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot_<wbr>core</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_core</a></span><h1>Function <span class="fn">unpark_one</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_core/parking_lot.rs.html#732-795">Source</a> </span></div><pre class="rust item-decl"><code>pub unsafe fn unpark_one(
key: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>,
callback: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(<a class="struct" href="struct.UnparkResult.html" title="struct parking_lot_core::UnparkResult">UnparkResult</a>) -&gt; <a class="struct" href="struct.UnparkToken.html" title="struct parking_lot_core::UnparkToken">UnparkToken</a>,
) -&gt; <a class="struct" href="struct.UnparkResult.html" title="struct parking_lot_core::UnparkResult">UnparkResult</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Unparks one thread from the queue associated with the given key.</p>
<p>The <code>callback</code> function is called while the queue is locked and before the
target thread is woken up. The <code>UnparkResult</code> argument to the function
indicates whether a thread was found in the queue and whether this was the
last thread in the queue. This value is also returned by <code>unpark_one</code>.</p>
<p>The <code>callback</code> function should return an <code>UnparkToken</code> value which will be
passed to the thread that is unparked. If no thread is unparked then the
returned value is ignored.</p>
<h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
<p>You should only call this function with an address that you control, since
you could otherwise interfere with the operation of other synchronization
primitives.</p>
<p>The <code>callback</code> function is called while the queue is locked and must not
panic or call into any function in <code>parking_lot</code>.</p>
<p>The <code>parking_lot</code> functions are not re-entrant and calling this method
from the context of an asynchronous signal handler may result in undefined
behavior, including corruption of internal state and/or deadlocks.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,27 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Removes all threads from the queue associated with `key_from`, optionally unparks the first one and requeues the rest onto the queue associated with `key_to`."><title>unpark_requeue in parking_lot_core - 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_core" 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_core/index.html">parking_<wbr>lot_<wbr>core</a><span class="version">0.9.10</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">unpark_<wbr>requeue</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#safety" title="Safety">Safety</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot_<wbr>core</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_core</a></span><h1>Function <span class="fn">unpark_requeue</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_core/parking_lot.rs.html#888-991">Source</a> </span></div><pre class="rust item-decl"><code>pub unsafe fn unpark_requeue(
key_from: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>,
key_to: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.usize.html">usize</a>,
validate: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -&gt; <a class="enum" href="enum.RequeueOp.html" title="enum parking_lot_core::RequeueOp">RequeueOp</a>,
callback: impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(<a class="enum" href="enum.RequeueOp.html" title="enum parking_lot_core::RequeueOp">RequeueOp</a>, <a class="struct" href="struct.UnparkResult.html" title="struct parking_lot_core::UnparkResult">UnparkResult</a>) -&gt; <a class="struct" href="struct.UnparkToken.html" title="struct parking_lot_core::UnparkToken">UnparkToken</a>,
) -&gt; <a class="struct" href="struct.UnparkResult.html" title="struct parking_lot_core::UnparkResult">UnparkResult</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Removes all threads from the queue associated with <code>key_from</code>, optionally
unparks the first one and requeues the rest onto the queue associated with
<code>key_to</code>.</p>
<p>The <code>validate</code> function is called while both queues are locked. Its return
value will determine which operation is performed, or whether the operation
should be aborted. See <code>RequeueOp</code> for details about the different possible
return values.</p>
<p>The <code>callback</code> function is also called while both queues are locked. It is
passed the <code>RequeueOp</code> returned by <code>validate</code> and an <code>UnparkResult</code>
indicating whether a thread was unparked and whether there are threads still
parked in the new queue. This <code>UnparkResult</code> value is also returned by
<code>unpark_requeue</code>.</p>
<p>The <code>callback</code> function should return an <code>UnparkToken</code> value which will be
passed to the thread that is unparked. If no thread is unparked then the
returned value is ignored.</p>
<h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
<p>You should only call this function with an address that you control, since
you could otherwise interfere with the operation of other synchronization
primitives.</p>
<p>The <code>validate</code> and <code>callback</code> functions are called while the queue is locked
and must not panic or call into any function in <code>parking_lot</code>.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,31 @@
<!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 exposes a low-level API for creating your own efficient synchronization primitives."><title>parking_lot_core - 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_core" 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_core/index.html">parking_<wbr>lot_<wbr>core</a><span class="version">0.9.10</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="#">Sections</a></h3><ul class="block top-toc"><li><a href="#the-parking-lot" title="The parking lot">The parking lot</a></li><li><a href="#building-custom-synchronization-primitives" title="Building custom synchronization primitives">Building custom synchronization primitives</a></li></ul><h3><a href="#modules">Crate Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#constants" title="Constants">Constants</a></li><li><a href="#functions" title="Functions">Functions</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_core</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_core/lib.rs.html#8-67">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This library exposes a low-level API for creating your own efficient
synchronization primitives.</p>
<h2 id="the-parking-lot"><a class="doc-anchor" href="#the-parking-lot">§</a>The parking lot</h2>
<p>To keep synchronization primitives small, all thread queuing and suspending
functionality is offloaded to the <em>parking lot</em>. The idea behind this is based
on the Webkit <a href="https://webkit.org/blog/6161/locking-in-webkit/"><code>WTF::ParkingLot</code></a>
class, which essentially consists of a hash table mapping of lock addresses
to queues of parked (sleeping) threads. The Webkit parking lot was itself
inspired by Linux <a href="http://man7.org/linux/man-pages/man2/futex.2.html">futexes</a>,
but it is more powerful since it allows invoking callbacks while holding a
queue lock.</p>
<p>There are two main operations that can be performed on the parking lot:</p>
<ul>
<li><em>Parking</em> refers to suspending the thread while simultaneously enqueuing it
on a queue keyed by some address.</li>
<li><em>Unparking</em> refers to dequeuing a thread from a queue keyed by some address
and resuming it.</li>
</ul>
<p>See the documentation of the individual functions for more details.</p>
<h2 id="building-custom-synchronization-primitives"><a class="doc-anchor" href="#building-custom-synchronization-primitives">§</a>Building custom synchronization primitives</h2>
<p>Building custom synchronization primitives is very simple since the parking
lot takes care of all the hard parts for you. A simple example for a
custom primitive would be to integrate a <code>Mutex</code> inside another data type.
Since a mutex only requires 2 bits, it can share space with other data.
For example, one could create an <code>ArcMutex</code> type that combines the atomic
reference count and the two mutex bits in the same atomic word.</p>
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="mod" href="deadlock/index.html" title="mod parking_lot_core::deadlock">deadlock</a></div><div class="desc docblock-short">[Experimental] Deadlock detection</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.ParkToken.html" title="struct parking_lot_core::ParkToken">Park<wbr>Token</a></div><div class="desc docblock-short">A value associated with a parked thread which can be used by <code>unpark_filter</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.SpinWait.html" title="struct parking_lot_core::SpinWait">Spin<wbr>Wait</a></div><div class="desc docblock-short">A counter used to perform exponential backoff in spin loops.</div></li><li><div class="item-name"><a class="struct" href="struct.UnparkResult.html" title="struct parking_lot_core::UnparkResult">Unpark<wbr>Result</a></div><div class="desc docblock-short">Result of an unpark operation.</div></li><li><div class="item-name"><a class="struct" href="struct.UnparkToken.html" title="struct parking_lot_core::UnparkToken">Unpark<wbr>Token</a></div><div class="desc docblock-short">A value which is passed from an unparker to a parked thread.</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.FilterOp.html" title="enum parking_lot_core::FilterOp">Filter<wbr>Op</a></div><div class="desc docblock-short">Operation that <code>unpark_filter</code> should perform for each thread.</div></li><li><div class="item-name"><a class="enum" href="enum.ParkResult.html" title="enum parking_lot_core::ParkResult">Park<wbr>Result</a></div><div class="desc docblock-short">Result of a park operation.</div></li><li><div class="item-name"><a class="enum" href="enum.RequeueOp.html" title="enum parking_lot_core::RequeueOp">Requeue<wbr>Op</a></div><div class="desc docblock-short">Operation that <code>unpark_requeue</code> should perform.</div></li></ul><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="constant" href="constant.DEFAULT_PARK_TOKEN.html" title="constant parking_lot_core::DEFAULT_PARK_TOKEN">DEFAULT_<wbr>PARK_<wbr>TOKEN</a></div><div class="desc docblock-short">A default park token to use.</div></li><li><div class="item-name"><a class="constant" href="constant.DEFAULT_UNPARK_TOKEN.html" title="constant parking_lot_core::DEFAULT_UNPARK_TOKEN">DEFAULT_<wbr>UNPARK_<wbr>TOKEN</a></div><div class="desc docblock-short">A default unpark token to use.</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.park.html" title="fn parking_lot_core::park">park</a><sup title="unsafe function"></sup></div><div class="desc docblock-short">Parks the current thread in the queue associated with the given key.</div></li><li><div class="item-name"><a class="fn" href="fn.unpark_all.html" title="fn parking_lot_core::unpark_all">unpark_<wbr>all</a><sup title="unsafe function"></sup></div><div class="desc docblock-short">Unparks all threads in the queue associated with the given key.</div></li><li><div class="item-name"><a class="fn" href="fn.unpark_filter.html" title="fn parking_lot_core::unpark_filter">unpark_<wbr>filter</a><sup title="unsafe function"></sup></div><div class="desc docblock-short">Unparks a number of threads from the front of the queue associated with
<code>key</code> depending on the results of a filter function which inspects the
<code>ParkToken</code> associated with each thread.</div></li><li><div class="item-name"><a class="fn" href="fn.unpark_one.html" title="fn parking_lot_core::unpark_one">unpark_<wbr>one</a><sup title="unsafe function"></sup></div><div class="desc docblock-short">Unparks one thread from the queue associated with the given key.</div></li><li><div class="item-name"><a class="fn" href="fn.unpark_requeue.html" title="fn parking_lot_core::unpark_requeue">unpark_<wbr>requeue</a><sup title="unsafe function"></sup></div><div class="desc docblock-short">Removes all threads from the queue associated with <code>key_from</code>, optionally
unparks the first one and requeues the rest onto the queue associated with
<code>key_to</code>.</div></li></ul></section></div></main></body></html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../parking_lot_core/constant.DEFAULT_PARK_TOKEN.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../parking_lot_core/constant.DEFAULT_PARK_TOKEN.html">../../parking_lot_core/constant.DEFAULT_PARK_TOKEN.html</a>...</p>
<script>location.replace("../../parking_lot_core/constant.DEFAULT_PARK_TOKEN.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../parking_lot_core/constant.DEFAULT_UNPARK_TOKEN.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../parking_lot_core/constant.DEFAULT_UNPARK_TOKEN.html">../../parking_lot_core/constant.DEFAULT_UNPARK_TOKEN.html</a>...</p>
<script>location.replace("../../parking_lot_core/constant.DEFAULT_UNPARK_TOKEN.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../parking_lot_core/deadlock/fn.acquire_resource.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../parking_lot_core/deadlock/fn.acquire_resource.html">../../../parking_lot_core/deadlock/fn.acquire_resource.html</a>...</p>
<script>location.replace("../../../parking_lot_core/deadlock/fn.acquire_resource.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../parking_lot_core/deadlock/fn.release_resource.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../parking_lot_core/deadlock/fn.release_resource.html">../../../parking_lot_core/deadlock/fn.release_resource.html</a>...</p>
<script>location.replace("../../../parking_lot_core/deadlock/fn.release_resource.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../parking_lot_core/deadlock/index.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../parking_lot_core/deadlock/index.html">../../../parking_lot_core/deadlock/index.html</a>...</p>
<script>location.replace("../../../parking_lot_core/deadlock/index.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../parking_lot_core/enum.FilterOp.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../parking_lot_core/enum.FilterOp.html">../../parking_lot_core/enum.FilterOp.html</a>...</p>
<script>location.replace("../../parking_lot_core/enum.FilterOp.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../parking_lot_core/enum.ParkResult.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../parking_lot_core/enum.ParkResult.html">../../parking_lot_core/enum.ParkResult.html</a>...</p>
<script>location.replace("../../parking_lot_core/enum.ParkResult.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../parking_lot_core/enum.RequeueOp.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../parking_lot_core/enum.RequeueOp.html">../../parking_lot_core/enum.RequeueOp.html</a>...</p>
<script>location.replace("../../parking_lot_core/enum.RequeueOp.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../parking_lot_core/fn.park.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../parking_lot_core/fn.park.html">../../parking_lot_core/fn.park.html</a>...</p>
<script>location.replace("../../parking_lot_core/fn.park.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../parking_lot_core/fn.unpark_all.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../parking_lot_core/fn.unpark_all.html">../../parking_lot_core/fn.unpark_all.html</a>...</p>
<script>location.replace("../../parking_lot_core/fn.unpark_all.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../parking_lot_core/fn.unpark_filter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../parking_lot_core/fn.unpark_filter.html">../../parking_lot_core/fn.unpark_filter.html</a>...</p>
<script>location.replace("../../parking_lot_core/fn.unpark_filter.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../parking_lot_core/fn.unpark_one.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../parking_lot_core/fn.unpark_one.html">../../parking_lot_core/fn.unpark_one.html</a>...</p>
<script>location.replace("../../parking_lot_core/fn.unpark_one.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../parking_lot_core/fn.unpark_requeue.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../parking_lot_core/fn.unpark_requeue.html">../../parking_lot_core/fn.unpark_requeue.html</a>...</p>
<script>location.replace("../../parking_lot_core/fn.unpark_requeue.html" + location.search + location.hash);</script>
</body>
</html>

View file

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

View file

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

View file

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

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"constant":["DEFAULT_PARK_TOKEN","DEFAULT_UNPARK_TOKEN"],"enum":["FilterOp","ParkResult","RequeueOp"],"fn":["park","unpark_all","unpark_filter","unpark_one","unpark_requeue"],"mod":["deadlock"],"struct":["ParkToken","SpinWait","UnparkResult","UnparkToken"]};

View file

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

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,24 @@
<!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 counter used to perform exponential backoff in spin loops."><title>SpinWait in parking_lot_core - 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_core" 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_core/index.html">parking_<wbr>lot_<wbr>core</a><span class="version">0.9.10</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Spin<wbr>Wait</a></h2><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.new" title="new">new</a></li><li><a href="#method.reset" title="reset">reset</a></li><li><a href="#method.spin" title="spin">spin</a></li><li><a href="#method.spin_no_yield" title="spin_no_yield">spin_no_yield</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Default-for-SpinWait" title="Default">Default</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-SpinWait" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-SpinWait" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-SpinWait" title="Send">Send</a></li><li><a href="#impl-Sync-for-SpinWait" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-SpinWait" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-SpinWait" 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&#60;T&#62;">Borrow&#60;T&#62;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut&#60;T&#62;">BorrowMut&#60;T&#62;</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From&#60;T&#62;">From&#60;T&#62;</a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into&#60;U&#62;">Into&#60;U&#62;</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom&#60;U&#62;">TryFrom&#60;U&#62;</a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto&#60;U&#62;">TryInto&#60;U&#62;</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate parking_<wbr>lot_<wbr>core</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_core</a></span><h1>Struct <span class="struct">SpinWait</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_core/spinwait.rs.html#22-24">Source</a> </span></div><pre class="rust item-decl"><code>pub struct SpinWait { <span class="comment">/* private fields */</span> }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A counter used to perform exponential backoff in spin loops.</p>
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-SpinWait" class="impl"><a class="src rightside" href="../src/parking_lot_core/spinwait.rs.html#26-74">Source</a><a href="#impl-SpinWait" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.SpinWait.html" title="struct parking_lot_core::SpinWait">SpinWait</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new" class="method"><a class="src rightside" href="../src/parking_lot_core/spinwait.rs.html#29-31">Source</a><h4 class="code-header">pub fn <a href="#method.new" class="fn">new</a>() -&gt; Self</h4></section></summary><div class="docblock"><p>Creates a new <code>SpinWait</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.reset" class="method"><a class="src rightside" href="../src/parking_lot_core/spinwait.rs.html#35-37">Source</a><h4 class="code-header">pub fn <a href="#method.reset" class="fn">reset</a>(&amp;mut self)</h4></section></summary><div class="docblock"><p>Resets a <code>SpinWait</code> to its initial state.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.spin" class="method"><a class="src rightside" href="../src/parking_lot_core/spinwait.rs.html#48-59">Source</a><h4 class="code-header">pub fn <a href="#method.spin" class="fn">spin</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Spins until the sleep threshold has been reached.</p>
<p>This function returns whether the sleep threshold has been reached, at
which point further spinning has diminishing returns and the thread
should be parked instead.</p>
<p>The spin strategy will initially use a CPU-bound loop but will fall back
to yielding the CPU to the OS after a few iterations.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.spin_no_yield" class="method"><a class="src rightside" href="../src/parking_lot_core/spinwait.rs.html#67-73">Source</a><h4 class="code-header">pub fn <a href="#method.spin_no_yield" class="fn">spin_no_yield</a>(&amp;mut self)</h4></section></summary><div class="docblock"><p>Spins without yielding the thread to the OS.</p>
<p>Instead, the backoff is simply capped at a maximum value. This can be
used to improve throughput in <code>compare_exchange</code> loops that have high
contention.</p>
</div></details></div></details></div><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-Default-for-SpinWait" class="impl"><a class="src rightside" href="../src/parking_lot_core/spinwait.rs.html#21">Source</a><a href="#impl-Default-for-SpinWait" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="struct.SpinWait.html" title="struct parking_lot_core::SpinWait">SpinWait</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.default" class="method trait-impl"><a class="src rightside" href="../src/parking_lot_core/spinwait.rs.html#21">Source</a><a href="#method.default" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.1/core/default/trait.Default.html#tymethod.default" class="fn">default</a>() -&gt; <a class="struct" href="struct.SpinWait.html" title="struct parking_lot_core::SpinWait">SpinWait</a></h4></section></summary><div class='docblock'>Returns the “default value” for a type. <a href="https://doc.rust-lang.org/1.84.1/core/default/trait.Default.html#tymethod.default">Read more</a></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-SpinWait" class="impl"><a href="#impl-Freeze-for-SpinWait" 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.SpinWait.html" title="struct parking_lot_core::SpinWait">SpinWait</a></h3></section><section id="impl-RefUnwindSafe-for-SpinWait" class="impl"><a href="#impl-RefUnwindSafe-for-SpinWait" 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.SpinWait.html" title="struct parking_lot_core::SpinWait">SpinWait</a></h3></section><section id="impl-Send-for-SpinWait" class="impl"><a href="#impl-Send-for-SpinWait" 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.SpinWait.html" title="struct parking_lot_core::SpinWait">SpinWait</a></h3></section><section id="impl-Sync-for-SpinWait" class="impl"><a href="#impl-Sync-for-SpinWait" 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.SpinWait.html" title="struct parking_lot_core::SpinWait">SpinWait</a></h3></section><section id="impl-Unpin-for-SpinWait" class="impl"><a href="#impl-Unpin-for-SpinWait" 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.SpinWait.html" title="struct parking_lot_core::SpinWait">SpinWait</a></h3></section><section id="impl-UnwindSafe-for-SpinWait" class="impl"><a href="#impl-UnwindSafe-for-SpinWait" 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.SpinWait.html" title="struct parking_lot_core::SpinWait">SpinWait</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&lt;T&gt; <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>(&amp;self) -&gt; <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&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; 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>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;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&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; 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>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;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&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; 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) -&gt; 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&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; 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>&lt;T&gt;,</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) -&gt; 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>&lt;T&gt; 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&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; 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>&lt;T&gt;,</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) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<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>&gt;</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&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; 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>&lt;T&gt;,</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> = &lt;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>&lt;T&gt;&gt;::<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) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<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>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long