deploy: 59bc89f2973040d84fca6872dc7bf30c6343a1c2

This commit is contained in:
korken89 2021-08-26 13:49:42 +00:00
parent 6a075f56d2
commit 11687827f8
149 changed files with 17731 additions and 7 deletions

View File

@ -1 +1 @@
window.ALL_CRATES = ["byteorder","hash32","heapless","stable_deref_trait"];
window.ALL_CRATES = ["byteorder","hash32","heapless","lock_api","scopeguard","spin","stable_deref_trait"];

View File

@ -1,3 +1,5 @@
(function() {var implementors = {};
implementors["heapless"] = [{"text":"impl&lt;'a, const N:&nbsp;usize&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a>&lt;&amp;'a str&gt; for <a class=\"struct\" href=\"heapless/struct.String.html\" title=\"struct heapless::String\">String</a>&lt;N&gt;","synthetic":false,"types":["heapless::string::String"]},{"text":"impl&lt;const N:&nbsp;usize&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a>&lt;i8&gt; for <a class=\"struct\" href=\"heapless/struct.String.html\" title=\"struct heapless::String\">String</a>&lt;N&gt;","synthetic":false,"types":["heapless::string::String"]},{"text":"impl&lt;const N:&nbsp;usize&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a>&lt;i16&gt; for <a class=\"struct\" href=\"heapless/struct.String.html\" title=\"struct heapless::String\">String</a>&lt;N&gt;","synthetic":false,"types":["heapless::string::String"]},{"text":"impl&lt;const N:&nbsp;usize&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a>&lt;i32&gt; for <a class=\"struct\" href=\"heapless/struct.String.html\" title=\"struct heapless::String\">String</a>&lt;N&gt;","synthetic":false,"types":["heapless::string::String"]},{"text":"impl&lt;const N:&nbsp;usize&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a>&lt;i64&gt; for <a class=\"struct\" href=\"heapless/struct.String.html\" title=\"struct heapless::String\">String</a>&lt;N&gt;","synthetic":false,"types":["heapless::string::String"]},{"text":"impl&lt;const N:&nbsp;usize&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a>&lt;u8&gt; for <a class=\"struct\" href=\"heapless/struct.String.html\" title=\"struct heapless::String\">String</a>&lt;N&gt;","synthetic":false,"types":["heapless::string::String"]},{"text":"impl&lt;const N:&nbsp;usize&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a>&lt;u16&gt; for <a class=\"struct\" href=\"heapless/struct.String.html\" title=\"struct heapless::String\">String</a>&lt;N&gt;","synthetic":false,"types":["heapless::string::String"]},{"text":"impl&lt;const N:&nbsp;usize&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a>&lt;u32&gt; for <a class=\"struct\" href=\"heapless/struct.String.html\" title=\"struct heapless::String\">String</a>&lt;N&gt;","synthetic":false,"types":["heapless::string::String"]},{"text":"impl&lt;const N:&nbsp;usize&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a>&lt;u64&gt; for <a class=\"struct\" href=\"heapless/struct.String.html\" title=\"struct heapless::String\">String</a>&lt;N&gt;","synthetic":false,"types":["heapless::string::String"]}];
implementors["lock_api"] = [{"text":"impl&lt;R:&nbsp;<a class=\"trait\" href=\"lock_api/trait.RawMutex.html\" title=\"trait lock_api::RawMutex\">RawMutex</a>, T&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a>&lt;T&gt; for <a class=\"struct\" href=\"lock_api/struct.Mutex.html\" title=\"struct lock_api::Mutex\">Mutex</a>&lt;R, T&gt;","synthetic":false,"types":["lock_api::mutex::Mutex"]},{"text":"impl&lt;R:&nbsp;<a class=\"trait\" href=\"lock_api/trait.RawMutex.html\" title=\"trait lock_api::RawMutex\">RawMutex</a>, G:&nbsp;<a class=\"trait\" href=\"lock_api/trait.GetThreadId.html\" title=\"trait lock_api::GetThreadId\">GetThreadId</a>, T&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a>&lt;T&gt; for <a class=\"struct\" href=\"lock_api/struct.ReentrantMutex.html\" title=\"struct lock_api::ReentrantMutex\">ReentrantMutex</a>&lt;R, G, T&gt;","synthetic":false,"types":["lock_api::remutex::ReentrantMutex"]},{"text":"impl&lt;R:&nbsp;<a class=\"trait\" href=\"lock_api/trait.RawRwLock.html\" title=\"trait lock_api::RawRwLock\">RawRwLock</a>, T&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a>&lt;T&gt; for <a class=\"struct\" href=\"lock_api/struct.RwLock.html\" title=\"struct lock_api::RwLock\">RwLock</a>&lt;R, T&gt;","synthetic":false,"types":["lock_api::rwlock::RwLock"]}];
implementors["spin"] = [{"text":"impl&lt;T, R&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a>&lt;T&gt; for <a class=\"struct\" href=\"spin/mutex/spin/struct.SpinMutex.html\" title=\"struct spin::mutex::spin::SpinMutex\">SpinMutex</a>&lt;T, R&gt;","synthetic":false,"types":["spin::mutex::spin::SpinMutex"]},{"text":"impl&lt;T, R&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a>&lt;T&gt; for <a class=\"struct\" href=\"spin/mutex/struct.Mutex.html\" title=\"struct spin::mutex::Mutex\">Mutex</a>&lt;T, R&gt;","synthetic":false,"types":["spin::mutex::Mutex"]},{"text":"impl&lt;T, R&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a>&lt;T&gt; for <a class=\"struct\" href=\"spin/once/struct.Once.html\" title=\"struct spin::once::Once\">Once</a>&lt;T, R&gt;","synthetic":false,"types":["spin::once::Once"]},{"text":"impl&lt;T, R&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a>&lt;T&gt; for <a class=\"struct\" href=\"spin/rwlock/struct.RwLock.html\" title=\"struct spin::rwlock::RwLock\">RwLock</a>&lt;T, R&gt;","synthetic":false,"types":["spin::rwlock::RwLock"]}];
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()

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

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,6 @@
(function() {var implementors = {};
implementors["heapless"] = [{"text":"impl&lt;const N:&nbsp;usize&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.DerefMut.html\" title=\"trait core::ops::deref::DerefMut\">DerefMut</a> for <a class=\"struct\" href=\"heapless/struct.String.html\" title=\"struct heapless::String\">String</a>&lt;N&gt;","synthetic":false,"types":["heapless::string::String"]},{"text":"impl&lt;T, const N:&nbsp;usize&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.DerefMut.html\" title=\"trait core::ops::deref::DerefMut\">DerefMut</a> for <a class=\"struct\" href=\"heapless/struct.Vec.html\" title=\"struct heapless::Vec\">Vec</a>&lt;T, N&gt;","synthetic":false,"types":["heapless::vec::Vec"]},{"text":"impl&lt;T, K, const N:&nbsp;usize&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.DerefMut.html\" title=\"trait core::ops::deref::DerefMut\">DerefMut</a> for <a class=\"struct\" href=\"heapless/binary_heap/struct.PeekMut.html\" title=\"struct heapless::binary_heap::PeekMut\">PeekMut</a>&lt;'_, T, K, N&gt; <span class=\"where fmt-newline\">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/cmp/trait.Ord.html\" title=\"trait core::cmp::Ord\">Ord</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;K: Kind,&nbsp;</span>","synthetic":false,"types":["heapless::binary_heap::PeekMut"]},{"text":"impl&lt;P&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.DerefMut.html\" title=\"trait core::ops::deref::DerefMut\">DerefMut</a> for <a class=\"struct\" href=\"heapless/pool/singleton/struct.Box.html\" title=\"struct heapless::pool::singleton::Box\">Box</a>&lt;P&gt; <span class=\"where fmt-newline\">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class=\"trait\" href=\"heapless/pool/singleton/trait.Pool.html\" title=\"trait heapless::pool::singleton::Pool\">Pool</a>,&nbsp;</span>","synthetic":false,"types":["heapless::pool::singleton::Box"]},{"text":"impl&lt;T&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.DerefMut.html\" title=\"trait core::ops::deref::DerefMut\">DerefMut</a> for <a class=\"struct\" href=\"heapless/pool/struct.Box.html\" title=\"struct heapless::pool::Box\">Box</a>&lt;T&gt;","synthetic":false,"types":["heapless::pool::Box"]},{"text":"impl&lt;T, Idx, Kind, const N:&nbsp;usize&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.DerefMut.html\" title=\"trait core::ops::deref::DerefMut\">DerefMut</a> for <a class=\"struct\" href=\"heapless/sorted_linked_list/struct.FindMut.html\" title=\"struct heapless::sorted_linked_list::FindMut\">FindMut</a>&lt;'_, T, Idx, Kind, N&gt; <span class=\"where fmt-newline\">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/cmp/trait.Ord.html\" title=\"trait core::cmp::Ord\">Ord</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Idx: <a class=\"trait\" href=\"heapless/sorted_linked_list/trait.SortedLinkedListIndex.html\" title=\"trait heapless::sorted_linked_list::SortedLinkedListIndex\">SortedLinkedListIndex</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Kind: LLKind,&nbsp;</span>","synthetic":false,"types":["heapless::sorted_linked_list::FindMut"]}];
implementors["lock_api"] = [{"text":"impl&lt;'a, R:&nbsp;<a class=\"trait\" href=\"lock_api/trait.RawMutex.html\" title=\"trait lock_api::RawMutex\">RawMutex</a> + 'a, T:&nbsp;?<a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html\" title=\"trait core::marker::Sized\">Sized</a> + 'a&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.DerefMut.html\" title=\"trait core::ops::deref::DerefMut\">DerefMut</a> for <a class=\"struct\" href=\"lock_api/struct.MutexGuard.html\" title=\"struct lock_api::MutexGuard\">MutexGuard</a>&lt;'a, R, T&gt;","synthetic":false,"types":["lock_api::mutex::MutexGuard"]},{"text":"impl&lt;'a, R:&nbsp;<a class=\"trait\" href=\"lock_api/trait.RawMutex.html\" title=\"trait lock_api::RawMutex\">RawMutex</a> + 'a, T:&nbsp;?<a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html\" title=\"trait core::marker::Sized\">Sized</a> + 'a&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.DerefMut.html\" title=\"trait core::ops::deref::DerefMut\">DerefMut</a> for <a class=\"struct\" href=\"lock_api/struct.MappedMutexGuard.html\" title=\"struct lock_api::MappedMutexGuard\">MappedMutexGuard</a>&lt;'a, R, T&gt;","synthetic":false,"types":["lock_api::mutex::MappedMutexGuard"]},{"text":"impl&lt;'a, R:&nbsp;<a class=\"trait\" href=\"lock_api/trait.RawRwLock.html\" title=\"trait lock_api::RawRwLock\">RawRwLock</a> + 'a, T:&nbsp;?<a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html\" title=\"trait core::marker::Sized\">Sized</a> + 'a&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.DerefMut.html\" title=\"trait core::ops::deref::DerefMut\">DerefMut</a> for <a class=\"struct\" href=\"lock_api/struct.RwLockWriteGuard.html\" title=\"struct lock_api::RwLockWriteGuard\">RwLockWriteGuard</a>&lt;'a, R, T&gt;","synthetic":false,"types":["lock_api::rwlock::RwLockWriteGuard"]},{"text":"impl&lt;'a, R:&nbsp;<a class=\"trait\" href=\"lock_api/trait.RawRwLock.html\" title=\"trait lock_api::RawRwLock\">RawRwLock</a> + 'a, T:&nbsp;?<a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html\" title=\"trait core::marker::Sized\">Sized</a> + 'a&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.DerefMut.html\" title=\"trait core::ops::deref::DerefMut\">DerefMut</a> for <a class=\"struct\" href=\"lock_api/struct.MappedRwLockWriteGuard.html\" title=\"struct lock_api::MappedRwLockWriteGuard\">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt;","synthetic":false,"types":["lock_api::rwlock::MappedRwLockWriteGuard"]}];
implementors["scopeguard"] = [{"text":"impl&lt;T, F, S&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.DerefMut.html\" title=\"trait core::ops::deref::DerefMut\">DerefMut</a> for <a class=\"struct\" href=\"scopeguard/struct.ScopeGuard.html\" title=\"struct scopeguard::ScopeGuard\">ScopeGuard</a>&lt;T, F, S&gt; <span class=\"where fmt-newline\">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html\" title=\"trait core::ops::function::FnOnce\">FnOnce</a>(T),<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class=\"trait\" href=\"scopeguard/trait.Strategy.html\" title=\"trait scopeguard::Strategy\">Strategy</a>,&nbsp;</span>","synthetic":false,"types":["scopeguard::ScopeGuard"]}];
implementors["spin"] = [{"text":"impl&lt;'a, T:&nbsp;?<a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html\" title=\"trait core::marker::Sized\">Sized</a>&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.DerefMut.html\" title=\"trait core::ops::deref::DerefMut\">DerefMut</a> for <a class=\"struct\" href=\"spin/mutex/spin/struct.SpinMutexGuard.html\" title=\"struct spin::mutex::spin::SpinMutexGuard\">SpinMutexGuard</a>&lt;'a, T&gt;","synthetic":false,"types":["spin::mutex::spin::SpinMutexGuard"]},{"text":"impl&lt;'a, T:&nbsp;?<a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html\" title=\"trait core::marker::Sized\">Sized</a>&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.DerefMut.html\" title=\"trait core::ops::deref::DerefMut\">DerefMut</a> for <a class=\"struct\" href=\"spin/mutex/struct.MutexGuard.html\" title=\"struct spin::mutex::MutexGuard\">MutexGuard</a>&lt;'a, T&gt;","synthetic":false,"types":["spin::mutex::MutexGuard"]},{"text":"impl&lt;'rwlock, T:&nbsp;?<a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html\" title=\"trait core::marker::Sized\">Sized</a>, R&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.DerefMut.html\" title=\"trait core::ops::deref::DerefMut\">DerefMut</a> for <a class=\"struct\" href=\"spin/rwlock/struct.RwLockWriteGuard.html\" title=\"struct spin::rwlock::RwLockWriteGuard\">RwLockWriteGuard</a>&lt;'rwlock, T, R&gt;","synthetic":false,"types":["spin::rwlock::RwLockWriteGuard"]}];
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,3 @@
(function() {var implementors = {};
implementors["spin"] = [{"text":"impl&lt;R:&nbsp;<a class=\"trait\" href=\"spin/relax/trait.RelaxStrategy.html\" title=\"trait spin::relax::RelaxStrategy\">RelaxStrategy</a>&gt; <a class=\"trait\" href=\"lock_api/mutex/trait.RawMutex.html\" title=\"trait lock_api::mutex::RawMutex\">RawMutex</a> for <a class=\"struct\" href=\"spin/mutex/spin/struct.SpinMutex.html\" title=\"struct spin::mutex::spin::SpinMutex\">SpinMutex</a>&lt;(), R&gt;","synthetic":false,"types":["spin::mutex::spin::SpinMutex"]},{"text":"impl&lt;R:&nbsp;<a class=\"trait\" href=\"spin/relax/trait.RelaxStrategy.html\" title=\"trait spin::relax::RelaxStrategy\">RelaxStrategy</a>&gt; <a class=\"trait\" href=\"lock_api/mutex/trait.RawMutex.html\" title=\"trait lock_api::mutex::RawMutex\">RawMutex</a> for <a class=\"struct\" href=\"spin/mutex/struct.Mutex.html\" title=\"struct spin::mutex::Mutex\">Mutex</a>&lt;(), R&gt;","synthetic":false,"types":["spin::mutex::Mutex"]}];
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()

View File

@ -0,0 +1,3 @@
(function() {var implementors = {};
implementors["spin"] = [{"text":"impl&lt;R:&nbsp;<a class=\"trait\" href=\"spin/relax/trait.RelaxStrategy.html\" title=\"trait spin::relax::RelaxStrategy\">RelaxStrategy</a>&gt; <a class=\"trait\" href=\"lock_api/rwlock/trait.RawRwLock.html\" title=\"trait lock_api::rwlock::RawRwLock\">RawRwLock</a> for <a class=\"struct\" href=\"spin/rwlock/struct.RwLock.html\" title=\"struct spin::rwlock::RwLock\">RwLock</a>&lt;(), R&gt;","synthetic":false,"types":["spin::rwlock::RwLock"]}];
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()

View File

@ -0,0 +1,3 @@
(function() {var implementors = {};
implementors["spin"] = [{"text":"impl&lt;R:&nbsp;<a class=\"trait\" href=\"spin/relax/trait.RelaxStrategy.html\" title=\"trait spin::relax::RelaxStrategy\">RelaxStrategy</a>&gt; <a class=\"trait\" href=\"lock_api/rwlock/trait.RawRwLockDowngrade.html\" title=\"trait lock_api::rwlock::RawRwLockDowngrade\">RawRwLockDowngrade</a> for <a class=\"struct\" href=\"spin/rwlock/struct.RwLock.html\" title=\"struct spin::rwlock::RwLock\">RwLock</a>&lt;(), R&gt;","synthetic":false,"types":["spin::rwlock::RwLock"]}];
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()

View File

@ -0,0 +1,3 @@
(function() {var implementors = {};
implementors["spin"] = [{"text":"impl&lt;R:&nbsp;<a class=\"trait\" href=\"spin/relax/trait.RelaxStrategy.html\" title=\"trait spin::relax::RelaxStrategy\">RelaxStrategy</a>&gt; <a class=\"trait\" href=\"lock_api/rwlock/trait.RawRwLockUpgrade.html\" title=\"trait lock_api::rwlock::RawRwLockUpgrade\">RawRwLockUpgrade</a> for <a class=\"struct\" href=\"spin/rwlock/struct.RwLock.html\" title=\"struct spin::rwlock::RwLock\">RwLock</a>&lt;(), R&gt;","synthetic":false,"types":["spin::rwlock::RwLock"]}];
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()

View File

@ -0,0 +1,3 @@
(function() {var implementors = {};
implementors["scopeguard"] = [];
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()

View File

@ -0,0 +1,3 @@
(function() {var implementors = {};
implementors["spin"] = [];
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()

5
lock_api/all.html Normal file
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="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Crate lock_api</h2><div class="block version"><p>Version 0.4.4</p></div><a id="all-types" href="index.html"><p>Back to index</p></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">List of all items</span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span>
</span>
</h1><h3 id="Structs">Structs</h3><ul class="structs docblock"><li><a href="struct.GuardNoSend.html">GuardNoSend</a></li><li><a href="struct.GuardSend.html">GuardSend</a></li><li><a href="struct.MappedMutexGuard.html">MappedMutexGuard</a></li><li><a href="struct.MappedReentrantMutexGuard.html">MappedReentrantMutexGuard</a></li><li><a href="struct.MappedRwLockReadGuard.html">MappedRwLockReadGuard</a></li><li><a href="struct.MappedRwLockWriteGuard.html">MappedRwLockWriteGuard</a></li><li><a href="struct.Mutex.html">Mutex</a></li><li><a href="struct.MutexGuard.html">MutexGuard</a></li><li><a href="struct.RawReentrantMutex.html">RawReentrantMutex</a></li><li><a href="struct.ReentrantMutex.html">ReentrantMutex</a></li><li><a href="struct.ReentrantMutexGuard.html">ReentrantMutexGuard</a></li><li><a href="struct.RwLock.html">RwLock</a></li><li><a href="struct.RwLockReadGuard.html">RwLockReadGuard</a></li><li><a href="struct.RwLockUpgradableReadGuard.html">RwLockUpgradableReadGuard</a></li><li><a href="struct.RwLockWriteGuard.html">RwLockWriteGuard</a></li></ul><h3 id="Traits">Traits</h3><ul class="traits docblock"><li><a href="trait.GetThreadId.html">GetThreadId</a></li><li><a href="trait.RawMutex.html">RawMutex</a></li><li><a href="trait.RawMutexFair.html">RawMutexFair</a></li><li><a href="trait.RawMutexTimed.html">RawMutexTimed</a></li><li><a href="trait.RawRwLock.html">RawRwLock</a></li><li><a href="trait.RawRwLockDowngrade.html">RawRwLockDowngrade</a></li><li><a href="trait.RawRwLockFair.html">RawRwLockFair</a></li><li><a href="trait.RawRwLockRecursive.html">RawRwLockRecursive</a></li><li><a href="trait.RawRwLockRecursiveTimed.html">RawRwLockRecursiveTimed</a></li><li><a href="trait.RawRwLockTimed.html">RawRwLockTimed</a></li><li><a href="trait.RawRwLockUpgrade.html">RawRwLockUpgrade</a></li><li><a href="trait.RawRwLockUpgradeDowngrade.html">RawRwLockUpgradeDowngrade</a></li><li><a href="trait.RawRwLockUpgradeFair.html">RawRwLockUpgradeFair</a></li><li><a href="trait.RawRwLockUpgradeTimed.html">RawRwLockUpgradeTimed</a></li></ul></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

120
lock_api/index.html Normal file
View File

@ -0,0 +1,120 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="This library provides type-safe and fully-featured `Mutex` and `RwLock` types which wrap a simple raw mutex or rwlock type. This has several benefits: not only does it eliminate a large portion of the work in implementing custom lock types, it also allows users to write code which is generic with regards to different lock implementations."><meta name="keywords" content="rust, rustlang, rust-lang, lock_api"><title>lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Crate lock_api</h2><div class="block version"><p>Version 0.4.4</p></div><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all lock_api's items</p></a><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li></ul></div><div id="sidebar-vars" data-name="lock_api" data-ty="mod" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">lock_api</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/lib.rs.html#8-111" title="goto source code">[src]</a></span></h1><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This library provides type-safe and fully-featured <code>Mutex</code> and <code>RwLock</code>
types which wrap a simple raw mutex or rwlock type. This has several
benefits: not only does it eliminate a large portion of the work in
implementing custom lock types, it also allows users to write code which is
generic with regards to different lock implementations.</p>
<p>Basic usage of this crate is very straightforward:</p>
<ol>
<li>Create a raw lock type. This should only contain the lock state, not any
data protected by the lock.</li>
<li>Implement the <code>RawMutex</code> trait for your custom lock type.</li>
<li>Export your mutex as a type alias for <code>lock_api::Mutex</code>, and
your mutex guard as a type alias for <code>lock_api::MutexGuard</code>.
See the <a href="#example">example</a> below for details.</li>
</ol>
<p>This process is similar for RwLocks, except that two guards need to be
exported instead of one. (Or 3 guards if your type supports upgradable read
locks, see <a href="#extension-traits">extension traits</a> below for details)</p>
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">lock_api</span>::{<span class="ident">RawMutex</span>, <span class="ident">Mutex</span>, <span class="ident">GuardSend</span>};
<span class="kw">use</span> <span class="ident">std::sync::atomic</span>::{<span class="ident">AtomicBool</span>, <span class="ident">Ordering</span>};
<span class="comment">// 1. Define our raw lock type</span>
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">RawSpinlock</span>(<span class="ident">AtomicBool</span>);
<span class="comment">// 2. Implement RawMutex for this type</span>
<span class="kw">unsafe</span> <span class="kw">impl</span> <span class="ident">RawMutex</span> <span class="kw">for</span> <span class="ident">RawSpinlock</span> {
<span class="kw">const</span> <span class="ident">INIT</span>: <span class="ident">RawSpinlock</span> <span class="op">=</span> <span class="ident">RawSpinlock</span>(<span class="ident">AtomicBool::new</span>(<span class="bool-val">false</span>));
<span class="comment">// A spinlock guard can be sent to another thread and unlocked there</span>
<span class="kw">type</span> <span class="ident">GuardMarker</span> <span class="op">=</span> <span class="ident">GuardSend</span>;
<span class="kw">fn</span> <span class="ident">lock</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) {
<span class="comment">// Note: This isn&#39;t the best way of implementing a spinlock, but it</span>
<span class="comment">// suffices for the sake of this example.</span>
<span class="kw">while</span> <span class="op">!</span><span class="self">self</span>.<span class="ident">try_lock</span>() {}
}
<span class="kw">fn</span> <span class="ident">try_lock</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">bool</span> {
<span class="self">self</span>.<span class="number">0</span>
.<span class="ident">compare_exchange</span>(<span class="bool-val">false</span>, <span class="bool-val">true</span>, <span class="ident">Ordering::Acquire</span>, <span class="ident">Ordering::Relaxed</span>)
.<span class="ident">is_ok</span>()
}
<span class="kw">unsafe</span> <span class="kw">fn</span> <span class="ident">unlock</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) {
<span class="self">self</span>.<span class="number">0</span>.<span class="ident">store</span>(<span class="bool-val">false</span>, <span class="ident">Ordering::Release</span>);
}
}
<span class="comment">// 3. Export the wrappers. This are the types that your users will actually use.</span>
<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">Spinlock</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">lock_api::Mutex</span><span class="op">&lt;</span><span class="ident">RawSpinlock</span>, <span class="ident">T</span><span class="op">&gt;</span>;
<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">SpinlockGuard</span><span class="op">&lt;</span><span class="lifetime">&#39;a</span>, <span class="ident">T</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">lock_api::MutexGuard</span><span class="op">&lt;</span><span class="lifetime">&#39;a</span>, <span class="ident">RawSpinlock</span>, <span class="ident">T</span><span class="op">&gt;</span>;</pre></div>
<h1 id="extension-traits" class="section-header"><a href="#extension-traits">Extension traits</a></h1>
<p>In addition to basic locking &amp; unlocking functionality, you have the option
of exposing additional functionality in your lock types by implementing
additional traits for it. Examples of extension features include:</p>
<ul>
<li>Fair unlocking (<code>RawMutexFair</code>, <code>RawRwLockFair</code>)</li>
<li>Lock timeouts (<code>RawMutexTimed</code>, <code>RawRwLockTimed</code>)</li>
<li>Downgradable write locks (<code>RawRwLockDowngradable</code>)</li>
<li>Recursive read locks (<code>RawRwLockRecursive</code>)</li>
<li>Upgradable read locks (<code>RawRwLockUpgrade</code>)</li>
</ul>
<p>The <code>Mutex</code> and <code>RwLock</code> wrappers will automatically expose this additional
functionality if the raw lock type implements these extension traits.</p>
<h1 id="cargo-features" class="section-header"><a href="#cargo-features">Cargo features</a></h1>
<p>This crate supports two cargo features:</p>
<ul>
<li><code>owning_ref</code>: Allows your lock types to be used with the <code>owning_ref</code> crate.</li>
<li><code>nightly</code>: Enables nightly-only features. At the moment the only such
feature is <code>const fn</code> constructors for lock types.</li>
</ul>
</div></details><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.GuardNoSend.html" title="lock_api::GuardNoSend struct">GuardNoSend</a></td><td class="docblock-short"><p>Marker type which indicates that the Guard type for a lock is not <code>Send</code>.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.GuardSend.html" title="lock_api::GuardSend struct">GuardSend</a></td><td class="docblock-short"><p>Marker type which indicates that the Guard type for a lock is <code>Send</code>.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.MappedMutexGuard.html" title="lock_api::MappedMutexGuard struct">MappedMutexGuard</a></td><td class="docblock-short"><p>An RAII mutex guard returned by <code>MutexGuard::map</code>, which can point to a
subfield of the protected data.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.MappedReentrantMutexGuard.html" title="lock_api::MappedReentrantMutexGuard struct">MappedReentrantMutexGuard</a></td><td class="docblock-short"><p>An RAII mutex guard returned by <code>ReentrantMutexGuard::map</code>, which can point to a
subfield of the protected data.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.MappedRwLockReadGuard.html" title="lock_api::MappedRwLockReadGuard struct">MappedRwLockReadGuard</a></td><td class="docblock-short"><p>An RAII read lock guard returned by <code>RwLockReadGuard::map</code>, which can point to a
subfield of the protected data.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.MappedRwLockWriteGuard.html" title="lock_api::MappedRwLockWriteGuard struct">MappedRwLockWriteGuard</a></td><td class="docblock-short"><p>An RAII write lock guard returned by <code>RwLockWriteGuard::map</code>, which can point to a
subfield of the protected data.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Mutex.html" title="lock_api::Mutex struct">Mutex</a></td><td class="docblock-short"><p>A mutual exclusion primitive useful for protecting shared data</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.MutexGuard.html" title="lock_api::MutexGuard struct">MutexGuard</a></td><td class="docblock-short"><p>An RAII implementation of a “scoped lock” of a mutex. When this structure is
dropped (falls out of scope), the lock will be unlocked.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.RawReentrantMutex.html" title="lock_api::RawReentrantMutex struct">RawReentrantMutex</a></td><td class="docblock-short"><p>A raw mutex type that wraps another raw mutex to provide reentrancy.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.ReentrantMutex.html" title="lock_api::ReentrantMutex struct">ReentrantMutex</a></td><td class="docblock-short"><p>A mutex which can be recursively locked by a single thread.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.ReentrantMutexGuard.html" title="lock_api::ReentrantMutexGuard struct">ReentrantMutexGuard</a></td><td class="docblock-short"><p>An RAII implementation of a “scoped lock” of a reentrant mutex. When this structure
is dropped (falls out of scope), the lock will be unlocked.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.RwLock.html" title="lock_api::RwLock struct">RwLock</a></td><td class="docblock-short"><p>A reader-writer lock</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.RwLockReadGuard.html" title="lock_api::RwLockReadGuard struct">RwLockReadGuard</a></td><td class="docblock-short"><p>RAII structure used to release the shared read access of a lock when
dropped.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.RwLockUpgradableReadGuard.html" title="lock_api::RwLockUpgradableReadGuard struct">RwLockUpgradableReadGuard</a></td><td class="docblock-short"><p>RAII structure used to release the upgradable read access of a lock when
dropped.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.RwLockWriteGuard.html" title="lock_api::RwLockWriteGuard struct">RwLockWriteGuard</a></td><td class="docblock-short"><p>RAII structure used to release the exclusive write access of a lock when
dropped.</p>
</td></tr></table><h2 id="traits" class="section-header"><a href="#traits">Traits</a></h2>
<table><tr class="module-item"><td><a class="trait" href="trait.GetThreadId.html" title="lock_api::GetThreadId trait">GetThreadId</a></td><td class="docblock-short"><p>Helper trait which returns a non-zero thread ID.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.RawMutex.html" title="lock_api::RawMutex trait">RawMutex</a></td><td class="docblock-short"><p>Basic operations for a mutex.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.RawMutexFair.html" title="lock_api::RawMutexFair trait">RawMutexFair</a></td><td class="docblock-short"><p>Additional methods for mutexes which support fair unlocking.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.RawMutexTimed.html" title="lock_api::RawMutexTimed trait">RawMutexTimed</a></td><td class="docblock-short"><p>Additional methods for mutexes which support locking with timeouts.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.RawRwLock.html" title="lock_api::RawRwLock trait">RawRwLock</a></td><td class="docblock-short"><p>Basic operations for a reader-writer lock.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.RawRwLockDowngrade.html" title="lock_api::RawRwLockDowngrade trait">RawRwLockDowngrade</a></td><td class="docblock-short"><p>Additional methods for RwLocks which support atomically downgrading an
exclusive lock to a shared lock.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.RawRwLockFair.html" title="lock_api::RawRwLockFair trait">RawRwLockFair</a></td><td class="docblock-short"><p>Additional methods for RwLocks which support fair unlocking.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.RawRwLockRecursive.html" title="lock_api::RawRwLockRecursive trait">RawRwLockRecursive</a></td><td class="docblock-short"><p>Additional methods for RwLocks which support recursive read locks.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.RawRwLockRecursiveTimed.html" title="lock_api::RawRwLockRecursiveTimed trait">RawRwLockRecursiveTimed</a></td><td class="docblock-short"><p>Additional methods for RwLocks which support recursive read locks and timeouts.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.RawRwLockTimed.html" title="lock_api::RawRwLockTimed trait">RawRwLockTimed</a></td><td class="docblock-short"><p>Additional methods for RwLocks which support locking with timeouts.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.RawRwLockUpgrade.html" title="lock_api::RawRwLockUpgrade trait">RawRwLockUpgrade</a></td><td class="docblock-short"><p>Additional methods for RwLocks which support atomically upgrading a shared
lock to an exclusive lock.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.RawRwLockUpgradeDowngrade.html" title="lock_api::RawRwLockUpgradeDowngrade trait">RawRwLockUpgradeDowngrade</a></td><td class="docblock-short"><p>Additional methods for RwLocks which support upgradable locks and lock
downgrading.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.RawRwLockUpgradeFair.html" title="lock_api::RawRwLockUpgradeFair trait">RawRwLockUpgradeFair</a></td><td class="docblock-short"><p>Additional methods for RwLocks which support upgradable locks and fair
unlocking.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.RawRwLockUpgradeTimed.html" title="lock_api::RawRwLockUpgradeTimed trait">RawRwLockUpgradeTimed</a></td><td class="docblock-short"><p>Additional methods for RwLocks which support upgradable locks and locking
with timeouts.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,13 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Marker type which indicates that the Guard type for a lock is not `Send`."><meta name="keywords" content="rust, rustlang, rust-lang, GuardNoSend"><title>GuardNoSend in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Struct GuardNoSend</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Sync">Sync</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Send">!Send</a><a href="#impl-Unpin">Unpin</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="GuardNoSend" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">lock_api</a>::<wbr><a class="struct" href="#">GuardNoSend</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/lib.rs.html#100" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust struct">pub struct GuardNoSend(_);</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Marker type which indicates that the Guard type for a lock is not <code>Send</code>.</p>
</div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><div id="impl-Sync" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.GuardNoSend.html" title="struct lock_api::GuardNoSend">GuardNoSend</a></h3><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../src/lock_api/lib.rs.html#102" title="goto source code">[src]</a></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-Send" class="impl has-srclink"><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.GuardNoSend.html" title="struct lock_api::GuardNoSend">GuardNoSend</a></h3><a href="#impl-Send" class="anchor"></a></div><div id="impl-Unpin" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.GuardNoSend.html" title="struct lock_api::GuardNoSend">GuardNoSend</a></h3><a href="#impl-Unpin" class="anchor"></a></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Any" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#131-135" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4><a href="#method.type_id" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#132" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.borrow" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4><a href="#method.borrow_mut" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#217" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#544-548" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</h4><a href="#method.from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#545" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#533-540" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</h4><a href="#method.into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#537" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#581-590" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4><a href="#associatedtype.Error" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#587" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#567-576" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4><a href="#associatedtype.Error-1" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#573" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Marker type which indicates that the Guard type for a lock is `Send`."><meta name="keywords" content="rust, rustlang, rust-lang, GuardSend"><title>GuardSend in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Struct GuardSend</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="GuardSend" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">lock_api</a>::<wbr><a class="struct" href="#">GuardSend</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/lib.rs.html#97" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust struct">pub struct GuardSend(_);</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Marker type which indicates that the Guard type for a lock is <code>Send</code>.</p>
</div></details><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-Send" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.GuardSend.html" title="struct lock_api::GuardSend">GuardSend</a></h3><a href="#impl-Send" class="anchor"></a></div><div id="impl-Sync" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.GuardSend.html" title="struct lock_api::GuardSend">GuardSend</a></h3><a href="#impl-Sync" class="anchor"></a></div><div id="impl-Unpin" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.GuardSend.html" title="struct lock_api::GuardSend">GuardSend</a></h3><a href="#impl-Unpin" class="anchor"></a></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Any" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#131-135" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4><a href="#method.type_id" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#132" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.borrow" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4><a href="#method.borrow_mut" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#217" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#544-548" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</h4><a href="#method.from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#545" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#533-540" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</h4><a href="#method.into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#537" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#581-590" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4><a href="#associatedtype.Error" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#587" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#567-576" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4><a href="#associatedtype.Error-1" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#573" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,47 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="An RAII mutex guard returned by `MutexGuard::map`, which can point to a subfield of the protected data."><meta name="keywords" content="rust, rustlang, rust-lang, MappedMutexGuard"><title>MappedMutexGuard in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Struct MappedMutexGuard</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.map">map</a><a href="#method.try_map">try_map</a><a href="#method.unlock_fair">unlock_fair</a></div><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-DerefMut">DerefMut</a><a href="#impl-Display">Display</a><a href="#impl-Drop">Drop</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Unpin">Unpin</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="MappedMutexGuard" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">lock_api</a>::<wbr><a class="struct" href="#">MappedMutexGuard</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/mutex.rs.html#594-598" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust struct"><div class="code-attribute">#[must_use = "if unused the Mutex will immediately unlock"]</div>pub struct MappedMutexGuard&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; { /* fields omitted */ }</pre></div><details class="rustdoc-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 doesnt 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="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#609-659" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.map" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.map" class="fnname">map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(s: Self, f: F) -&gt; <a class="struct" href="struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, U&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;mut T) -&gt; &amp;mut U,&nbsp;</span></h4><a href="#method.map" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#619-631" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Makes a new <code>MappedMutexGuard</code> for a component of the locked data.</p>
<p>This operation cannot fail as the <code>MappedMutexGuard</code> passed
in already locked the mutex.</p>
<p>This is an associated function that needs to be
used as <code>MappedMutexGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_map" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.try_map" class="fnname">try_map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;s: Self, <br>&nbsp;&nbsp;&nbsp;&nbsp;f: F<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, U&gt;, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;mut T) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;mut U&gt;,&nbsp;</span></h4><a href="#method.try_map" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#643-658" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to make a new <code>MappedMutexGuard</code> for a component of the
locked data. The original guard is returned if the closure returns <code>None</code>.</p>
<p>This operation cannot fail as the <code>MappedMutexGuard</code> passed
in already locked the mutex.</p>
<p>This is an associated function that needs to be
used as <code>MappedMutexGuard::try_map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-1" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutexFair.html" title="trait lock_api::RawMutexFair">RawMutexFair</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-1" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#661-682" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.unlock_fair" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.unlock_fair" class="fnname">unlock_fair</a>(s: Self)</h4><a href="#method.unlock_fair" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#675-681" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Unlocks the mutex using a fair unlock protocol.</p>
<p>By default, mutexes are unfair and allow the current thread to re-lock
the mutex before another has the chance to acquire the lock, even if
that thread has been blocked on the mutex for a long time. This is the
default because it allows much higher throughput as it avoids forcing a
context switch on every mutex unlock. This can result in one thread
acquiring a mutex many more times than other threads.</p>
<p>However in some cases it can be beneficial to ensure fairness by forcing
the lock to pass on to a waiting thread if there is one. This is done by
using this method instead of dropping the <code>MutexGuard</code> normally.</p>
</div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Debug" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#709-713" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.54.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4><a href="#method.fmt" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#710-712" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Deref" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-Deref" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#684-690" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Target" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html#associatedtype.Target" class="type">Target</a> = T</h4><a href="#associatedtype.Target" class="anchor"></a></div></summary><div class='docblock'><p>The resulting type after dereferencing.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.deref" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.deref" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#687-689" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Dereferences the value.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-DerefMut" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.DerefMut.html" title="trait core::ops::deref::DerefMut">DerefMut</a> for <a class="struct" href="struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-DerefMut" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#692-697" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.deref_mut" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.DerefMut.html#tymethod.deref_mut" class="fnname">deref_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4><a href="#method.deref_mut" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#694-696" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Mutably dereferences the value.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Display" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-Display" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#715-721" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt-1" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Display.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.54.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4><a href="#method.fmt-1" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#718-720" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Drop" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-Drop" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#699-707" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.drop" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/ops/drop/trait.Drop.html#tymethod.drop" class="fnname">drop</a>(&amp;mut self)</h4><a href="#method.drop" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#701-706" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/1.54.0/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
</div></details></div></details><div id="impl-Send" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R::<a class="type" href="trait.RawMutex.html#associatedtype.GuardMarker" title="type lock_api::RawMutex::GuardMarker">GuardMarker</a>: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,&nbsp;</span></h3><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#604-607" title="goto source code">[src]</a></div><div id="impl-Sync" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#600-603" title="goto source code">[src]</a></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-Unpin" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.MappedMutexGuard.html" title="struct lock_api::MappedMutexGuard">MappedMutexGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-Unpin" class="anchor"></a></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Any" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#131-135" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4><a href="#method.type_id" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#132" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.borrow" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4><a href="#method.borrow_mut" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#217" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#544-548" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</h4><a href="#method.from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#545" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#533-540" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</h4><a href="#method.into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#537" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#581-590" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4><a href="#associatedtype.Error" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#587" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#567-576" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4><a href="#associatedtype.Error-1" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#573" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,46 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="An RAII mutex guard returned by `ReentrantMutexGuard::map`, which can point to a subfield of the protected data."><meta name="keywords" content="rust, rustlang, rust-lang, MappedReentrantMutexGuard"><title>MappedReentrantMutexGuard in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Struct MappedReentrantMutexGuard</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.map">map</a><a href="#method.try_map">try_map</a><a href="#method.unlock_fair">unlock_fair</a></div><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-Display">Display</a><a href="#impl-Drop">Drop</a><a href="#impl-Sync">Sync</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Send">!Send</a><a href="#impl-Unpin">Unpin</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="MappedReentrantMutexGuard" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">lock_api</a>::<wbr><a class="struct" href="#">MappedReentrantMutexGuard</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/remutex.rs.html#717-721" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust struct"><div class="code-attribute">#[must_use = "if unused the ReentrantMutex will immediately unlock"]</div>pub struct MappedReentrantMutexGuard&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; { /* fields omitted */ }</pre></div><details class="rustdoc-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 doesnt 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="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</h3><a href="#impl" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#728-783" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.map" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.map" class="fnname">map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;s: Self, <br>&nbsp;&nbsp;&nbsp;&nbsp;f: F<br>) -&gt; <a class="struct" href="struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, U&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;T) -&gt; &amp;U,&nbsp;</span></h4><a href="#method.map" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#740-752" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Makes a new <code>MappedReentrantMutexGuard</code> for a component of the locked data.</p>
<p>This operation cannot fail as the <code>MappedReentrantMutexGuard</code> passed
in already locked the mutex.</p>
<p>This is an associated function that needs to be
used as <code>MappedReentrantMutexGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_map" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.try_map" class="fnname">try_map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;s: Self, <br>&nbsp;&nbsp;&nbsp;&nbsp;f: F<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, U&gt;, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;T) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;U&gt;,&nbsp;</span></h4><a href="#method.try_map" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#764-782" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to make a new <code>MappedReentrantMutexGuard</code> for a component of the
locked data. The original guard is return if the closure returns <code>None</code>.</p>
<p>This operation cannot fail as the <code>MappedReentrantMutexGuard</code> passed
in already locked the mutex.</p>
<p>This is an associated function that needs to be
used as <code>MappedReentrantMutexGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-1" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutexFair.html" title="trait lock_api::RawMutexFair">RawMutexFair</a> + 'a, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</h3><a href="#impl-1" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#785-808" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.unlock_fair" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.unlock_fair" class="fnname">unlock_fair</a>(s: Self)</h4><a href="#method.unlock_fair" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#801-807" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Unlocks the mutex using a fair unlock protocol.</p>
<p>By default, mutexes are unfair and allow the current thread to re-lock
the mutex before another has the chance to acquire the lock, even if
that thread has been blocked on the mutex for a long time. This is the
default because it allows much higher throughput as it avoids forcing a
context switch on every mutex unlock. This can result in one thread
acquiring a mutex many more times than other threads.</p>
<p>However in some cases it can be beneficial to ensure fairness by forcing
the lock to pass on to a waiting thread if there is one. This is done by
using this method instead of dropping the <code>ReentrantMutexGuard</code> normally.</p>
</div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Debug" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</h3><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#832-838" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.54.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4><a href="#method.fmt" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#835-837" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Deref" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</h3><a href="#impl-Deref" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#810-818" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Target" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html#associatedtype.Target" class="type">Target</a> = T</h4><a href="#associatedtype.Target" class="anchor"></a></div></summary><div class='docblock'><p>The resulting type after dereferencing.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.deref" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.deref" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#815-817" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Dereferences the value.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Display" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</h3><a href="#impl-Display" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#840-846" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt-1" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Display.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.54.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4><a href="#method.fmt-1" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#843-845" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Drop" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</h3><a href="#impl-Drop" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#820-830" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.drop" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/ops/drop/trait.Drop.html#tymethod.drop" class="fnname">drop</a>(&amp;mut self)</h4><a href="#method.drop" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#824-829" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/1.54.0/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
</div></details></div></details><div id="impl-Sync" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</h3><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#723-726" title="goto source code">[src]</a></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-Send" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R, G, T&gt; !<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</h3><a href="#impl-Send" class="anchor"></a></div><div id="impl-Unpin" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R, G, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</h3><a href="#impl-Unpin" class="anchor"></a></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Any" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#131-135" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4><a href="#method.type_id" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#132" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.borrow" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4><a href="#method.borrow_mut" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#217" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#544-548" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</h4><a href="#method.from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#545" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#533-540" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</h4><a href="#method.into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#537" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#581-590" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4><a href="#associatedtype.Error" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#587" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#567-576" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4><a href="#associatedtype.Error-1" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#573" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,46 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="An RAII read lock guard returned by `RwLockReadGuard::map`, which can point to a subfield of the protected data."><meta name="keywords" content="rust, rustlang, rust-lang, MappedRwLockReadGuard"><title>MappedRwLockReadGuard in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Struct MappedRwLockReadGuard</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.map">map</a><a href="#method.try_map">try_map</a><a href="#method.unlock_fair">unlock_fair</a></div><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-Display">Display</a><a href="#impl-Drop">Drop</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Unpin">Unpin</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="MappedRwLockReadGuard" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">lock_api</a>::<wbr><a class="struct" href="#">MappedRwLockReadGuard</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#1506-1510" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust struct"><div class="code-attribute">#[must_use = "if unused the RwLock will immediately unlock"]</div>pub struct MappedRwLockReadGuard&lt;'a, R:&nbsp;<a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; { /* fields omitted */ }</pre></div><details class="rustdoc-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 doesnt 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="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1518-1568" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.map" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.map" class="fnname">map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(s: Self, f: F) -&gt; <a class="struct" href="struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, U&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;T) -&gt; &amp;U,&nbsp;</span></h4><a href="#method.map" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1528-1540" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Make a new <code>MappedRwLockReadGuard</code> for a component of the locked data.</p>
<p>This operation cannot fail as the <code>MappedRwLockReadGuard</code> passed
in already locked the data.</p>
<p>This is an associated function that needs to be
used as <code>MappedRwLockReadGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_map" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.try_map" class="fnname">try_map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;s: Self, <br>&nbsp;&nbsp;&nbsp;&nbsp;f: F<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, U&gt;, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;T) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;U&gt;,&nbsp;</span></h4><a href="#method.try_map" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1552-1567" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to make a new <code>MappedRwLockReadGuard</code> for a component of the
locked data. The original guard is return if the closure returns <code>None</code>.</p>
<p>This operation cannot fail as the <code>MappedRwLockReadGuard</code> passed
in already locked the data.</p>
<p>This is an associated function that needs to be
used as <code>MappedRwLockReadGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-1" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawRwLockFair.html" title="trait lock_api::RawRwLockFair">RawRwLockFair</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-1" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1570-1591" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.unlock_fair" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.unlock_fair" class="fnname">unlock_fair</a>(s: Self)</h4><a href="#method.unlock_fair" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1584-1590" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Unlocks the <code>RwLock</code> using a fair unlock protocol.</p>
<p>By default, <code>RwLock</code> is unfair and allow the current thread to re-lock
the <code>RwLock</code> before another has the chance to acquire the lock, even if
that thread has been blocked on the <code>RwLock</code> for a long time. This is
the default because it allows much higher throughput as it avoids
forcing a context switch on every <code>RwLock</code> unlock. This can result in one
thread acquiring a <code>RwLock</code> many more times than other threads.</p>
<p>However in some cases it can be beneficial to ensure fairness by forcing
the lock to pass on to a waiting thread if there is one. This is done by
using this method instead of dropping the <code>MappedRwLockReadGuard</code> normally.</p>
</div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Debug" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1611-1617" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.54.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4><a href="#method.fmt" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1614-1616" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Deref" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-Deref" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1593-1599" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Target" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html#associatedtype.Target" class="type">Target</a> = T</h4><a href="#associatedtype.Target" class="anchor"></a></div></summary><div class='docblock'><p>The resulting type after dereferencing.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.deref" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.deref" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1596-1598" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Dereferences the value.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Display" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-Display" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1619-1625" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt-1" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Display.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.54.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4><a href="#method.fmt-1" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1622-1624" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Drop" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-Drop" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1601-1609" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.drop" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/ops/drop/trait.Drop.html#tymethod.drop" class="fnname">drop</a>(&amp;mut self)</h4><a href="#method.drop" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1603-1608" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/1.54.0/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
</div></details></div></details><div id="impl-Send" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R::<a class="type" href="trait.RawRwLock.html#associatedtype.GuardMarker" title="type lock_api::RawRwLock::GuardMarker">GuardMarker</a>: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,&nbsp;</span></h3><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1513-1516" title="goto source code">[src]</a></div><div id="impl-Sync" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1512" title="goto source code">[src]</a></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-Unpin" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.MappedRwLockReadGuard.html" title="struct lock_api::MappedRwLockReadGuard">MappedRwLockReadGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-Unpin" class="anchor"></a></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Any" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#131-135" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4><a href="#method.type_id" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#132" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.borrow" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4><a href="#method.borrow_mut" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#217" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#544-548" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</h4><a href="#method.from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#545" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#533-540" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</h4><a href="#method.into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#537" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#581-590" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4><a href="#associatedtype.Error" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#587" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#567-576" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4><a href="#associatedtype.Error-1" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#573" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,47 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="An RAII write lock guard returned by `RwLockWriteGuard::map`, which can point to a subfield of the protected data."><meta name="keywords" content="rust, rustlang, rust-lang, MappedRwLockWriteGuard"><title>MappedRwLockWriteGuard in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Struct MappedRwLockWriteGuard</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.map">map</a><a href="#method.try_map">try_map</a><a href="#method.unlock_fair">unlock_fair</a></div><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-DerefMut">DerefMut</a><a href="#impl-Display">Display</a><a href="#impl-Drop">Drop</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Unpin">Unpin</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="MappedRwLockWriteGuard" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">lock_api</a>::<wbr><a class="struct" href="#">MappedRwLockWriteGuard</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#1641-1645" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust struct"><div class="code-attribute">#[must_use = "if unused the RwLock will immediately unlock"]</div>pub struct MappedRwLockWriteGuard&lt;'a, R:&nbsp;<a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; { /* fields omitted */ }</pre></div><details class="rustdoc-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 doesnt 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="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1656-1706" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.map" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.map" class="fnname">map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(s: Self, f: F) -&gt; <a class="struct" href="struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, U&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;mut T) -&gt; &amp;mut U,&nbsp;</span></h4><a href="#method.map" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1666-1678" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Make a new <code>MappedRwLockWriteGuard</code> for a component of the locked data.</p>
<p>This operation cannot fail as the <code>MappedRwLockWriteGuard</code> passed
in already locked the data.</p>
<p>This is an associated function that needs to be
used as <code>MappedRwLockWriteGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_map" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.try_map" class="fnname">try_map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;s: Self, <br>&nbsp;&nbsp;&nbsp;&nbsp;f: F<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, U&gt;, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;mut T) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;mut U&gt;,&nbsp;</span></h4><a href="#method.try_map" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1690-1705" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to make a new <code>MappedRwLockWriteGuard</code> for a component of the
locked data. The original guard is return if the closure returns <code>None</code>.</p>
<p>This operation cannot fail as the <code>MappedRwLockWriteGuard</code> passed
in already locked the data.</p>
<p>This is an associated function that needs to be
used as <code>MappedRwLockWriteGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-1" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawRwLockFair.html" title="trait lock_api::RawRwLockFair">RawRwLockFair</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-1" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1708-1729" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.unlock_fair" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.unlock_fair" class="fnname">unlock_fair</a>(s: Self)</h4><a href="#method.unlock_fair" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1722-1728" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Unlocks the <code>RwLock</code> using a fair unlock protocol.</p>
<p>By default, <code>RwLock</code> is unfair and allow the current thread to re-lock
the <code>RwLock</code> before another has the chance to acquire the lock, even if
that thread has been blocked on the <code>RwLock</code> for a long time. This is
the default because it allows much higher throughput as it avoids
forcing a context switch on every <code>RwLock</code> unlock. This can result in one
thread acquiring a <code>RwLock</code> many more times than other threads.</p>
<p>However in some cases it can be beneficial to ensure fairness by forcing
the lock to pass on to a waiting thread if there is one. This is done by
using this method instead of dropping the <code>MappedRwLockWriteGuard</code> normally.</p>
</div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Debug" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1756-1762" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.54.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4><a href="#method.fmt" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1759-1761" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Deref" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-Deref" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1731-1737" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Target" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html#associatedtype.Target" class="type">Target</a> = T</h4><a href="#associatedtype.Target" class="anchor"></a></div></summary><div class='docblock'><p>The resulting type after dereferencing.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.deref" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.deref" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1734-1736" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Dereferences the value.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-DerefMut" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.DerefMut.html" title="trait core::ops::deref::DerefMut">DerefMut</a> for <a class="struct" href="struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-DerefMut" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1739-1744" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.deref_mut" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.DerefMut.html#tymethod.deref_mut" class="fnname">deref_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4><a href="#method.deref_mut" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1741-1743" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Mutably dereferences the value.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Display" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-Display" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1764-1770" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt-1" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Display.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.54.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4><a href="#method.fmt-1" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1767-1769" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Drop" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-Drop" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1746-1754" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.drop" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/ops/drop/trait.Drop.html#tymethod.drop" class="fnname">drop</a>(&amp;mut self)</h4><a href="#method.drop" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1748-1753" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/1.54.0/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
</div></details></div></details><div id="impl-Send" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R::<a class="type" href="trait.RawRwLock.html#associatedtype.GuardMarker" title="type lock_api::RawRwLock::GuardMarker">GuardMarker</a>: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,&nbsp;</span></h3><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1651-1654" title="goto source code">[src]</a></div><div id="impl-Sync" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../src/lock_api/rwlock.rs.html#1647-1650" title="goto source code">[src]</a></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-Unpin" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.MappedRwLockWriteGuard.html" title="struct lock_api::MappedRwLockWriteGuard">MappedRwLockWriteGuard</a>&lt;'a, R, T&gt;</h3><a href="#impl-Unpin" class="anchor"></a></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Any" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#131-135" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4><a href="#method.type_id" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#132" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.borrow" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4><a href="#method.borrow_mut" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#217" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#544-548" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</h4><a href="#method.from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#545" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#533-540" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</h4><a href="#method.into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#537" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#581-590" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4><a href="#associatedtype.Error" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#587" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#567-576" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4><a href="#associatedtype.Error-1" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#573" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,81 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A mutual exclusion primitive useful for protecting shared data"><meta name="keywords" content="rust, rustlang, rust-lang, Mutex"><title>Mutex in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Struct Mutex</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.const_new">const_new</a><a href="#method.data_ptr">data_ptr</a><a href="#method.force_unlock">force_unlock</a><a href="#method.force_unlock_fair">force_unlock_fair</a><a href="#method.get_mut">get_mut</a><a href="#method.into_inner">into_inner</a><a href="#method.is_locked">is_locked</a><a href="#method.lock">lock</a><a href="#method.new">new</a><a href="#method.raw">raw</a><a href="#method.try_lock">try_lock</a><a href="#method.try_lock_for">try_lock_for</a><a href="#method.try_lock_until">try_lock_until</a></div><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Unpin">Unpin</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3C!%3E">From&lt;!&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="Mutex" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">lock_api</a>::<wbr><a class="struct" href="#">Mutex</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/mutex.rs.html#135-138" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust struct">pub struct Mutex&lt;R, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; { /* fields omitted */ }</pre></div><details class="rustdoc-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 also be statically initialized or created via a <code>new</code>
constructor. Each mutex has a type parameter which represents the data that
it is protecting. The data can only be accessed through the RAII guards
returned from <code>lock</code> and <code>try_lock</code>, which guarantees that the data is only
ever accessed when the mutex is locked.</p>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T&gt; <a class="struct" href="struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</h3><a href="#impl" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#143-169" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.new" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.new" class="fnname">new</a>(val: T) -&gt; <a class="struct" href="struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</h4><a href="#method.new" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#157-162" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Creates a new mutex in an unlocked state ready for use.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into_inner" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.into_inner" class="fnname">into_inner</a>(self) -&gt; T</h4><a href="#method.into_inner" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#166-168" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Consumes this mutex, returning the underlying data.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-1" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R, T&gt; <a class="struct" href="struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</h3><a href="#impl-1" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#171-182" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.const_new" class="method has-srclink"><h4 class="code-header">pub const fn <a href="#method.const_new" class="fnname">const_new</a>(raw_mutex: R, val: T) -&gt; <a class="struct" href="struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</h4><a href="#method.const_new" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#176-181" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Creates a new mutex based on a pre-existing raw mutex.</p>
<p>This allows creating a mutex in a constant context on stable Rust.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-2" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="struct" href="struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</h3><a href="#impl-2" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#184-289" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.lock" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.lock" class="fnname">lock</a>(&amp;self) -&gt; <a class="struct" href="struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a>&lt;'_, R, T&gt;</h4><a href="#method.lock" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#206-210" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Acquires a mutex, blocking the current thread until it is able to do so.</p>
<p>This function will block the local thread until it is available to acquire
the mutex. Upon returning, the thread is the only thread with the mutex
held. An RAII guard is returned to allow scoped unlock of the lock. When
the guard goes out of scope, the mutex will be unlocked.</p>
<p>Attempts to lock a mutex in the thread which already holds the lock will
result in a deadlock.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_lock" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.try_lock" class="fnname">try_lock</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a>&lt;'_, R, T&gt;&gt;</h4><a href="#method.try_lock" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#220-227" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire this lock.</p>
<p>If the lock could not be acquired at this time, then <code>None</code> is returned.
Otherwise, an RAII guard is returned. The lock will be unlocked when the
guard is dropped.</p>
<p>This function does not block.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.get_mut" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.get_mut" class="fnname">get_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4><a href="#method.get_mut" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#234-236" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Returns a mutable reference to the underlying data.</p>
<p>Since this call borrows the <code>Mutex</code> mutably, no actual locking needs to
take place—the mutable borrow statically guarantees no locks exist.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.is_locked" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.is_locked" class="fnname">is_locked</a>(&amp;self) -&gt; bool</h4><a href="#method.is_locked" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#240-242" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Checks whether the mutex is currently locked.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.force_unlock" class="method has-srclink"><h4 class="code-header">pub unsafe fn <a href="#method.force_unlock" class="fnname">force_unlock</a>(&amp;self)</h4><a href="#method.force_unlock" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#256-258" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Forcibly unlocks the mutex.</p>
<p>This is useful when combined with <code>mem::forget</code> to hold a lock without
the need to maintain a <code>MutexGuard</code> object alive, for example when
dealing with FFI.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>This method must only be called if the current thread logically owns a
<code>MutexGuard</code> but that guard has be discarded using <code>mem::forget</code>.
Behavior is undefined if a mutex is unlocked when not locked.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.raw" class="method has-srclink"><h4 class="code-header">pub unsafe fn <a href="#method.raw" class="fnname">raw</a>(&amp;self) -&gt; &amp;R</h4><a href="#method.raw" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#270-272" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Returns the underlying raw mutex object.</p>
<p>Note that you will most likely need to import the <code>RawMutex</code> trait from
<code>lock_api</code> to be able to call functions on the raw mutex.</p>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method is unsafe because it allows unlocking a mutex while
still holding a reference to a <code>MutexGuard</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.data_ptr" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.data_ptr" class="fnname">data_ptr</a>(&amp;self) -&gt; *mut T</h4><a href="#method.data_ptr" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#286-288" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Returns a raw pointer to the underlying data.</p>
<p>This is useful when combined with <code>mem::forget</code> to hold a lock without
the need to maintain a <code>MutexGuard</code> object alive, for example when
dealing with FFI.</p>
<h1 id="safety-2" class="section-header"><a href="#safety-2">Safety</a></h1>
<p>You must ensure that there are no data races when dereferencing the
returned pointer, for example if the current thread logically owns
a <code>MutexGuard</code> but that guard has been discarded using <code>mem::forget</code>.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-3" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R:&nbsp;<a class="trait" href="trait.RawMutexFair.html" title="trait lock_api::RawMutexFair">RawMutexFair</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="struct" href="struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</h3><a href="#impl-3" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#291-307" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.force_unlock_fair" class="method has-srclink"><h4 class="code-header">pub unsafe fn <a href="#method.force_unlock_fair" class="fnname">force_unlock_fair</a>(&amp;self)</h4><a href="#method.force_unlock_fair" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#304-306" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Forcibly unlocks the mutex using a fair unlock procotol.</p>
<p>This is useful when combined with <code>mem::forget</code> to hold a lock without
the need to maintain a <code>MutexGuard</code> object alive, for example when
dealing with FFI.</p>
<h1 id="safety-3" class="section-header"><a href="#safety-3">Safety</a></h1>
<p>This method must only be called if the current thread logically owns a
<code>MutexGuard</code> but that guard has be discarded using <code>mem::forget</code>.
Behavior is undefined if a mutex is unlocked when not locked.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-4" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R:&nbsp;<a class="trait" href="trait.RawMutexTimed.html" title="trait lock_api::RawMutexTimed">RawMutexTimed</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="struct" href="struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</h3><a href="#impl-4" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#309-339" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_lock_for" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.try_lock_for" class="fnname">try_lock_for</a>(&amp;self, timeout: R::<a class="type" href="trait.RawMutexTimed.html#associatedtype.Duration" title="type lock_api::RawMutexTimed::Duration">Duration</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a>&lt;'_, R, T&gt;&gt;</h4><a href="#method.try_lock_for" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#316-323" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire this lock until a timeout is reached.</p>
<p>If the lock could not be acquired before the timeout expired, then
<code>None</code> is returned. Otherwise, an RAII guard is returned. The lock will
be unlocked when the guard is dropped.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_lock_until" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.try_lock_until" class="fnname">try_lock_until</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;timeout: R::<a class="type" href="trait.RawMutexTimed.html#associatedtype.Instant" title="type lock_api::RawMutexTimed::Instant">Instant</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.MutexGuard.html" title="struct lock_api::MutexGuard">MutexGuard</a>&lt;'_, R, T&gt;&gt;</h4><a href="#method.try_lock_until" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#331-338" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire this lock until a timeout is reached.</p>
<p>If the lock could not be acquired before the timeout expired, then
<code>None</code> is returned. Otherwise, an RAII guard is returned. The lock will
be unlocked when the guard is dropped.</p>
</div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Debug" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</h3><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#355-373" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.54.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4><a href="#method.fmt" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#356-372" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Default" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/default/trait.Default.html" title="trait core::default::Default">Default</a>&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</h3><a href="#impl-Default" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#341-346" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.default" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/default/trait.Default.html#tymethod.default" class="fnname">default</a>() -&gt; <a class="struct" href="struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</h4><a href="#method.default" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#343-345" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Returns the “default value” for a type. <a href="https://doc.rust-lang.org/1.54.0/core/default/trait.Default.html#tymethod.default">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for <a class="struct" href="struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</h3><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#348-353" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; <a class="struct" href="struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</h4><a href="#method.from" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#350-352" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><div id="impl-Send" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</h3><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#140" title="goto source code">[src]</a></div><div id="impl-Sync" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt;</h3><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../src/lock_api/mutex.rs.html#141" title="goto source code">[src]</a></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-Unpin" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Mutex.html" title="struct lock_api::Mutex">Mutex</a>&lt;R, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></h3><a href="#impl-Unpin" class="anchor"></a></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Any" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#131-135" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4><a href="#method.type_id" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#132" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.borrow" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4><a href="#method.borrow_mut" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#217" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-From%3C!%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;!&gt; for T</h3><a href="#impl-From%3C!%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#559-563" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from-1" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: !) -&gt; T</h4><a href="#method.from-1" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#560" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-From%3CT%3E-1" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3><a href="#impl-From%3CT%3E-1" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#544-548" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from-2" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</h4><a href="#method.from-2" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#545" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#533-540" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</h4><a href="#method.into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#537" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#581-590" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4><a href="#associatedtype.Error" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#587" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#567-576" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4><a href="#associatedtype.Error-1" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#573" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,41 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A raw mutex type that wraps another raw mutex to provide reentrancy."><meta name="keywords" content="rust, rustlang, rust-lang, RawReentrantMutex"><title>RawReentrantMutex in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Struct RawReentrantMutex</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.bump">bump</a><a href="#method.is_locked">is_locked</a><a href="#method.is_owned_by_current_thread">is_owned_by_current_thread</a><a href="#method.lock">lock</a><a href="#method.try_lock">try_lock</a><a href="#method.try_lock_for">try_lock_for</a><a href="#method.try_lock_until">try_lock_until</a><a href="#method.unlock">unlock</a><a href="#method.unlock_fair">unlock_fair</a></div><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Unpin">Unpin</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="RawReentrantMutex" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">lock_api</a>::<wbr><a class="struct" href="#">RawReentrantMutex</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/remutex.rs.html#60-65" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust struct">pub struct RawReentrantMutex&lt;R, G&gt; { /* fields omitted */ }</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A raw mutex type that wraps another raw mutex to provide reentrancy.</p>
<p>Although this has the same methods as the <a href="trait.RawMutex.html"><code>RawMutex</code></a> trait, it does
not implement it, and should not be used in the same way, since this
mutex can successfully acquire a lock multiple times in the same thread.
Only use this when you know you want a raw mutex that can be locked
reentrantly; you probably want <a href="struct.ReentrantMutex.html"><code>ReentrantMutex</code></a> instead.</p>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a>&gt; <a class="struct" href="struct.RawReentrantMutex.html" title="struct lock_api::RawReentrantMutex">RawReentrantMutex</a>&lt;R, G&gt;</h3><a href="#impl" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#70-145" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedconstant.INIT" class="associatedconstant has-srclink"><h4 class="code-header">pub const <a href="#associatedconstant.INIT" class="constant"><b>INIT</b></a>: Self</h4><a href="#associatedconstant.INIT" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#73-78" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Initial value for an unlocked mutex.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.lock" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.lock" class="fnname">lock</a>(&amp;self)</h4><a href="#method.lock" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#103-108" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Acquires this mutex, blocking if its held by another thread.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_lock" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.try_lock" class="fnname">try_lock</a>(&amp;self) -&gt; bool</h4><a href="#method.try_lock" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#113-115" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire this mutex without blocking. Returns <code>true</code>
if the lock was successfully acquired and <code>false</code> otherwise.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.unlock" class="method has-srclink"><h4 class="code-header">pub unsafe fn <a href="#method.unlock" class="fnname">unlock</a>(&amp;self)</h4><a href="#method.unlock" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#124-131" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Unlocks this mutex. The inner mutex may not be unlocked if
this mutex was acquired previously in the current thread.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>This method may only be called if the mutex is held by the current thread.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.is_locked" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.is_locked" class="fnname">is_locked</a>(&amp;self) -&gt; bool</h4><a href="#method.is_locked" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#135-137" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Checks whether the mutex is currently locked.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.is_owned_by_current_thread" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.is_owned_by_current_thread" class="fnname">is_owned_by_current_thread</a>(&amp;self) -&gt; bool</h4><a href="#method.is_owned_by_current_thread" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#141-144" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Checks whether the mutex is currently held by the current thread.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-1" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R:&nbsp;<a class="trait" href="trait.RawMutexFair.html" title="trait lock_api::RawMutexFair">RawMutexFair</a>, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a>&gt; <a class="struct" href="struct.RawReentrantMutex.html" title="struct lock_api::RawReentrantMutex">RawReentrantMutex</a>&lt;R, G&gt;</h3><a href="#impl-1" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#147-183" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.unlock_fair" class="method has-srclink"><h4 class="code-header">pub unsafe fn <a href="#method.unlock_fair" class="fnname">unlock_fair</a>(&amp;self)</h4><a href="#method.unlock_fair" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#156-163" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Unlocks this mutex using a fair unlock protocol. The inner mutex
may not be unlocked if this mutex was acquired previously in the
current thread.</p>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method may only be called if the mutex is held by the current thread.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.bump" class="method has-srclink"><h4 class="code-header">pub unsafe fn <a href="#method.bump" class="fnname">bump</a>(&amp;self)</h4><a href="#method.bump" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#175-182" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Temporarily yields the mutex to a waiting thread if there is one.</p>
<p>This method is functionally equivalent to calling <code>unlock_fair</code> followed
by <code>lock</code>, however it can be much more efficient in the case where there
are no waiting threads.</p>
<h1 id="safety-2" class="section-header"><a href="#safety-2">Safety</a></h1>
<p>This method may only be called if the mutex is held by the current thread.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-2" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R:&nbsp;<a class="trait" href="trait.RawMutexTimed.html" title="trait lock_api::RawMutexTimed">RawMutexTimed</a>, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a>&gt; <a class="struct" href="struct.RawReentrantMutex.html" title="struct lock_api::RawReentrantMutex">RawReentrantMutex</a>&lt;R, G&gt;</h3><a href="#impl-2" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#185-197" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_lock_until" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.try_lock_until" class="fnname">try_lock_until</a>(&amp;self, timeout: R::<a class="type" href="trait.RawMutexTimed.html#associatedtype.Instant" title="type lock_api::RawMutexTimed::Instant">Instant</a>) -&gt; bool</h4><a href="#method.try_lock_until" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#188-190" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire this lock until a timeout is reached.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_lock_for" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.try_lock_for" class="fnname">try_lock_for</a>(&amp;self, timeout: R::<a class="type" href="trait.RawMutexTimed.html#associatedtype.Duration" title="type lock_api::RawMutexTimed::Duration">Duration</a>) -&gt; bool</h4><a href="#method.try_lock_for" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#194-196" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire this lock until a timeout is reached.</p>
</div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><div id="impl-Send" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.RawReentrantMutex.html" title="struct lock_api::RawReentrantMutex">RawReentrantMutex</a>&lt;R, G&gt;</h3><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#67" title="goto source code">[src]</a></div><div id="impl-Sync" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.RawReentrantMutex.html" title="struct lock_api::RawReentrantMutex">RawReentrantMutex</a>&lt;R, G&gt;</h3><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#68" title="goto source code">[src]</a></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-Unpin" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R, G&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.RawReentrantMutex.html" title="struct lock_api::RawReentrantMutex">RawReentrantMutex</a>&lt;R, G&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;G: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></h3><a href="#impl-Unpin" class="anchor"></a></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Any" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#131-135" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4><a href="#method.type_id" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#132" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.borrow" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4><a href="#method.borrow_mut" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#217" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#544-548" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</h4><a href="#method.from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#545" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#533-540" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</h4><a href="#method.into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#537" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#581-590" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4><a href="#associatedtype.Error" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#587" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#567-576" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4><a href="#associatedtype.Error-1" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#573" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,56 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="An RAII implementation of a “scoped lock” of a reentrant mutex. When this structure is dropped (falls out of scope), the lock will be unlocked."><meta name="keywords" content="rust, rustlang, rust-lang, ReentrantMutexGuard"><title>ReentrantMutexGuard in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Struct ReentrantMutexGuard</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.bump">bump</a><a href="#method.map">map</a><a href="#method.remutex">remutex</a><a href="#method.try_map">try_map</a><a href="#method.unlock_fair">unlock_fair</a><a href="#method.unlocked">unlocked</a><a href="#method.unlocked_fair">unlocked_fair</a></div><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-Display">Display</a><a href="#impl-Drop">Drop</a><a href="#impl-Sync">Sync</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Send">!Send</a><a href="#impl-Unpin">Unpin</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="ReentrantMutexGuard" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">lock_api</a>::<wbr><a class="struct" href="#">ReentrantMutexGuard</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/remutex.rs.html#521-524" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust struct"><div class="code-attribute">#[must_use = "if unused the ReentrantMutex will immediately unlock"]</div>pub struct ReentrantMutexGuard&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a>, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a>, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; { /* fields omitted */ }</pre></div><details class="rustdoc-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="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</h3><a href="#impl" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#531-606" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.remutex" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.remutex" class="fnname">remutex</a>(s: &amp;Self) -&gt; &amp;'a <a class="struct" href="struct.ReentrantMutex.html" title="struct lock_api::ReentrantMutex">ReentrantMutex</a>&lt;R, G, T&gt;</h4><a href="#method.remutex" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#533-535" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Returns a reference to the original <code>ReentrantMutex</code> object.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.map" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.map" class="fnname">map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;s: Self, <br>&nbsp;&nbsp;&nbsp;&nbsp;f: F<br>) -&gt; <a class="struct" href="struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, U&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;T) -&gt; &amp;U,&nbsp;</span></h4><a href="#method.map" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#546-558" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Makes a new <code>MappedReentrantMutexGuard</code> for a component of the locked data.</p>
<p>This operation cannot fail as the <code>ReentrantMutexGuard</code> passed
in already locked the mutex.</p>
<p>This is an associated function that needs to be
used as <code>ReentrantMutexGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_map" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.try_map" class="fnname">try_map</a>&lt;U:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, F&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;s: Self, <br>&nbsp;&nbsp;&nbsp;&nbsp;f: F<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="struct.MappedReentrantMutexGuard.html" title="struct lock_api::MappedReentrantMutexGuard">MappedReentrantMutexGuard</a>&lt;'a, R, G, U&gt;, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;mut T) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;mut U&gt;,&nbsp;</span></h4><a href="#method.try_map" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#570-588" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to make a new <code>MappedReentrantMutexGuard</code> for a component of the
locked data. The original guard is return if the closure returns <code>None</code>.</p>
<p>This operation cannot fail as the <code>ReentrantMutexGuard</code> passed
in already locked the mutex.</p>
<p>This is an associated function that needs to be
used as <code>ReentrantMutexGuard::map(...)</code>. A method would interfere with methods of
the same name on the contents of the locked data.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.unlocked" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.unlocked" class="fnname">unlocked</a>&lt;F, U&gt;(s: &amp;mut Self, f: F) -&gt; U <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -&gt; U,&nbsp;</span></h4><a href="#method.unlocked" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#595-605" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Temporarily unlocks the mutex to execute the given function.</p>
<p>This is safe because <code>&amp;mut</code> guarantees that there exist no other
references to the data protected by the mutex.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-1" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutexFair.html" title="trait lock_api::RawMutexFair">RawMutexFair</a> + 'a, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="struct" href="struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</h3><a href="#impl-1" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#608-663" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.unlock_fair" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.unlock_fair" class="fnname">unlock_fair</a>(s: Self)</h4><a href="#method.unlock_fair" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#624-630" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Unlocks the mutex using a fair unlock protocol.</p>
<p>By default, mutexes are unfair and allow the current thread to re-lock
the mutex before another has the chance to acquire the lock, even if
that thread has been blocked on the mutex for a long time. This is the
default because it allows much higher throughput as it avoids forcing a
context switch on every mutex unlock. This can result in one thread
acquiring a mutex many more times than other threads.</p>
<p>However in some cases it can be beneficial to ensure fairness by forcing
the lock to pass on to a waiting thread if there is one. This is done by
using this method instead of dropping the <code>ReentrantMutexGuard</code> normally.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.unlocked_fair" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.unlocked_fair" class="fnname">unlocked_fair</a>&lt;F, U&gt;(s: &amp;mut Self, f: F) -&gt; U <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -&gt; U,&nbsp;</span></h4><a href="#method.unlocked_fair" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#639-649" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Temporarily unlocks the mutex to execute the given function.</p>
<p>The mutex is unlocked a fair unlock protocol.</p>
<p>This is safe because <code>&amp;mut</code> guarantees that there exist no other
references to the data protected by the mutex.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.bump" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.bump" class="fnname">bump</a>(s: &amp;mut Self)</h4><a href="#method.bump" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#657-662" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Temporarily yields the mutex to a waiting thread if there is one.</p>
<p>This method is functionally equivalent to calling <code>unlock_fair</code> followed
by <code>lock</code>, however it can be much more efficient in the case where there
are no waiting threads.</p>
</div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Debug" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</h3><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#687-693" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.54.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4><a href="#method.fmt" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#690-692" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Deref" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</h3><a href="#impl-Deref" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#665-673" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Target" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html#associatedtype.Target" class="type">Target</a> = T</h4><a href="#associatedtype.Target" class="anchor"></a></div></summary><div class='docblock'><p>The resulting type after dereferencing.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.deref" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.deref" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#670-672" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Dereferences the value.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Display" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</h3><a href="#impl-Display" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#695-701" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt-1" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Display.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.54.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4><a href="#method.fmt-1" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#698-700" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Drop" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + 'a, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</h3><a href="#impl-Drop" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#675-685" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.drop" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/ops/drop/trait.Drop.html#tymethod.drop" class="fnname">drop</a>(&amp;mut self)</h4><a href="#method.drop" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#679-684" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/1.54.0/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
</div></details></div></details><div id="impl-Sync" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R:&nbsp;<a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a, G:&nbsp;<a class="trait" href="trait.GetThreadId.html" title="trait lock_api::GetThreadId">GetThreadId</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</h3><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../src/lock_api/remutex.rs.html#526-529" title="goto source code">[src]</a></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-Send" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R, G, T&gt; !<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</h3><a href="#impl-Send" class="anchor"></a></div><div id="impl-Unpin" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;'a, R, G, T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.ReentrantMutexGuard.html" title="struct lock_api::ReentrantMutexGuard">ReentrantMutexGuard</a>&lt;'a, R, G, T&gt;</h3><a href="#impl-Unpin" class="anchor"></a></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Any" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#131-135" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4><a href="#method.type_id" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#132" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.borrow" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4><a href="#method.borrow_mut" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#217" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#544-548" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</h4><a href="#method.from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#545" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#533-540" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</h4><a href="#method.into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#537" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#581-590" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4><a href="#associatedtype.Error" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#587" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#567-576" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4><a href="#associatedtype.Error-1" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#573" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

183
lock_api/struct.RwLock.html Normal file

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

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,17 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Helper trait which returns a non-zero thread ID."><meta name="keywords" content="rust, rustlang, rust-lang, GetThreadId"><title>GetThreadId in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait GetThreadId</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#associated-const">Associated Constants</a></h3><div class="sidebar-links"><a href="#associatedconstant.INIT">INIT</a></div><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.nonzero_thread_id">nonzero_thread_id</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="GetThreadId" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="#">GetThreadId</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/remutex.rs.html#38-48" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait">pub unsafe trait GetThreadId {
const <a href="#associatedconstant.INIT" class="constant"><b>INIT</b></a>: Self;
fn <a href="#tymethod.nonzero_thread_id" class="fnname">nonzero_thread_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/num/nonzero/struct.NonZeroUsize.html" title="struct core::num::nonzero::NonZeroUsize">NonZeroUsize</a>;
}</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Helper trait which returns a non-zero thread ID.</p>
<p>The simplest way to implement this trait is to return the address of a
thread-local variable.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>Implementations of this trait must ensure that no two active threads share
the same thread ID. However the ID of a thread that has exited can be
re-used since that thread is no longer active.</p>
</div></details><h2 id="associated-const" class="small-section-header">Associated Constants<a href="#associated-const" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedconstant.INIT" class="method has-srclink"><h4 class="code-header">const <a href="#associatedconstant.INIT" class="constant"><b>INIT</b></a>: Self</h4><a class="srclink" href="../src/lock_api/remutex.rs.html#43" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Initial value.</p>
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.nonzero_thread_id" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.nonzero_thread_id" class="fnname">nonzero_thread_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/num/nonzero/struct.NonZeroUsize.html" title="struct core::num::nonzero::NonZeroUsize">NonZeroUsize</a></h4><a class="srclink" href="../src/lock_api/remutex.rs.html#47" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Returns a non-zero thread ID which identifies the current thread of
execution.</p>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../implementors/lock_api/trait.GetThreadId.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,30 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Basic operations for a mutex."><meta name="keywords" content="rust, rustlang, rust-lang, RawMutex"><title>RawMutex in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait RawMutex</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><div class="sidebar-links"><a href="#associatedtype.GuardMarker">GuardMarker</a></div><h3 class="sidebar-title"><a href="#associated-const">Associated Constants</a></h3><div class="sidebar-links"><a href="#associatedconstant.INIT">INIT</a></div><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.lock">lock</a><a href="#tymethod.try_lock">try_lock</a><a href="#tymethod.unlock">unlock</a></div><h3 class="sidebar-title"><a href="#provided-methods">Provided Methods</a></h3><div class="sidebar-links"><a href="#method.is_locked">is_locked</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="RawMutex" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="#">RawMutex</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/mutex.rs.html#29-72" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait">pub unsafe trait RawMutex {
type <a href="#associatedtype.GuardMarker" class="type">GuardMarker</a>;
const <a href="#associatedconstant.INIT" class="constant"><b>INIT</b></a>: Self;
fn <a href="#tymethod.lock" class="fnname">lock</a>(&amp;self);
<div class="item-spacer"></div> fn <a href="#tymethod.try_lock" class="fnname">try_lock</a>(&amp;self) -&gt; bool;
<div class="item-spacer"></div> unsafe fn <a href="#tymethod.unlock" class="fnname">unlock</a>(&amp;self);
fn <a href="#method.is_locked" class="fnname">is_locked</a>(&amp;self) -&gt; bool { ... }
}</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Basic operations for a mutex.</p>
<p>Types implementing this trait can be used by <code>Mutex</code> to form a safe and
fully-functioning mutex type.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>Implementations of this trait must ensure that the mutex is actually
exclusive: a lock cant be acquired while the mutex is already locked.</p>
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.GuardMarker" class="method has-srclink"><h4 class="code-header">type <a href="#associatedtype.GuardMarker" class="type">GuardMarker</a></h4><a class="srclink" href="../src/lock_api/mutex.rs.html#38" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Marker type which determines whether a lock guard should be <code>Send</code>. Use
one of the <code>GuardSend</code> or <code>GuardNoSend</code> helper types here.</p>
</div></details></div><h2 id="associated-const" class="small-section-header">Associated Constants<a href="#associated-const" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedconstant.INIT" class="method has-srclink"><h4 class="code-header">const <a href="#associatedconstant.INIT" class="constant"><b>INIT</b></a>: Self</h4><a class="srclink" href="../src/lock_api/mutex.rs.html#34" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Initial value for an unlocked mutex.</p>
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.lock" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.lock" class="fnname">lock</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/mutex.rs.html#41" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Acquires this mutex, blocking the current thread until it is able to do so.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_lock" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.try_lock" class="fnname">try_lock</a>(&amp;self) -&gt; bool</h4><a class="srclink" href="../src/lock_api/mutex.rs.html#45" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire this mutex without blocking. Returns <code>true</code>
if the lock was successfully acquired and <code>false</code> otherwise.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.unlock" class="method has-srclink"><h4 class="code-header">unsafe fn <a href="#tymethod.unlock" class="fnname">unlock</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/mutex.rs.html#58" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Unlocks this mutex.</p>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method may only be called if the mutex is held in the current context, i.e. it must
be paired with a successful call to <a href="#tymethod.lock"><code>lock</code></a>, <a href="#tymethod.try_lock"><code>try_lock</code></a>, <a href="trait.RawMutexTimed.html#tymethod.try_lock_for"><code>try_lock_for</code></a> or <a href="trait.RawMutexTimed.html#tymethod.try_lock_until"><code>try_lock_until</code></a>.</p>
</div></details></div><h2 id="provided-methods" class="small-section-header">Provided methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="method.is_locked" class="method has-srclink"><h4 class="code-header">fn <a href="#method.is_locked" class="fnname">is_locked</a>(&amp;self) -&gt; bool</h4><a class="srclink" href="../src/lock_api/mutex.rs.html#62-71" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Checks whether the mutex is currently locked.</p>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../implementors/lock_api/trait.RawMutex.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,23 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Additional methods for mutexes which support fair unlocking."><meta name="keywords" content="rust, rustlang, rust-lang, RawMutexFair"><title>RawMutexFair in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait RawMutexFair</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.unlock_fair">unlock_fair</a></div><h3 class="sidebar-title"><a href="#provided-methods">Provided Methods</a></h3><div class="sidebar-links"><a href="#method.bump">bump</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="RawMutexFair" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="#">RawMutexFair</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/mutex.rs.html#80-107" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait">pub unsafe trait RawMutexFair: <a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> {
unsafe fn <a href="#tymethod.unlock_fair" class="fnname">unlock_fair</a>(&amp;self);
unsafe fn <a href="#method.bump" class="fnname">bump</a>(&amp;self) { ... }
}</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Additional methods for mutexes which support fair unlocking.</p>
<p>Fair unlocking means that a lock is handed directly over to the next waiting
thread if there is one, without giving other threads the opportunity to
“steal” the lock in the meantime. This is typically slower than unfair
unlocking, but may be necessary in certain circumstances.</p>
</div></details><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.unlock_fair" class="method has-srclink"><h4 class="code-header">unsafe fn <a href="#tymethod.unlock_fair" class="fnname">unlock_fair</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/mutex.rs.html#89" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Unlocks this mutex using a fair unlock protocol.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>This method may only be called if the mutex is held in the current context, see
the documentation of <a href="trait.RawMutex.html#tymethod.unlock"><code>unlock</code></a>.</p>
</div></details></div><h2 id="provided-methods" class="small-section-header">Provided methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="method.bump" class="method has-srclink"><h4 class="code-header">unsafe fn <a href="#method.bump" class="fnname">bump</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/mutex.rs.html#103-106" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Temporarily yields the mutex to a waiting thread if there is one.</p>
<p>This method is functionally equivalent to calling <code>unlock_fair</code> followed
by <code>lock</code>, however it can be much more efficient in the case where there
are no waiting threads.</p>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method may only be called if the mutex is held in the current context, see
the documentation of <a href="trait.RawMutex.html#tymethod.unlock"><code>unlock</code></a>.</p>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../implementors/lock_api/trait.RawMutexFair.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,15 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Additional methods for mutexes which support locking with timeouts."><meta name="keywords" content="rust, rustlang, rust-lang, RawMutexTimed"><title>RawMutexTimed in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait RawMutexTimed</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><div class="sidebar-links"><a href="#associatedtype.Duration">Duration</a><a href="#associatedtype.Instant">Instant</a></div><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.try_lock_for">try_lock_for</a><a href="#tymethod.try_lock_until">try_lock_until</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="RawMutexTimed" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="#">RawMutexTimed</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/mutex.rs.html#113-125" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait">pub unsafe trait RawMutexTimed: <a class="trait" href="trait.RawMutex.html" title="trait lock_api::RawMutex">RawMutex</a> {
type <a href="#associatedtype.Duration" class="type">Duration</a>;
type <a href="#associatedtype.Instant" class="type">Instant</a>;
fn <a href="#tymethod.try_lock_for" class="fnname">try_lock_for</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawMutexTimed.html#associatedtype.Duration" title="type lock_api::RawMutexTimed::Duration">Duration</a>) -&gt; bool;
<div class="item-spacer"></div> fn <a href="#tymethod.try_lock_until" class="fnname">try_lock_until</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawMutexTimed.html#associatedtype.Instant" title="type lock_api::RawMutexTimed::Instant">Instant</a>) -&gt; bool;
}</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Additional methods for mutexes which support locking with timeouts.</p>
<p>The <code>Duration</code> and <code>Instant</code> types are specified as associated types so that
this trait is usable even in <code>no_std</code> environments.</p>
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Duration" class="method has-srclink"><h4 class="code-header">type <a href="#associatedtype.Duration" class="type">Duration</a></h4><a class="srclink" href="../src/lock_api/mutex.rs.html#115" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Duration type used for <code>try_lock_for</code>.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Instant" class="method has-srclink"><h4 class="code-header">type <a href="#associatedtype.Instant" class="type">Instant</a></h4><a class="srclink" href="../src/lock_api/mutex.rs.html#118" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Instant type used for <code>try_lock_until</code>.</p>
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.try_lock_for" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.try_lock_for" class="fnname">try_lock_for</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawMutexTimed.html#associatedtype.Duration" title="type lock_api::RawMutexTimed::Duration">Duration</a>) -&gt; bool</h4><a class="srclink" href="../src/lock_api/mutex.rs.html#121" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire this lock until a timeout is reached.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_lock_until" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.try_lock_until" class="fnname">try_lock_until</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawMutexTimed.html#associatedtype.Instant" title="type lock_api::RawMutexTimed::Instant">Instant</a>) -&gt; bool</h4><a class="srclink" href="../src/lock_api/mutex.rs.html#124" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire this lock until a timeout is reached.</p>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../implementors/lock_api/trait.RawMutexTimed.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,38 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Basic operations for a reader-writer lock."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLock"><title>RawRwLock in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait RawRwLock</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><div class="sidebar-links"><a href="#associatedtype.GuardMarker">GuardMarker</a></div><h3 class="sidebar-title"><a href="#associated-const">Associated Constants</a></h3><div class="sidebar-links"><a href="#associatedconstant.INIT">INIT</a></div><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.lock_exclusive">lock_exclusive</a><a href="#tymethod.lock_shared">lock_shared</a><a href="#tymethod.try_lock_exclusive">try_lock_exclusive</a><a href="#tymethod.try_lock_shared">try_lock_shared</a><a href="#tymethod.unlock_exclusive">unlock_exclusive</a><a href="#tymethod.unlock_shared">unlock_shared</a></div><h3 class="sidebar-title"><a href="#provided-methods">Provided Methods</a></h3><div class="sidebar-links"><a href="#method.is_locked">is_locked</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="RawRwLock" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="#">RawRwLock</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#31-80" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait">pub unsafe trait RawRwLock {
type <a href="#associatedtype.GuardMarker" class="type">GuardMarker</a>;
const <a href="#associatedconstant.INIT" class="constant"><b>INIT</b></a>: Self;
fn <a href="#tymethod.lock_shared" class="fnname">lock_shared</a>(&amp;self);
<div class="item-spacer"></div> fn <a href="#tymethod.try_lock_shared" class="fnname">try_lock_shared</a>(&amp;self) -&gt; bool;
<div class="item-spacer"></div> unsafe fn <a href="#tymethod.unlock_shared" class="fnname">unlock_shared</a>(&amp;self);
<div class="item-spacer"></div> fn <a href="#tymethod.lock_exclusive" class="fnname">lock_exclusive</a>(&amp;self);
<div class="item-spacer"></div> fn <a href="#tymethod.try_lock_exclusive" class="fnname">try_lock_exclusive</a>(&amp;self) -&gt; bool;
<div class="item-spacer"></div> unsafe fn <a href="#tymethod.unlock_exclusive" class="fnname">unlock_exclusive</a>(&amp;self);
fn <a href="#method.is_locked" class="fnname">is_locked</a>(&amp;self) -&gt; bool { ... }
}</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Basic operations for a reader-writer lock.</p>
<p>Types implementing this trait can be used by <code>RwLock</code> to form a safe and
fully-functioning <code>RwLock</code> type.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>Implementations of this trait must ensure that the <code>RwLock</code> is actually
exclusive: an exclusive lock cant be acquired while an exclusive or shared
lock exists, and a shared lock cant be acquire while an exclusive lock
exists.</p>
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.GuardMarker" class="method has-srclink"><h4 class="code-header">type <a href="#associatedtype.GuardMarker" class="type">GuardMarker</a></h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#40" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Marker type which determines whether a lock guard should be <code>Send</code>. Use
one of the <code>GuardSend</code> or <code>GuardNoSend</code> helper types here.</p>
</div></details></div><h2 id="associated-const" class="small-section-header">Associated Constants<a href="#associated-const" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedconstant.INIT" class="method has-srclink"><h4 class="code-header">const <a href="#associatedconstant.INIT" class="constant"><b>INIT</b></a>: Self</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#36" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Initial value for an unlocked <code>RwLock</code>.</p>
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.lock_shared" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.lock_shared" class="fnname">lock_shared</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#43" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Acquires a shared lock, blocking the current thread until it is able to do so.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_lock_shared" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.try_lock_shared" class="fnname">try_lock_shared</a>(&amp;self) -&gt; bool</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#46" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire a shared lock without blocking.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.unlock_shared" class="method has-srclink"><h4 class="code-header">unsafe fn <a href="#tymethod.unlock_shared" class="fnname">unlock_shared</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#53" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Releases a shared lock.</p>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method may only be called if a shared lock is held in the current context.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.lock_exclusive" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.lock_exclusive" class="fnname">lock_exclusive</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#56" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Acquires an exclusive lock, blocking the current thread until it is able to do so.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_lock_exclusive" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.try_lock_exclusive" class="fnname">try_lock_exclusive</a>(&amp;self) -&gt; bool</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#59" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire an exclusive lock without blocking.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.unlock_exclusive" class="method has-srclink"><h4 class="code-header">unsafe fn <a href="#tymethod.unlock_exclusive" class="fnname">unlock_exclusive</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#66" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Releases an exclusive lock.</p>
<h1 id="safety-2" class="section-header"><a href="#safety-2">Safety</a></h1>
<p>This method may only be called if an exclusive lock is held in the current context.</p>
</div></details></div><h2 id="provided-methods" class="small-section-header">Provided methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="method.is_locked" class="method has-srclink"><h4 class="code-header">fn <a href="#method.is_locked" class="fnname">is_locked</a>(&amp;self) -&gt; bool</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#70-79" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Checks if this <code>RwLock</code> is currently locked in any way.</p>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../implementors/lock_api/trait.RawRwLock.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Additional methods for RwLocks which support atomically downgrading an exclusive lock to a shared lock."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockDowngrade"><title>RawRwLockDowngrade in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait RawRwLockDowngrade</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.downgrade">downgrade</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="RawRwLockDowngrade" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="#">RawRwLockDowngrade</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#134-142" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait">pub unsafe trait RawRwLockDowngrade: <a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> {
unsafe fn <a href="#tymethod.downgrade" class="fnname">downgrade</a>(&amp;self);
}</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Additional methods for RwLocks which support atomically downgrading an
exclusive lock to a shared lock.</p>
</div></details><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.downgrade" class="method has-srclink"><h4 class="code-header">unsafe fn <a href="#tymethod.downgrade" class="fnname">downgrade</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#141" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Atomically downgrades an exclusive lock into a shared lock without
allowing any thread to take an exclusive lock in the meantime.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>This method may only be called if an exclusive lock is held in the current context.</p>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../implementors/lock_api/trait.RawRwLockDowngrade.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,32 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Additional methods for RwLocks which support fair unlocking."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockFair"><title>RawRwLockFair in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait RawRwLockFair</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.unlock_exclusive_fair">unlock_exclusive_fair</a><a href="#tymethod.unlock_shared_fair">unlock_shared_fair</a></div><h3 class="sidebar-title"><a href="#provided-methods">Provided Methods</a></h3><div class="sidebar-links"><a href="#method.bump_exclusive">bump_exclusive</a><a href="#method.bump_shared">bump_shared</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="RawRwLockFair" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="#">RawRwLockFair</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#88-130" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait">pub unsafe trait RawRwLockFair: <a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> {
unsafe fn <a href="#tymethod.unlock_shared_fair" class="fnname">unlock_shared_fair</a>(&amp;self);
<div class="item-spacer"></div> unsafe fn <a href="#tymethod.unlock_exclusive_fair" class="fnname">unlock_exclusive_fair</a>(&amp;self);
unsafe fn <a href="#method.bump_shared" class="fnname">bump_shared</a>(&amp;self) { ... }
<div class="item-spacer"></div> unsafe fn <a href="#method.bump_exclusive" class="fnname">bump_exclusive</a>(&amp;self) { ... }
}</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Additional methods for RwLocks which support fair unlocking.</p>
<p>Fair unlocking means that a lock is handed directly over to the next waiting
thread if there is one, without giving other threads the opportunity to
“steal” the lock in the meantime. This is typically slower than unfair
unlocking, but may be necessary in certain circumstances.</p>
</div></details><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.unlock_shared_fair" class="method has-srclink"><h4 class="code-header">unsafe fn <a href="#tymethod.unlock_shared_fair" class="fnname">unlock_shared_fair</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#94" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Releases a shared lock using a fair unlock protocol.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>This method may only be called if a shared lock is held in the current context.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.unlock_exclusive_fair" class="method has-srclink"><h4 class="code-header">unsafe fn <a href="#tymethod.unlock_exclusive_fair" class="fnname">unlock_exclusive_fair</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#101" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Releases an exclusive lock using a fair unlock protocol.</p>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method may only be called if an exclusive lock is held in the current context.</p>
</div></details></div><h2 id="provided-methods" class="small-section-header">Provided methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="method.bump_shared" class="method has-srclink"><h4 class="code-header">unsafe fn <a href="#method.bump_shared" class="fnname">bump_shared</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#112-115" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Temporarily yields a shared lock to a waiting thread if there is one.</p>
<p>This method is functionally equivalent to calling <code>unlock_shared_fair</code> followed
by <code>lock_shared</code>, however it can be much more efficient in the case where there
are no waiting threads.</p>
<h1 id="safety-2" class="section-header"><a href="#safety-2">Safety</a></h1>
<p>This method may only be called if a shared lock is held in the current context.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.bump_exclusive" class="method has-srclink"><h4 class="code-header">unsafe fn <a href="#method.bump_exclusive" class="fnname">bump_exclusive</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#126-129" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Temporarily yields an exclusive lock to a waiting thread if there is one.</p>
<p>This method is functionally equivalent to calling <code>unlock_exclusive_fair</code> followed
by <code>lock_exclusive</code>, however it can be much more efficient in the case where there
are no waiting threads.</p>
<h1 id="safety-3" class="section-header"><a href="#safety-3">Safety</a></h1>
<p>This method may only be called if an exclusive lock is held in the current context.</p>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../implementors/lock_api/trait.RawRwLockFair.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,14 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Additional methods for RwLocks which support recursive read locks."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockRecursive"><title>RawRwLockRecursive in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait RawRwLockRecursive</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.lock_shared_recursive">lock_shared_recursive</a><a href="#tymethod.try_lock_shared_recursive">try_lock_shared_recursive</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="RawRwLockRecursive" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="#">RawRwLockRecursive</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#175-181" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait">pub unsafe trait RawRwLockRecursive: <a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> {
fn <a href="#tymethod.lock_shared_recursive" class="fnname">lock_shared_recursive</a>(&amp;self);
<div class="item-spacer"></div> fn <a href="#tymethod.try_lock_shared_recursive" class="fnname">try_lock_shared_recursive</a>(&amp;self) -&gt; bool;
}</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Additional methods for RwLocks which support recursive read locks.</p>
<p>These are guaranteed to succeed without blocking if
another read lock is held at the time of the call. This allows a thread
to recursively lock a <code>RwLock</code>. However using this method can cause
writers to starve since readers no longer block if a writer is waiting
for the lock.</p>
</div></details><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.lock_shared_recursive" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.lock_shared_recursive" class="fnname">lock_shared_recursive</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#177" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Acquires a shared lock without deadlocking in case of a recursive lock.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_lock_shared_recursive" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.try_lock_shared_recursive" class="fnname">try_lock_shared_recursive</a>(&amp;self) -&gt; bool</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#180" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire a shared lock without deadlocking in case of a recursive lock.</p>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../implementors/lock_api/trait.RawRwLockRecursive.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Additional methods for RwLocks which support recursive read locks and timeouts."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockRecursiveTimed"><title>RawRwLockRecursiveTimed in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait RawRwLockRecursiveTimed</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.try_lock_shared_recursive_for">try_lock_shared_recursive_for</a><a href="#tymethod.try_lock_shared_recursive_until">try_lock_shared_recursive_until</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="RawRwLockRecursiveTimed" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="#">RawRwLockRecursiveTimed</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#184-192" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait">pub unsafe trait RawRwLockRecursiveTimed: <a class="trait" href="trait.RawRwLockRecursive.html" title="trait lock_api::RawRwLockRecursive">RawRwLockRecursive</a> + <a class="trait" href="trait.RawRwLockTimed.html" title="trait lock_api::RawRwLockTimed">RawRwLockTimed</a> {
fn <a href="#tymethod.try_lock_shared_recursive_for" class="fnname">try_lock_shared_recursive_for</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -&gt; bool;
<div class="item-spacer"></div> fn <a href="#tymethod.try_lock_shared_recursive_until" class="fnname">try_lock_shared_recursive_until</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -&gt; bool;
}</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Additional methods for RwLocks which support recursive read locks and timeouts.</p>
</div></details><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.try_lock_shared_recursive_for" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.try_lock_shared_recursive_for" class="fnname">try_lock_shared_recursive_for</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -&gt; bool</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#187" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire a shared lock until a timeout is reached, without
deadlocking in case of a recursive lock.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_lock_shared_recursive_until" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.try_lock_shared_recursive_until" class="fnname">try_lock_shared_recursive_until</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -&gt; bool</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#191" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire a shared lock until a timeout is reached, without
deadlocking in case of a recursive lock.</p>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../implementors/lock_api/trait.RawRwLockRecursiveTimed.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,19 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Additional methods for RwLocks which support locking with timeouts."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockTimed"><title>RawRwLockTimed in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait RawRwLockTimed</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><div class="sidebar-links"><a href="#associatedtype.Duration">Duration</a><a href="#associatedtype.Instant">Instant</a></div><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.try_lock_exclusive_for">try_lock_exclusive_for</a><a href="#tymethod.try_lock_exclusive_until">try_lock_exclusive_until</a><a href="#tymethod.try_lock_shared_for">try_lock_shared_for</a><a href="#tymethod.try_lock_shared_until">try_lock_shared_until</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="RawRwLockTimed" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="#">RawRwLockTimed</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#148-166" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait">pub unsafe trait RawRwLockTimed: <a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> {
type <a href="#associatedtype.Duration" class="type">Duration</a>;
type <a href="#associatedtype.Instant" class="type">Instant</a>;
fn <a href="#tymethod.try_lock_shared_for" class="fnname">try_lock_shared_for</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -&gt; bool;
<div class="item-spacer"></div> fn <a href="#tymethod.try_lock_shared_until" class="fnname">try_lock_shared_until</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -&gt; bool;
<div class="item-spacer"></div> fn <a href="#tymethod.try_lock_exclusive_for" class="fnname">try_lock_exclusive_for</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -&gt; bool;
<div class="item-spacer"></div> fn <a href="#tymethod.try_lock_exclusive_until" class="fnname">try_lock_exclusive_until</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -&gt; bool;
}</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Additional methods for RwLocks which support locking with timeouts.</p>
<p>The <code>Duration</code> and <code>Instant</code> types are specified as associated types so that
this trait is usable even in <code>no_std</code> environments.</p>
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Duration" class="method has-srclink"><h4 class="code-header">type <a href="#associatedtype.Duration" class="type">Duration</a></h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#150" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Duration type used for <code>try_lock_for</code>.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Instant" class="method has-srclink"><h4 class="code-header">type <a href="#associatedtype.Instant" class="type">Instant</a></h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#153" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Instant type used for <code>try_lock_until</code>.</p>
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.try_lock_shared_for" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.try_lock_shared_for" class="fnname">try_lock_shared_for</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -&gt; bool</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#156" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire a shared lock until a timeout is reached.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_lock_shared_until" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.try_lock_shared_until" class="fnname">try_lock_shared_until</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -&gt; bool</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#159" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire a shared lock until a timeout is reached.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_lock_exclusive_for" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.try_lock_exclusive_for" class="fnname">try_lock_exclusive_for</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -&gt; bool</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#162" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire an exclusive lock until a timeout is reached.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_lock_exclusive_until" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.try_lock_exclusive_until" class="fnname">try_lock_exclusive_until</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -&gt; bool</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#165" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire an exclusive lock until a timeout is reached.</p>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../implementors/lock_api/trait.RawRwLockTimed.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,26 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Additional methods for RwLocks which support atomically upgrading a shared lock to an exclusive lock."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockUpgrade"><title>RawRwLockUpgrade in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait RawRwLockUpgrade</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.lock_upgradable">lock_upgradable</a><a href="#tymethod.try_lock_upgradable">try_lock_upgradable</a><a href="#tymethod.try_upgrade">try_upgrade</a><a href="#tymethod.unlock_upgradable">unlock_upgradable</a><a href="#tymethod.upgrade">upgrade</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="RawRwLockUpgrade" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="#">RawRwLockUpgrade</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#200-228" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait">pub unsafe trait RawRwLockUpgrade: <a class="trait" href="trait.RawRwLock.html" title="trait lock_api::RawRwLock">RawRwLock</a> {
fn <a href="#tymethod.lock_upgradable" class="fnname">lock_upgradable</a>(&amp;self);
<div class="item-spacer"></div> fn <a href="#tymethod.try_lock_upgradable" class="fnname">try_lock_upgradable</a>(&amp;self) -&gt; bool;
<div class="item-spacer"></div> unsafe fn <a href="#tymethod.unlock_upgradable" class="fnname">unlock_upgradable</a>(&amp;self);
<div class="item-spacer"></div> unsafe fn <a href="#tymethod.upgrade" class="fnname">upgrade</a>(&amp;self);
<div class="item-spacer"></div> unsafe fn <a href="#tymethod.try_upgrade" class="fnname">try_upgrade</a>(&amp;self) -&gt; bool;
}</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Additional methods for RwLocks which support atomically upgrading a shared
lock to an exclusive lock.</p>
<p>This requires acquiring a special “upgradable read lock” instead of a
normal shared lock. There may only be one upgradable lock at any time,
otherwise deadlocks could occur when upgrading.</p>
</div></details><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.lock_upgradable" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.lock_upgradable" class="fnname">lock_upgradable</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#202" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Acquires an upgradable lock, blocking the current thread until it is able to do so.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_lock_upgradable" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.try_lock_upgradable" class="fnname">try_lock_upgradable</a>(&amp;self) -&gt; bool</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#205" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire an upgradable lock without blocking.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.unlock_upgradable" class="method has-srclink"><h4 class="code-header">unsafe fn <a href="#tymethod.unlock_upgradable" class="fnname">unlock_upgradable</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#212" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Releases an upgradable lock.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>This method may only be called if an upgradable lock is held in the current context.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.upgrade" class="method has-srclink"><h4 class="code-header">unsafe fn <a href="#tymethod.upgrade" class="fnname">upgrade</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#219" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Upgrades an upgradable lock to an exclusive lock.</p>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method may only be called if an upgradable lock is held in the current context.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_upgrade" class="method has-srclink"><h4 class="code-header">unsafe fn <a href="#tymethod.try_upgrade" class="fnname">try_upgrade</a>(&amp;self) -&gt; bool</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#227" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to upgrade an upgradable lock to an exclusive lock without
blocking.</p>
<h1 id="safety-2" class="section-header"><a href="#safety-2">Safety</a></h1>
<p>This method may only be called if an upgradable lock is held in the current context.</p>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../implementors/lock_api/trait.RawRwLockUpgrade.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,14 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Additional methods for RwLocks which support upgradable locks and lock downgrading."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockUpgradeDowngrade"><title>RawRwLockUpgradeDowngrade in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait RawRwLockUpgradeDowngrade</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.downgrade_to_upgradable">downgrade_to_upgradable</a><a href="#tymethod.downgrade_upgradable">downgrade_upgradable</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="RawRwLockUpgradeDowngrade" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="#">RawRwLockUpgradeDowngrade</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#257-271" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait">pub unsafe trait RawRwLockUpgradeDowngrade: <a class="trait" href="trait.RawRwLockUpgrade.html" title="trait lock_api::RawRwLockUpgrade">RawRwLockUpgrade</a> + <a class="trait" href="trait.RawRwLockDowngrade.html" title="trait lock_api::RawRwLockDowngrade">RawRwLockDowngrade</a> {
unsafe fn <a href="#tymethod.downgrade_upgradable" class="fnname">downgrade_upgradable</a>(&amp;self);
<div class="item-spacer"></div> unsafe fn <a href="#tymethod.downgrade_to_upgradable" class="fnname">downgrade_to_upgradable</a>(&amp;self);
}</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Additional methods for RwLocks which support upgradable locks and lock
downgrading.</p>
</div></details><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.downgrade_upgradable" class="method has-srclink"><h4 class="code-header">unsafe fn <a href="#tymethod.downgrade_upgradable" class="fnname">downgrade_upgradable</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#263" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Downgrades an upgradable lock to a shared lock.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>This method may only be called if an upgradable lock is held in the current context.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.downgrade_to_upgradable" class="method has-srclink"><h4 class="code-header">unsafe fn <a href="#tymethod.downgrade_to_upgradable" class="fnname">downgrade_to_upgradable</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#270" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Downgrades an exclusive lock to an upgradable lock.</p>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method may only be called if an exclusive lock is held in the current context.</p>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../implementors/lock_api/trait.RawRwLockUpgradeDowngrade.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Additional methods for RwLocks which support upgradable locks and fair unlocking."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockUpgradeFair"><title>RawRwLockUpgradeFair in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait RawRwLockUpgradeFair</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.unlock_upgradable_fair">unlock_upgradable_fair</a></div><h3 class="sidebar-title"><a href="#provided-methods">Provided Methods</a></h3><div class="sidebar-links"><a href="#method.bump_upgradable">bump_upgradable</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="RawRwLockUpgradeFair" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="#">RawRwLockUpgradeFair</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#232-253" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait">pub unsafe trait RawRwLockUpgradeFair: <a class="trait" href="trait.RawRwLockUpgrade.html" title="trait lock_api::RawRwLockUpgrade">RawRwLockUpgrade</a> + <a class="trait" href="trait.RawRwLockFair.html" title="trait lock_api::RawRwLockFair">RawRwLockFair</a> {
unsafe fn <a href="#tymethod.unlock_upgradable_fair" class="fnname">unlock_upgradable_fair</a>(&amp;self);
unsafe fn <a href="#method.bump_upgradable" class="fnname">bump_upgradable</a>(&amp;self) { ... }
}</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Additional methods for RwLocks which support upgradable locks and fair
unlocking.</p>
</div></details><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.unlock_upgradable_fair" class="method has-srclink"><h4 class="code-header">unsafe fn <a href="#tymethod.unlock_upgradable_fair" class="fnname">unlock_upgradable_fair</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#238" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Releases an upgradable lock using a fair unlock protocol.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>This method may only be called if an upgradable lock is held in the current context.</p>
</div></details></div><h2 id="provided-methods" class="small-section-header">Provided methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="method.bump_upgradable" class="method has-srclink"><h4 class="code-header">unsafe fn <a href="#method.bump_upgradable" class="fnname">bump_upgradable</a>(&amp;self)</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#249-252" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Temporarily yields an upgradable lock to a waiting thread if there is one.</p>
<p>This method is functionally equivalent to calling <code>unlock_upgradable_fair</code> followed
by <code>lock_upgradable</code>, however it can be much more efficient in the case where there
are no waiting threads.</p>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method may only be called if an upgradable lock is held in the current context.</p>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../implementors/lock_api/trait.RawRwLockUpgradeFair.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,20 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Additional methods for RwLocks which support upgradable locks and locking with timeouts."><meta name="keywords" content="rust, rustlang, rust-lang, RawRwLockUpgradeTimed"><title>RawRwLockUpgradeTimed in lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../lock_api/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait RawRwLockUpgradeTimed</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.try_lock_upgradable_for">try_lock_upgradable_for</a><a href="#tymethod.try_lock_upgradable_until">try_lock_upgradable_until</a><a href="#tymethod.try_upgrade_for">try_upgrade_for</a><a href="#tymethod.try_upgrade_until">try_upgrade_until</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="RawRwLockUpgradeTimed" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">lock_api</a>::<wbr><a class="trait" href="#">RawRwLockUpgradeTimed</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/lock_api/rwlock.rs.html#275-297" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait">pub unsafe trait RawRwLockUpgradeTimed: <a class="trait" href="trait.RawRwLockUpgrade.html" title="trait lock_api::RawRwLockUpgrade">RawRwLockUpgrade</a> + <a class="trait" href="trait.RawRwLockTimed.html" title="trait lock_api::RawRwLockTimed">RawRwLockTimed</a> {
fn <a href="#tymethod.try_lock_upgradable_for" class="fnname">try_lock_upgradable_for</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -&gt; bool;
<div class="item-spacer"></div> fn <a href="#tymethod.try_lock_upgradable_until" class="fnname">try_lock_upgradable_until</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -&gt; bool;
<div class="item-spacer"></div> unsafe fn <a href="#tymethod.try_upgrade_for" class="fnname">try_upgrade_for</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -&gt; bool;
<div class="item-spacer"></div> unsafe fn <a href="#tymethod.try_upgrade_until" class="fnname">try_upgrade_until</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -&gt; bool;
}</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Additional methods for RwLocks which support upgradable locks and locking
with timeouts.</p>
</div></details><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.try_lock_upgradable_for" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.try_lock_upgradable_for" class="fnname">try_lock_upgradable_for</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -&gt; bool</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#277" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire an upgradable lock until a timeout is reached.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_lock_upgradable_until" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.try_lock_upgradable_until" class="fnname">try_lock_upgradable_until</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -&gt; bool</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#280" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to acquire an upgradable lock until a timeout is reached.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_upgrade_for" class="method has-srclink"><h4 class="code-header">unsafe fn <a href="#tymethod.try_upgrade_for" class="fnname">try_upgrade_for</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawRwLockTimed.html#associatedtype.Duration" title="type lock_api::RawRwLockTimed::Duration">Duration</a>) -&gt; bool</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#288" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to upgrade an upgradable lock to an exclusive lock until a
timeout is reached.</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>This method may only be called if an upgradable lock is held in the current context.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_upgrade_until" class="method has-srclink"><h4 class="code-header">unsafe fn <a href="#tymethod.try_upgrade_until" class="fnname">try_upgrade_until</a>(&amp;self, timeout: Self::<a class="type" href="trait.RawRwLockTimed.html#associatedtype.Instant" title="type lock_api::RawRwLockTimed::Instant">Instant</a>) -&gt; bool</h4><a class="srclink" href="../src/lock_api/rwlock.rs.html#296" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Attempts to upgrade an upgradable lock to an exclusive lock until a
timeout is reached.</p>
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
<p>This method may only be called if an upgradable lock is held in the current context.</p>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../implementors/lock_api/trait.RawRwLockUpgradeTimed.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="lock_api" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

5
scopeguard/all.html Normal file
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="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../scopeguard/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Crate scopeguard</h2><div class="block version"><p>Version 1.1.0</p></div><a id="all-types" href="index.html"><p>Back to index</p></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">List of all items</span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span>
</span>
</h1><h3 id="Structs">Structs</h3><ul class="structs docblock"><li><a href="struct.ScopeGuard.html">ScopeGuard</a></li></ul><h3 id="Enums">Enums</h3><ul class="enums docblock"><li><a href="enum.Always.html">Always</a></li></ul><h3 id="Traits">Traits</h3><ul class="traits docblock"><li><a href="trait.Strategy.html">Strategy</a></li></ul><h3 id="Macros">Macros</h3><ul class="macros docblock"><li><a href="macro.defer.html">defer</a></li></ul><h3 id="Functions">Functions</h3><ul class="functions docblock"><li><a href="fn.guard.html">guard</a></li></ul></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="scopeguard" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,19 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Always run on scope exit."><meta name="keywords" content="rust, rustlang, rust-lang, Always"><title>Always in scopeguard - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../scopeguard/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Enum Always</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Strategy">Strategy</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><h2 class="location">Other items in<br><a href="index.html">scopeguard</a></h2><div id="sidebar-vars" data-name="Always" data-ty="enum" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Enum <a href="index.html">scopeguard</a>::<wbr><a class="enum" href="#">Always</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/scopeguard/lib.rs.html#213" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust enum">pub enum Always {}</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Always run on scope exit.</p>
<p>“Always” run: on regular exit from a scope or on unwinding from a panic.
Can not run on abort, process exit, and other catastrophic events where
destructors dont run.</p>
</div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Debug" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="enum.Always.html" title="enum scopeguard::Always">Always</a></h3><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/scopeguard/lib.rs.html#212" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.54.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4><a href="#method.fmt" class="anchor"></a><a class="srclink" href="../src/scopeguard/lib.rs.html#212" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Strategy" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="trait.Strategy.html" title="trait scopeguard::Strategy">Strategy</a> for <a class="enum" href="enum.Always.html" title="enum scopeguard::Always">Always</a></h3><a href="#impl-Strategy" class="anchor"></a><a class="srclink" href="../src/scopeguard/lib.rs.html#229-232" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.should_run" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="trait.Strategy.html#tymethod.should_run" class="fnname">should_run</a>() -&gt; bool</h4><a href="#method.should_run" class="anchor"></a><a class="srclink" href="../src/scopeguard/lib.rs.html#231" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Return <code>true</code> if the guards associated code should run
(in the context where this method is called). <a href="trait.Strategy.html#tymethod.should_run">Read more</a></p>
</div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-Send" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="enum.Always.html" title="enum scopeguard::Always">Always</a></h3><a href="#impl-Send" class="anchor"></a></div><div id="impl-Sync" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="enum.Always.html" title="enum scopeguard::Always">Always</a></h3><a href="#impl-Sync" class="anchor"></a></div><div id="impl-Unpin" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="enum.Always.html" title="enum scopeguard::Always">Always</a></h3><a href="#impl-Unpin" class="anchor"></a></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Any" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#131-135" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4><a href="#method.type_id" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#132" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.borrow" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4><a href="#method.borrow_mut" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#217" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#544-548" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</h4><a href="#method.from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#545" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#533-540" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</h4><a href="#method.into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#537" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#581-590" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4><a href="#associatedtype.Error" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#587" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#567-576" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4><a href="#associatedtype.Error-1" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#573" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="scopeguard" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

4
scopeguard/fn.guard.html Normal file
View File

@ -0,0 +1,4 @@
<!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="Create a new `ScopeGuard` owning `v` and with deferred closure `dropfn`."><meta name="keywords" content="rust, rustlang, rust-lang, guard"><title>guard in scopeguard - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../scopeguard/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="index.html">scopeguard</a></h2><div id="sidebar-vars" data-name="guard" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="index.html">scopeguard</a>::<wbr><a class="fn" href="#">guard</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/scopeguard/lib.rs.html#367-371" title="goto source code">[src]</a></span></h1><pre class="rust fn">pub fn guard&lt;T, F&gt;(v: T, dropfn: F) -&gt; <a class="struct" href="struct.ScopeGuard.html" title="struct scopeguard::ScopeGuard">ScopeGuard</a>&lt;T, F, <a class="enum" href="enum.Always.html" title="enum scopeguard::Always">Always</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(T),&nbsp;</span></pre><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Create a new <code>ScopeGuard</code> owning <code>v</code> and with deferred closure <code>dropfn</code>.</p>
</div></details></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="scopeguard" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

171
scopeguard/index.html Normal file
View File

@ -0,0 +1,171 @@
<!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 scope guard will run a given closure when it goes out of scope, even if the code between panics. (as long as panic doesnt abort)"><meta name="keywords" content="rust, rustlang, rust-lang, scopeguard"><title>scopeguard - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../scopeguard/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Crate scopeguard</h2><div class="block version"><p>Version 1.1.0</p></div><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all scopeguard's items</p></a><div class="block items"><ul><li><a href="#macros">Macros</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li></ul></div><div id="sidebar-vars" data-name="scopeguard" data-ty="mod" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">scopeguard</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/scopeguard/lib.rs.html#1-578" title="goto source code">[src]</a></span></h1><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A scope guard will run a given closure when it goes out of scope,
even if the code between panics.
(as long as panic doesnt abort)</p>
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1><h2 id="hello-world" class="section-header"><a href="#hello-world">Hello World</a></h2>
<p>This example creates a scope guard with an example function:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">scopeguard</span>;
<span class="kw">fn</span> <span class="ident">f</span>() {
<span class="kw">let</span> <span class="ident">_guard</span> <span class="op">=</span> <span class="ident">scopeguard::guard</span>((), <span class="op">|</span><span class="kw">_</span><span class="op">|</span> {
<span class="macro">println!</span>(<span class="string">&quot;Hello Scope Exit!&quot;</span>);
});
<span class="comment">// rest of the code here.</span>
<span class="comment">// Here, at the end of `_guard`&#39;s scope, the guard&#39;s closure is called.</span>
<span class="comment">// It is also called if we exit this scope through unwinding instead.</span>
}</pre></div>
<h2 id="defer" class="section-header"><a href="#defer"><code>defer!</code></a></h2>
<p>Use the <code>defer</code> macro to run an operation at scope exit,
either regular scope exit or during unwinding from a panic.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="attribute">#[<span class="ident">macro_use</span>(<span class="ident">defer</span>)]</span> <span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">scopeguard</span>;
<span class="kw">use</span> <span class="ident">std::cell::Cell</span>;
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="comment">// use a cell to observe drops during and after the scope guard is active</span>
<span class="kw">let</span> <span class="ident">drop_counter</span> <span class="op">=</span> <span class="ident">Cell::new</span>(<span class="number">0</span>);
{
<span class="comment">// Create a scope guard using `defer!` for the current scope</span>
<span class="macro">defer!</span> {
<span class="ident">drop_counter</span>.<span class="ident">set</span>(<span class="number">1</span> <span class="op">+</span> <span class="ident">drop_counter</span>.<span class="ident">get</span>());
}
<span class="comment">// Do regular operations here in the meantime.</span>
<span class="comment">// Just before scope exit: it hasn&#39;t run yet.</span>
<span class="macro">assert_eq!</span>(<span class="ident">drop_counter</span>.<span class="ident">get</span>(), <span class="number">0</span>);
<span class="comment">// The following scope end is where the defer closure is called</span>
}
<span class="macro">assert_eq!</span>(<span class="ident">drop_counter</span>.<span class="ident">get</span>(), <span class="number">1</span>);
}</pre></div>
<h2 id="scope-guard-with-value" class="section-header"><a href="#scope-guard-with-value">Scope Guard with Value</a></h2>
<p>If the scope guard closure needs to access an outer value that is also
mutated outside of the scope guard, then you may want to use the scope guard
with a value. The guard works like a smart pointer, so the inner value can
be accessed by reference or by mutable reference.</p>
<h3 id="1-the-guard-owns-a-file" class="section-header"><a href="#1-the-guard-owns-a-file">1. The guard owns a file</a></h3>
<p>In this example, the scope guard owns a file and ensures pending writes are
synced at scope exit.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">scopeguard</span>;
<span class="kw">use</span> <span class="ident">std::fs</span>::<span class="kw-2">*</span>;
<span class="kw">use</span> <span class="ident">std::io</span>::{<span class="self">self</span>, <span class="ident">Write</span>};
<span class="kw">fn</span> <span class="ident">try_main</span>() <span class="op">-</span><span class="op">&gt;</span> <span class="ident">io::Result</span><span class="op">&lt;</span>()<span class="op">&gt;</span> {
<span class="kw">let</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">File::create</span>(<span class="string">&quot;newfile.txt&quot;</span>)<span class="question-mark">?</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">file</span> <span class="op">=</span> <span class="ident">scopeguard::guard</span>(<span class="ident">f</span>, <span class="op">|</span><span class="ident">f</span><span class="op">|</span> {
<span class="comment">// ensure we flush file at return or panic</span>
<span class="kw">let</span> <span class="kw">_</span> <span class="op">=</span> <span class="ident">f</span>.<span class="ident">sync_all</span>();
});
<span class="comment">// Access the file through the scope guard itself</span>
<span class="ident">file</span>.<span class="ident">write_all</span>(<span class="string">b&quot;test me\n&quot;</span>).<span class="ident">map</span>(<span class="op">|</span><span class="kw">_</span><span class="op">|</span> ())
}
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="ident">try_main</span>().<span class="ident">unwrap</span>();
}
</pre></div>
<h3 id="2-the-guard-restores-an-invariant-on-scope-exit" class="section-header"><a href="#2-the-guard-restores-an-invariant-on-scope-exit">2. The guard restores an invariant on scope exit</a></h3>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">scopeguard</span>;
<span class="kw">use</span> <span class="ident">std::mem::ManuallyDrop</span>;
<span class="kw">use</span> <span class="ident">std::ptr</span>;
<span class="comment">// This function, just for this example, takes the first element</span>
<span class="comment">// and inserts it into the assumed sorted tail of the vector.</span>
<span class="comment">//</span>
<span class="comment">// For optimization purposes we temporarily violate an invariant of the</span>
<span class="comment">// Vec, that it owns all of its elements.</span>
<span class="comment">//</span>
<span class="comment">// The safe approach is to use swap, which means two writes to memory,</span>
<span class="comment">// the optimization is to use a “hole” which uses only one write of memory</span>
<span class="comment">// for each position it moves.</span>
<span class="comment">//</span>
<span class="comment">// We *must* use a scope guard to run this code safely. We</span>
<span class="comment">// are running arbitrary user code (comparison operators) that may panic.</span>
<span class="comment">// The scope guard ensures we restore the invariant after successful</span>
<span class="comment">// exit or during unwinding from panic.</span>
<span class="kw">fn</span> <span class="ident">insertion_sort_first</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span>(<span class="ident">v</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span>)
<span class="kw">where</span> <span class="ident">T</span>: <span class="ident">PartialOrd</span>
{
<span class="kw">struct</span> <span class="ident">Hole</span><span class="op">&lt;</span><span class="lifetime">&#39;a</span>, <span class="ident">T</span>: <span class="lifetime">&#39;a</span><span class="op">&gt;</span> {
<span class="ident">v</span>: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a</span> <span class="kw-2">mut</span> <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span>,
<span class="ident">index</span>: <span class="ident">usize</span>,
<span class="ident">value</span>: <span class="ident">ManuallyDrop</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span>,
}
<span class="kw">unsafe</span> {
<span class="comment">// Create a moved-from location in the vector, a “hole”.</span>
<span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="ident">ptr::read</span>(<span class="kw-2">&amp;</span><span class="ident">v</span>[<span class="number">0</span>]);
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">hole</span> <span class="op">=</span> <span class="ident">Hole</span> { <span class="ident">v</span>: <span class="ident">v</span>, <span class="ident">index</span>: <span class="number">0</span>, <span class="ident">value</span>: <span class="ident">ManuallyDrop::new</span>(<span class="ident">value</span>) };
<span class="comment">// Use a scope guard with a value.</span>
<span class="comment">// At scope exit, plug the hole so that the vector is fully</span>
<span class="comment">// initialized again.</span>
<span class="comment">// The scope guard owns the hole, but we can access it through the guard.</span>
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">hole_guard</span> <span class="op">=</span> <span class="ident">scopeguard::guard</span>(<span class="ident">hole</span>, <span class="op">|</span><span class="ident">hole</span><span class="op">|</span> {
<span class="comment">// plug the hole in the vector with the value that was // taken out</span>
<span class="kw">let</span> <span class="ident">index</span> <span class="op">=</span> <span class="ident">hole</span>.<span class="ident">index</span>;
<span class="ident">ptr::copy_nonoverlapping</span>(<span class="kw-2">&amp;</span><span class="kw-2">*</span><span class="ident">hole</span>.<span class="ident">value</span>, <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">hole</span>.<span class="ident">v</span>[<span class="ident">index</span>], <span class="number">1</span>);
});
<span class="comment">// run algorithm that moves the hole in the vector here</span>
<span class="comment">// move the hole until it&#39;s in a sorted position</span>
<span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="number">1</span>..<span class="ident">hole_guard</span>.<span class="ident">v</span>.<span class="ident">len</span>() {
<span class="kw">if</span> <span class="kw-2">*</span><span class="ident">hole_guard</span>.<span class="ident">value</span> <span class="op">&gt;</span><span class="op">=</span> <span class="ident">hole_guard</span>.<span class="ident">v</span>[<span class="ident">i</span>] {
<span class="comment">// move the element back and the hole forward</span>
<span class="kw">let</span> <span class="ident">index</span> <span class="op">=</span> <span class="ident">hole_guard</span>.<span class="ident">index</span>;
<span class="ident">ptr::copy_nonoverlapping</span>(<span class="kw-2">&amp;</span><span class="ident">hole_guard</span>.<span class="ident">v</span>[<span class="ident">index</span> <span class="op">+</span> <span class="number">1</span>], <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">hole_guard</span>.<span class="ident">v</span>[<span class="ident">index</span>], <span class="number">1</span>);
<span class="ident">hole_guard</span>.<span class="ident">index</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
} <span class="kw">else</span> {
<span class="kw">break</span>;
}
}
<span class="comment">// When the scope exits here, the Vec becomes whole again!</span>
}
}
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="ident">string</span> <span class="op">=</span> <span class="ident">String::from</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">data</span> <span class="op">=</span> <span class="macro">vec!</span>[<span class="ident">string</span>(<span class="string">&quot;c&quot;</span>), <span class="ident">string</span>(<span class="string">&quot;a&quot;</span>), <span class="ident">string</span>(<span class="string">&quot;b&quot;</span>), <span class="ident">string</span>(<span class="string">&quot;d&quot;</span>)];
<span class="ident">insertion_sort_first</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">data</span>);
<span class="macro">assert_eq!</span>(<span class="ident">data</span>, <span class="macro">vec!</span>[<span class="string">&quot;a&quot;</span>, <span class="string">&quot;b&quot;</span>, <span class="string">&quot;c&quot;</span>, <span class="string">&quot;d&quot;</span>]);
}
</pre></div>
<h1 id="crate-features" class="section-header"><a href="#crate-features">Crate Features</a></h1>
<ul>
<li><code>use_std</code>
<ul>
<li>Enabled by default. Enables the <code>OnUnwind</code> and <code>OnSuccess</code> strategies.</li>
<li>Disable to use <code>no_std</code>.</li>
</ul>
</li>
</ul>
<h1 id="rust-version" class="section-header"><a href="#rust-version">Rust Version</a></h1>
<p>This version of the crate requires Rust 1.20 or later.</p>
<p>The scopeguard 1.x release series will use a carefully considered version
upgrade policy, where in a later 1.x version, we will raise the minimum
required Rust version.</p>
</div></details><h2 id="macros" class="section-header"><a href="#macros">Macros</a></h2>
<table><tr class="module-item"><td><a class="macro" href="macro.defer.html" title="scopeguard::defer macro">defer</a></td><td class="docblock-short"><p>Macro to create a <code>ScopeGuard</code> (always run).</p>
</td></tr></table><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.ScopeGuard.html" title="scopeguard::ScopeGuard struct">ScopeGuard</a></td><td class="docblock-short"><p><code>ScopeGuard</code> is a scope guard that may own a protected value.</p>
</td></tr></table><h2 id="enums" class="section-header"><a href="#enums">Enums</a></h2>
<table><tr class="module-item"><td><a class="enum" href="enum.Always.html" title="scopeguard::Always enum">Always</a></td><td class="docblock-short"><p>Always run on scope exit.</p>
</td></tr></table><h2 id="traits" class="section-header"><a href="#traits">Traits</a></h2>
<table><tr class="module-item"><td><a class="trait" href="trait.Strategy.html" title="scopeguard::Strategy trait">Strategy</a></td><td class="docblock-short"><p>Controls in which cases the associated code should be run</p>
</td></tr></table><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
<table><tr class="module-item"><td><a class="fn" href="fn.guard.html" title="scopeguard::guard fn">guard</a></td><td class="docblock-short"><p>Create a new <code>ScopeGuard</code> owning <code>v</code> and with deferred closure <code>dropfn</code>.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="scopeguard" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

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

View File

@ -0,0 +1,10 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Macro to create a `ScopeGuard` (always run)."><meta name="keywords" content="rust, rustlang, rust-lang, defer"><title>defer in scopeguard - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../scopeguard/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="index.html">scopeguard</a></h2><div id="sidebar-vars" data-name="defer" data-ty="macro" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Macro <a href="index.html">scopeguard</a>::<wbr><a class="macro" href="#">defer</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/scopeguard/lib.rs.html#251-255" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><div class="example-wrap"><pre class="rust macro">
<span class="macro">macro_rules!</span> <span class="ident">defer</span> {
($(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">t</span>:<span class="ident">tt</span>)<span class="kw-2">*</span>) <span class="op">=</span><span class="op">&gt;</span> { ... };
}</pre></div>
</div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Macro to create a <code>ScopeGuard</code> (always run).</p>
<p>The macro takes statements, which are the body of a closure
that will run when the scope is exited.</p>
</div></details></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="scopeguard" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1 @@
initSidebarItems({"enum":[["Always","Always run on scope exit."]],"fn":[["guard","Create a new `ScopeGuard` owning `v` and with deferred closure `dropfn`."]],"macro":[["defer","Macro to create a `ScopeGuard` (always run)."]],"struct":[["ScopeGuard","`ScopeGuard` is a scope guard that may own a protected value."]],"trait":[["Strategy","Controls in which cases the associated code should be run"]]});

View File

@ -0,0 +1,50 @@
<!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="`ScopeGuard` is a scope guard that may own a protected value."><meta name="keywords" content="rust, rustlang, rust-lang, ScopeGuard"><title>ScopeGuard in scopeguard - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../scopeguard/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Struct ScopeGuard</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.into_inner">into_inner</a><a href="#method.with_strategy">with_strategy</a></div><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-DerefMut">DerefMut</a><a href="#impl-Drop">Drop</a><a href="#impl-Sync">Sync</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Unpin">Unpin</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><h2 class="location">Other items in<br><a href="index.html">scopeguard</a></h2><div id="sidebar-vars" data-name="ScopeGuard" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">scopeguard</a>::<wbr><a class="struct" href="#">ScopeGuard</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/scopeguard/lib.rs.html#298-306" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust struct">pub struct ScopeGuard&lt;T, F, S&nbsp;=&nbsp;<a class="enum" href="enum.Always.html" title="enum scopeguard::Always">Always</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(T),<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="trait.Strategy.html" title="trait scopeguard::Strategy">Strategy</a>,&nbsp;</span> { /* fields omitted */ }</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><code>ScopeGuard</code> is a scope guard that may own a protected value.</p>
<p>If you place a guard in a local variable, the closure can
run regardless how you leave the scope — through regular return or panic
(except if panic or other code aborts; so as long as destructors run).
It is run only once.</p>
<p>The <code>S</code> parameter for <a href="trait.Strategy.html"><code>Strategy</code></a> determines if
the closure actually runs.</p>
<p>The guards closure will be called with the held value in the destructor.</p>
<p>The <code>ScopeGuard</code> implements <code>Deref</code> so that you can access the inner value.</p>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, F, S&gt; <a class="struct" href="struct.ScopeGuard.html" title="struct scopeguard::ScopeGuard">ScopeGuard</a>&lt;T, F, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(T),<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="trait.Strategy.html" title="trait scopeguard::Strategy">Strategy</a>,&nbsp;</span></h3><a href="#impl" class="anchor"></a><a class="srclink" href="../src/scopeguard/lib.rs.html#308-362" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.with_strategy" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.with_strategy" class="fnname">with_strategy</a>(v: T, dropfn: F) -&gt; <a class="struct" href="struct.ScopeGuard.html" title="struct scopeguard::ScopeGuard">ScopeGuard</a>&lt;T, F, S&gt;</h4><a href="#method.with_strategy" class="anchor"></a><a class="srclink" href="../src/scopeguard/lib.rs.html#317-323" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Create a <code>ScopeGuard</code> that owns <code>v</code> (accessible through deref) and calls
<code>dropfn</code> when its destructor runs.</p>
<p>The <code>Strategy</code> decides whether the scope guards closure should run.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into_inner" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.into_inner" class="fnname">into_inner</a>(guard: Self) -&gt; T</h4><a href="#method.into_inner" class="anchor"></a><a class="srclink" href="../src/scopeguard/lib.rs.html#348-361" title="goto source code">[src]</a></div></summary><div class="docblock"><p>“Defuse” the guard and extract the value without calling the closure.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">scopeguard</span>;
<span class="kw">use</span> <span class="ident">scopeguard</span>::{<span class="ident">guard</span>, <span class="ident">ScopeGuard</span>};
<span class="kw">fn</span> <span class="ident">conditional</span>() <span class="op">-</span><span class="op">&gt;</span> <span class="ident">bool</span> { <span class="bool-val">true</span> }
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">guard</span> <span class="op">=</span> <span class="ident">guard</span>(<span class="ident">Vec::new</span>(), <span class="op">|</span><span class="kw-2">mut</span> <span class="ident">v</span><span class="op">|</span> <span class="ident">v</span>.<span class="ident">clear</span>());
<span class="ident">guard</span>.<span class="ident">push</span>(<span class="number">1</span>);
<span class="kw">if</span> <span class="ident">conditional</span>() {
<span class="comment">// a condition maybe makes us decide to</span>
<span class="comment">// “defuse” the guard and get back its inner parts</span>
<span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="ident">ScopeGuard::into_inner</span>(<span class="ident">guard</span>);
} <span class="kw">else</span> {
<span class="comment">// guard still exists in this branch</span>
}
}</pre></div>
</div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Debug" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, F, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.ScopeGuard.html" title="struct scopeguard::ScopeGuard">ScopeGuard</a>&lt;T, F, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(T),<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="trait.Strategy.html" title="trait scopeguard::Strategy">Strategy</a>,&nbsp;</span></h3><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/scopeguard/lib.rs.html#464-474" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.54.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4><a href="#method.fmt" class="anchor"></a><a class="srclink" href="../src/scopeguard/lib.rs.html#469-473" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Deref" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, F, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="struct.ScopeGuard.html" title="struct scopeguard::ScopeGuard">ScopeGuard</a>&lt;T, F, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(T),<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="trait.Strategy.html" title="trait scopeguard::Strategy">Strategy</a>,&nbsp;</span></h3><a href="#impl-Deref" class="anchor"></a><a class="srclink" href="../src/scopeguard/lib.rs.html#428-437" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Target" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html#associatedtype.Target" class="type">Target</a> = T</h4><a href="#associatedtype.Target" class="anchor"></a></div></summary><div class='docblock'><p>The resulting type after dereferencing.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.deref" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.deref" class="anchor"></a><a class="srclink" href="../src/scopeguard/lib.rs.html#434-436" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Dereferences the value.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-DerefMut" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, F, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.DerefMut.html" title="trait core::ops::deref::DerefMut">DerefMut</a> for <a class="struct" href="struct.ScopeGuard.html" title="struct scopeguard::ScopeGuard">ScopeGuard</a>&lt;T, F, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(T),<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="trait.Strategy.html" title="trait scopeguard::Strategy">Strategy</a>,&nbsp;</span></h3><a href="#impl-DerefMut" class="anchor"></a><a class="srclink" href="../src/scopeguard/lib.rs.html#439-446" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.deref_mut" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.DerefMut.html#tymethod.deref_mut" class="fnname">deref_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4><a href="#method.deref_mut" class="anchor"></a><a class="srclink" href="../src/scopeguard/lib.rs.html#443-445" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Mutably dereferences the value.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Drop" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, F, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="struct.ScopeGuard.html" title="struct scopeguard::ScopeGuard">ScopeGuard</a>&lt;T, F, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(T),<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="trait.Strategy.html" title="trait scopeguard::Strategy">Strategy</a>,&nbsp;</span></h3><a href="#impl-Drop" class="anchor"></a><a class="srclink" href="../src/scopeguard/lib.rs.html#448-462" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.drop" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/ops/drop/trait.Drop.html#tymethod.drop" class="fnname">drop</a>(&amp;mut self)</h4><a href="#method.drop" class="anchor"></a><a class="srclink" href="../src/scopeguard/lib.rs.html#452-461" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/1.54.0/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
</div></details></div></details><div id="impl-Sync" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, F, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.ScopeGuard.html" title="struct scopeguard::ScopeGuard">ScopeGuard</a>&lt;T, F, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(T),<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="trait.Strategy.html" title="trait scopeguard::Strategy">Strategy</a>,&nbsp;</span></h3><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../src/scopeguard/lib.rs.html#422-426" title="goto source code">[src]</a></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-Send" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, F, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.ScopeGuard.html" title="struct scopeguard::ScopeGuard">ScopeGuard</a>&lt;T, F, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,&nbsp;</span></h3><a href="#impl-Send" class="anchor"></a></div><div id="impl-Unpin" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, F, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.ScopeGuard.html" title="struct scopeguard::ScopeGuard">ScopeGuard</a>&lt;T, F, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></h3><a href="#impl-Unpin" class="anchor"></a></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Any" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#131-135" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4><a href="#method.type_id" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#132" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.borrow" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4><a href="#method.borrow_mut" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#217" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#544-548" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</h4><a href="#method.from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#545" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#533-540" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</h4><a href="#method.into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#537" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#581-590" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4><a href="#associatedtype.Error" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#587" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#567-576" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4><a href="#associatedtype.Error-1" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#573" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="scopeguard" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

View File

@ -0,0 +1,8 @@
<!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="Controls in which cases the associated code should be run"><meta name="keywords" content="rust, rustlang, rust-lang, Strategy"><title>Strategy in scopeguard - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../scopeguard/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait Strategy</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.should_run">should_run</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="index.html">scopeguard</a></h2><div id="sidebar-vars" data-name="Strategy" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">scopeguard</a>::<wbr><a class="trait" href="#">Strategy</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/scopeguard/lib.rs.html#201-205" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait">pub trait Strategy {
fn <a href="#tymethod.should_run" class="fnname">should_run</a>() -&gt; bool;
}</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Controls in which cases the associated code should be run</p>
</div></details><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.should_run" class="method has-srclink"><h4 class="code-header">fn <a href="#tymethod.should_run" class="fnname">should_run</a>() -&gt; bool</h4><a class="srclink" href="../src/scopeguard/lib.rs.html#204" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Return <code>true</code> if the guards associated code should run
(in the context where this method is called).</p>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Strategy" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="trait.Strategy.html" title="trait scopeguard::Strategy">Strategy</a> for <a class="enum" href="enum.Always.html" title="enum scopeguard::Always">Always</a></h3><a href="#impl-Strategy" class="anchor"></a><a class="srclink" href="../src/scopeguard/lib.rs.html#229-232" title="goto source code">[src]</a></div></summary><div class="impl-items"><div id="method.should_run" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="#tymethod.should_run" class="fnname">should_run</a>() -&gt; bool</h4><a href="#method.should_run" class="anchor"></a><a class="srclink" href="../src/scopeguard/lib.rs.html#231" title="goto source code">[src]</a></div></div></details></div><script type="text/javascript" src="../implementors/scopeguard/trait.Strategy.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="scopeguard" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

File diff suppressed because one or more lines are too long

View File

@ -2,5 +2,8 @@ var N = null;var sourcesIndex = {};
sourcesIndex["byteorder"] = {"name":"","files":["lib.rs"]};
sourcesIndex["hash32"] = {"name":"","files":["fnv.rs","lib.rs","murmur3.rs"]};
sourcesIndex["heapless"] = {"name":"","dirs":[{"name":"pool","files":["cas.rs","mod.rs","singleton.rs"]}],"files":["binary_heap.rs","deque.rs","histbuf.rs","indexmap.rs","indexset.rs","lib.rs","linear_map.rs","mpmc.rs","sealed.rs","sorted_linked_list.rs","spsc.rs","string.rs","vec.rs"]};
sourcesIndex["lock_api"] = {"name":"","files":["lib.rs","mutex.rs","remutex.rs","rwlock.rs"]};
sourcesIndex["scopeguard"] = {"name":"","files":["lib.rs"]};
sourcesIndex["spin"] = {"name":"","dirs":[{"name":"mutex","files":["spin.rs"]}],"files":["barrier.rs","lazy.rs","lib.rs","mutex.rs","once.rs","relax.rs","rwlock.rs"]};
sourcesIndex["stable_deref_trait"] = {"name":"","files":["lib.rs"]};
createSourceSidebar();

5
spin/all.html Normal file
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="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../spin/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Crate spin</h2><div class="block version"><p>Version 0.9.2</p></div><a id="all-types" href="index.html"><p>Back to index</p></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">List of all items</span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span>
</span>
</h1><h3 id="Structs">Structs</h3><ul class="structs docblock"><li><a href="barrier/struct.Barrier.html">barrier::Barrier</a></li><li><a href="barrier/struct.BarrierWaitResult.html">barrier::BarrierWaitResult</a></li><li><a href="lazy/struct.Lazy.html">lazy::Lazy</a></li><li><a href="mutex/struct.Mutex.html">mutex::Mutex</a></li><li><a href="mutex/struct.MutexGuard.html">mutex::MutexGuard</a></li><li><a href="mutex/spin/struct.SpinMutex.html">mutex::spin::SpinMutex</a></li><li><a href="mutex/spin/struct.SpinMutexGuard.html">mutex::spin::SpinMutexGuard</a></li><li><a href="once/struct.Once.html">once::Once</a></li><li><a href="relax/struct.Loop.html">relax::Loop</a></li><li><a href="relax/struct.Spin.html">relax::Spin</a></li><li><a href="rwlock/struct.RwLock.html">rwlock::RwLock</a></li><li><a href="rwlock/struct.RwLockReadGuard.html">rwlock::RwLockReadGuard</a></li><li><a href="rwlock/struct.RwLockUpgradableGuard.html">rwlock::RwLockUpgradableGuard</a></li><li><a href="rwlock/struct.RwLockWriteGuard.html">rwlock::RwLockWriteGuard</a></li></ul><h3 id="Traits">Traits</h3><ul class="traits docblock"><li><a href="relax/trait.RelaxStrategy.html">relax::RelaxStrategy</a></li></ul><h3 id="Typedefs">Typedefs</h3><ul class="typedefs docblock"><li><a href="type.Barrier.html">Barrier</a></li><li><a href="type.Lazy.html">Lazy</a></li><li><a href="type.Mutex.html">Mutex</a></li><li><a href="type.Once.html">Once</a></li><li><a href="type.RwLock.html">RwLock</a></li><li><a href="type.RwLockUpgradableGuard.html">RwLockUpgradableGuard</a></li><li><a href="type.RwLockWriteGuard.html">RwLockWriteGuard</a></li><li><a href="lock_api/type.Mutex.html">lock_api::Mutex</a></li><li><a href="lock_api/type.MutexGuard.html">lock_api::MutexGuard</a></li><li><a href="lock_api/type.RwLock.html">lock_api::RwLock</a></li><li><a href="lock_api/type.RwLockReadGuard.html">lock_api::RwLockReadGuard</a></li><li><a href="lock_api/type.RwLockUpgradableReadGuard.html">lock_api::RwLockUpgradableReadGuard</a></li><li><a href="lock_api/type.RwLockWriteGuard.html">lock_api::RwLockWriteGuard</a></li></ul></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="spin" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

19
spin/barrier/index.html Normal file
View File

@ -0,0 +1,19 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Synchronization primitive allowing multiple threads to synchronize the beginning of some computation."><meta name="keywords" content="rust, rustlang, rust-lang, barrier"><title>spin::barrier - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../spin/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module barrier</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><div id="sidebar-vars" data-name="barrier" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img src="../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">spin</a>::<wbr><a class="mod" href="#">barrier</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/spin/barrier.rs.html#1-233" title="goto source code">[src]</a></span></h1><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Synchronization primitive allowing multiple threads to synchronize the
beginning of some computation.</p>
<p>Implementation adapted from the Barrier type of the standard library. See:
<a href="https://doc.rust-lang.org/std/sync/struct.Barrier.html">https://doc.rust-lang.org/std/sync/struct.Barrier.html</a></p>
<p>Copyright 2014 The Rust Project Developers. See the COPYRIGHT
file at the top-level directory of this distribution and at
<a href="http://rust-lang.org/COPYRIGHT">http://rust-lang.org/COPYRIGHT</a>.</p>
<p>Licensed under the Apache License, Version 2.0 &lt;LICENSE-APACHE or
<a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>&gt; or the MIT license
&lt;LICENSE-MIT or <a href="http://opensource.org/licenses/MIT">http://opensource.org/licenses/MIT</a>&gt;, at your
option. This file may not be copied, modified, or distributed
except according to those terms.</p>
</div></details><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.Barrier.html" title="spin::barrier::Barrier struct">Barrier</a></td><td class="docblock-short"><p>A primitive that synchronizes the execution of multiple threads.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.BarrierWaitResult.html" title="spin::barrier::BarrierWaitResult struct">BarrierWaitResult</a></td><td class="docblock-short"><p>A <code>BarrierWaitResult</code> is returned by <a href="struct.Barrier.html#method.wait"><code>wait</code></a> when all threads in the <a href="struct.Barrier.html"><code>Barrier</code></a>
have rendezvoused.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="spin" data-search-index-js="../../search-index.js" data-search-js="../../search.js"></div><script src="../../main.js"></script></body></html>

View File

@ -0,0 +1 @@
initSidebarItems({"struct":[["Barrier","A primitive that synchronizes the execution of multiple threads."],["BarrierWaitResult","A `BarrierWaitResult` is returned by `wait` when all threads in the `Barrier` have rendezvoused."]]});

View File

@ -0,0 +1,73 @@
<!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 primitive that synchronizes the execution of multiple threads."><meta name="keywords" content="rust, rustlang, rust-lang, Barrier"><title>Barrier in spin::barrier - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../spin/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><h2 class="location">Struct Barrier</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.new">new</a><a href="#method.wait">wait</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><h2 class="location">Other items in<br><a href="../index.html">spin</a>::<wbr><a href="index.html">barrier</a></h2><div id="sidebar-vars" data-name="Barrier" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img src="../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="../index.html">spin</a>::<wbr><a href="index.html">barrier</a>::<wbr><a class="struct" href="#">Barrier</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/spin/barrier.rs.html#45-48" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust struct">pub struct Barrier&lt;R&nbsp;=&nbsp;<a class="struct" href="../relax/struct.Spin.html" title="struct spin::relax::Spin">Spin</a>&gt; { /* fields omitted */ }</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A primitive that synchronizes the execution of multiple threads.</p>
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">spin</span>;
<span class="kw">use</span> <span class="ident">std::sync::Arc</span>;
<span class="kw">use</span> <span class="ident">std::thread</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">handles</span> <span class="op">=</span> <span class="ident">Vec::with_capacity</span>(<span class="number">10</span>);
<span class="kw">let</span> <span class="ident">barrier</span> <span class="op">=</span> <span class="ident">Arc::new</span>(<span class="ident">spin::Barrier::new</span>(<span class="number">10</span>));
<span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="number">10</span> {
<span class="kw">let</span> <span class="ident">c</span> <span class="op">=</span> <span class="ident">barrier</span>.<span class="ident">clone</span>();
<span class="comment">// The same messages will be printed together.</span>
<span class="comment">// You will NOT see any interleaving.</span>
<span class="ident">handles</span>.<span class="ident">push</span>(<span class="ident">thread::spawn</span>(<span class="kw">move</span><span class="op">|</span><span class="op">|</span> {
<span class="macro">println!</span>(<span class="string">&quot;before wait&quot;</span>);
<span class="ident">c</span>.<span class="ident">wait</span>();
<span class="macro">println!</span>(<span class="string">&quot;after wait&quot;</span>);
}));
}
<span class="comment">// Wait for other threads to finish.</span>
<span class="kw">for</span> <span class="ident">handle</span> <span class="kw">in</span> <span class="ident">handles</span> {
<span class="ident">handle</span>.<span class="ident">join</span>().<span class="ident">unwrap</span>();
}</pre></div>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R:&nbsp;<a class="trait" href="../relax/trait.RelaxStrategy.html" title="trait spin::relax::RelaxStrategy">RelaxStrategy</a>&gt; <a class="struct" href="struct.Barrier.html" title="struct spin::barrier::Barrier">Barrier</a>&lt;R&gt;</h3><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/spin/barrier.rs.html#72-133" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.wait" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.wait" class="fnname">wait</a>(&amp;self) -&gt; <a class="struct" href="struct.BarrierWaitResult.html" title="struct spin::barrier::BarrierWaitResult">BarrierWaitResult</a></h4><a href="#method.wait" class="anchor"></a><a class="srclink" href="../../src/spin/barrier.rs.html#110-132" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Blocks the current thread until all threads have rendezvoused here.</p>
<p>Barriers are re-usable after all threads have rendezvoused once, and can
be used continuously.</p>
<p>A single (arbitrary) thread will receive a <a href="struct.BarrierWaitResult.html"><code>BarrierWaitResult</code></a> that
returns <code>true</code> from <a href="struct.BarrierWaitResult.html#method.is_leader"><code>is_leader</code></a> when returning from this function, and
all other threads will receive a result that will return <code>false</code> from
<a href="struct.BarrierWaitResult.html#method.is_leader"><code>is_leader</code></a>.</p>
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">spin</span>;
<span class="kw">use</span> <span class="ident">std::sync::Arc</span>;
<span class="kw">use</span> <span class="ident">std::thread</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">handles</span> <span class="op">=</span> <span class="ident">Vec::with_capacity</span>(<span class="number">10</span>);
<span class="kw">let</span> <span class="ident">barrier</span> <span class="op">=</span> <span class="ident">Arc::new</span>(<span class="ident">spin::Barrier::new</span>(<span class="number">10</span>));
<span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="number">10</span> {
<span class="kw">let</span> <span class="ident">c</span> <span class="op">=</span> <span class="ident">barrier</span>.<span class="ident">clone</span>();
<span class="comment">// The same messages will be printed together.</span>
<span class="comment">// You will NOT see any interleaving.</span>
<span class="ident">handles</span>.<span class="ident">push</span>(<span class="ident">thread::spawn</span>(<span class="kw">move</span><span class="op">|</span><span class="op">|</span> {
<span class="macro">println!</span>(<span class="string">&quot;before wait&quot;</span>);
<span class="ident">c</span>.<span class="ident">wait</span>();
<span class="macro">println!</span>(<span class="string">&quot;after wait&quot;</span>);
}));
}
<span class="comment">// Wait for other threads to finish.</span>
<span class="kw">for</span> <span class="ident">handle</span> <span class="kw">in</span> <span class="ident">handles</span> {
<span class="ident">handle</span>.<span class="ident">join</span>().<span class="ident">unwrap</span>();
}</pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-1" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R&gt; <a class="struct" href="struct.Barrier.html" title="struct spin::barrier::Barrier">Barrier</a>&lt;R&gt;</h3><a href="#impl-1" class="anchor"></a><a class="srclink" href="../../src/spin/barrier.rs.html#135-160" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.new" class="method has-srclink"><h4 class="code-header">pub const fn <a href="#method.new" class="fnname">new</a>(n: usize) -&gt; Self</h4><a href="#method.new" class="anchor"></a><a class="srclink" href="../../src/spin/barrier.rs.html#151-159" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Creates a new barrier that can block a given number of threads.</p>
<p>A barrier will block <code>n</code>-1 threads which call <a href="#method.wait"><code>wait</code></a> and then wake up
all threads at once when the <code>n</code>th thread calls <a href="#method.wait"><code>wait</code></a>. A Barrier created
with n = 0 will behave identically to one created with n = 1.</p>
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">spin</span>;
<span class="kw">let</span> <span class="ident">barrier</span> <span class="op">=</span> <span class="ident">spin::Barrier::new</span>(<span class="number">10</span>);</pre></div>
</div></details></div></details><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-Send" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Barrier.html" title="struct spin::barrier::Barrier">Barrier</a>&lt;R&gt;</h3><a href="#impl-Send" class="anchor"></a></div><div id="impl-Sync" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Barrier.html" title="struct spin::barrier::Barrier">Barrier</a>&lt;R&gt;</h3><a href="#impl-Sync" class="anchor"></a></div><div id="impl-Unpin" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;R&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Barrier.html" title="struct spin::barrier::Barrier">Barrier</a>&lt;R&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></h3><a href="#impl-Unpin" class="anchor"></a></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Any" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#131-135" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4><a href="#method.type_id" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#132" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.borrow" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4><a href="#method.borrow_mut" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#217" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#544-548" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</h4><a href="#method.from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#545" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#533-540" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</h4><a href="#method.into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#537" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#581-590" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4><a href="#associatedtype.Error" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#587" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#567-576" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4><a href="#associatedtype.Error-1" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#573" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="spin" data-search-index-js="../../search-index.js" data-search-js="../../search.js"></div><script src="../../main.js"></script></body></html>

View File

@ -0,0 +1,30 @@
<!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 `BarrierWaitResult` is returned by `wait` when all threads in the `Barrier` have rendezvoused."><meta name="keywords" content="rust, rustlang, rust-lang, BarrierWaitResult"><title>BarrierWaitResult in spin::barrier - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../spin/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><h2 class="location">Struct BarrierWaitResult</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.is_leader">is_leader</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><h2 class="location">Other items in<br><a href="../index.html">spin</a>::<wbr><a href="index.html">barrier</a></h2><div id="sidebar-vars" data-name="BarrierWaitResult" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img src="../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="../index.html">spin</a>::<wbr><a href="index.html">barrier</a>::<wbr><a class="struct" href="#">BarrierWaitResult</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/spin/barrier.rs.html#70" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust struct">pub struct BarrierWaitResult(_);</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A <code>BarrierWaitResult</code> is returned by <a href="struct.Barrier.html#method.wait"><code>wait</code></a> when all threads in the <a href="struct.Barrier.html"><code>Barrier</code></a>
have rendezvoused.</p>
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">spin</span>;
<span class="kw">let</span> <span class="ident">barrier</span> <span class="op">=</span> <span class="ident">spin::Barrier::new</span>(<span class="number">1</span>);
<span class="kw">let</span> <span class="ident">barrier_wait_result</span> <span class="op">=</span> <span class="ident">barrier</span>.<span class="ident">wait</span>();</pre></div>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="struct" href="struct.BarrierWaitResult.html" title="struct spin::barrier::BarrierWaitResult">BarrierWaitResult</a></h3><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/spin/barrier.rs.html#162-180" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.is_leader" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.is_leader" class="fnname">is_leader</a>(&amp;self) -&gt; bool</h4><a href="#method.is_leader" class="anchor"></a><a class="srclink" href="../../src/spin/barrier.rs.html#179" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Returns whether this thread from <a href="struct.Barrier.html#method.wait"><code>wait</code></a> is the “leader thread”.</p>
<p>Only one thread will have <code>true</code> returned from their result, all other
threads will have <code>false</code> returned.</p>
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">spin</span>;
<span class="kw">let</span> <span class="ident">barrier</span> <span class="op">=</span> <span class="ident">spin::Barrier::new</span>(<span class="number">1</span>);
<span class="kw">let</span> <span class="ident">barrier_wait_result</span> <span class="op">=</span> <span class="ident">barrier</span>.<span class="ident">wait</span>();
<span class="macro">println!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">barrier_wait_result</span>.<span class="ident">is_leader</span>());</pre></div>
</div></details></div></details><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-Send" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.BarrierWaitResult.html" title="struct spin::barrier::BarrierWaitResult">BarrierWaitResult</a></h3><a href="#impl-Send" class="anchor"></a></div><div id="impl-Sync" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.BarrierWaitResult.html" title="struct spin::barrier::BarrierWaitResult">BarrierWaitResult</a></h3><a href="#impl-Sync" class="anchor"></a></div><div id="impl-Unpin" class="impl has-srclink"><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.BarrierWaitResult.html" title="struct spin::barrier::BarrierWaitResult">BarrierWaitResult</a></h3><a href="#impl-Unpin" class="anchor"></a></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Any" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#131-135" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4><a href="#method.type_id" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#132" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.borrow" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4><a href="#method.borrow_mut" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#217" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#544-548" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</h4><a href="#method.from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#545" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#533-540" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</h4><a href="#method.into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#537" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#581-590" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4><a href="#associatedtype.Error" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#587" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#567-576" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4><a href="#associatedtype.Error-1" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#573" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="spin" data-search-index-js="../../search-index.js" data-search-js="../../search.js"></div><script src="../../main.js"></script></body></html>

92
spin/index.html Normal file
View File

@ -0,0 +1,92 @@
<!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 crate provides spin-based versions of the primitives in `std::sync` and `std::lazy`. Because synchronization is done through spinning, the primitives are suitable for use in `no_std` environments."><meta name="keywords" content="rust, rustlang, rust-lang, spin"><title>spin - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../spin/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Crate spin</h2><div class="block version"><p>Version 0.9.2</p></div><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all spin's items</p></a><div class="block items"><ul><li><a href="#modules">Modules</a></li><li><a href="#types">Type Definitions</a></li></ul></div><div id="sidebar-vars" data-name="spin" data-ty="mod" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">spin</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/spin/lib.rs.html#1-186" title="goto source code">[src]</a></span></h1><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This crate provides <a href="https://en.wikipedia.org/wiki/Spinlock">spin-based</a> versions of the
primitives in <code>std::sync</code> and <code>std::lazy</code>. Because synchronization is done through spinning,
the primitives are suitable for use in <code>no_std</code> environments.</p>
<h1 id="features" class="section-header"><a href="#features">Features</a></h1>
<ul>
<li>
<p><code>Mutex</code>, <code>RwLock</code>, <code>Once</code>/<code>SyncOnceCell</code>, and <code>SyncLazy</code> equivalents</p>
</li>
<li>
<p>Support for <code>no_std</code> environments</p>
</li>
<li>
<p><a href="https://crates.io/crates/lock_api"><code>lock_api</code></a> compatibility</p>
</li>
<li>
<p>Upgradeable <code>RwLock</code> guards</p>
</li>
<li>
<p>Guards can be sent and shared between threads</p>
</li>
<li>
<p>Guard leaking</p>
</li>
<li>
<p>Ticket locks</p>
</li>
<li>
<p>Different strategies for dealing with contention</p>
</li>
</ul>
<h1 id="relationship-with-stdsync" class="section-header"><a href="#relationship-with-stdsync">Relationship with <code>std::sync</code></a></h1>
<p>While <code>spin</code> is not a drop-in replacement for <code>std::sync</code> (and
<a href="https://matklad.github.io/2020/01/02/spinlocks-considered-harmful.html">should not be considered as such</a>)
an effort is made to keep this crate reasonably consistent with <code>std::sync</code>.</p>
<p>Many of the types defined in this crate have additional capabilities when compared to <code>std::sync</code>:</p>
<ul>
<li>
<p>Because spinning does not depend on the thread-driven model of <code>std::sync</code>, guards (<a href="mutex/struct.MutexGuard.html" title="MutexGuard"><code>MutexGuard</code></a>,
<a href="rwlock/struct.RwLockReadGuard.html" title="RwLockReadGuard"><code>RwLockReadGuard</code></a>, <a href="type.RwLockWriteGuard.html" title="RwLockWriteGuard"><code>RwLockWriteGuard</code></a>, etc.) may be sent and shared between threads.</p>
</li>
<li>
<p><a href="type.RwLockUpgradableGuard.html" title="RwLockUpgradableGuard"><code>RwLockUpgradableGuard</code></a> supports being upgraded into a <a href="type.RwLockWriteGuard.html" title="RwLockWriteGuard"><code>RwLockWriteGuard</code></a>.</p>
</li>
<li>
<p>Guards support <a href="https://doc.rust-lang.org/nomicon/leaking.html">leaking</a>.</p>
</li>
<li>
<p><a href="type.Once.html" title="Once"><code>Once</code></a> owns the value returned by its <code>call_once</code> initializer.</p>
</li>
<li>
<p><a href="type.RwLock.html" title="RwLock"><code>RwLock</code></a> supports counting readers and writers.</p>
</li>
</ul>
<p>Conversely, the types in this crate do not have some of the features <code>std::sync</code> has:</p>
<ul>
<li>Locks do not track <a href="https://doc.rust-lang.org/nomicon/poisoning.html">panic poisoning</a>.</li>
</ul>
<h2 id="feature-flags" class="section-header"><a href="#feature-flags">Feature flags</a></h2>
<p>The crate comes with a few feature flags that you may wish to use.</p>
<ul>
<li>
<p><code>lock_api</code> enables support for <a href="https://crates.io/crates/lock_api"><code>lock_api</code></a></p>
</li>
<li>
<p><code>ticket_mutex</code> uses a ticket lock for the implementation of <code>Mutex</code></p>
</li>
<li>
<p><code>std</code> enables support for thread yielding instead of spinning</p>
</li>
</ul>
</div></details><h2 id="reexports" class="section-header"><a href="#reexports">Re-exports</a></h2>
<table><tr class="import-item"><td><code>pub use mutex::<a class="struct" href="mutex/struct.MutexGuard.html" title="struct spin::mutex::MutexGuard">MutexGuard</a>;</code></td><td class="docblock-short"></td></tr><tr class="import-item"><td><code>pub use rwlock::<a class="struct" href="rwlock/struct.RwLockReadGuard.html" title="struct spin::rwlock::RwLockReadGuard">RwLockReadGuard</a>;</code></td><td class="docblock-short"></td></tr><tr class="import-item"><td><code>pub use relax::<a class="struct" href="relax/struct.Spin.html" title="struct spin::relax::Spin">Spin</a>;</code></td><td class="docblock-short"></td></tr><tr class="import-item"><td><code>pub use relax::<a class="trait" href="relax/trait.RelaxStrategy.html" title="trait spin::relax::RelaxStrategy">RelaxStrategy</a>;</code></td><td class="docblock-short"></td></tr></table><h2 id="modules" class="section-header"><a href="#modules">Modules</a></h2>
<table><tr class="module-item"><td><a class="mod" href="barrier/index.html" title="spin::barrier mod">barrier</a></td><td class="docblock-short"><p>Synchronization primitive allowing multiple threads to synchronize the
beginning of some computation.</p>
</td></tr><tr class="module-item"><td><a class="mod" href="lazy/index.html" title="spin::lazy mod">lazy</a></td><td class="docblock-short"><p>Synchronization primitives for lazy evaluation.</p>
</td></tr><tr class="module-item"><td><a class="mod" href="lock_api/index.html" title="spin::lock_api mod">lock_api</a></td><td class="docblock-short"><p>Spin synchronisation primitives, but compatible with <a href="https://crates.io/crates/lock_api"><code>lock_api</code></a>.</p>
</td></tr><tr class="module-item"><td><a class="mod" href="mutex/index.html" title="spin::mutex mod">mutex</a></td><td class="docblock-short"><p>Locks that have the same behaviour as a mutex.</p>
</td></tr><tr class="module-item"><td><a class="mod" href="once/index.html" title="spin::once mod">once</a></td><td class="docblock-short"><p>Synchronization primitives for one-time evaluation.</p>
</td></tr><tr class="module-item"><td><a class="mod" href="relax/index.html" title="spin::relax mod">relax</a></td><td class="docblock-short"><p>Strategies that determine the behaviour of locks when encountering contention.</p>
</td></tr><tr class="module-item"><td><a class="mod" href="rwlock/index.html" title="spin::rwlock mod">rwlock</a></td><td class="docblock-short"><p>A lock that provides data access to either one writer or many readers.</p>
</td></tr></table><h2 id="types" class="section-header"><a href="#types">Type Definitions</a></h2>
<table><tr class="module-item"><td><a class="type" href="type.Barrier.html" title="spin::Barrier type">Barrier</a></td><td class="docblock-short"><p>A primitive that synchronizes the execution of multiple threads. See <a href="barrier/struct.Barrier.html" title="barrier::Barrier"><code>barrier::Barrier</code></a> for documentation.</p>
</td></tr><tr class="module-item"><td><a class="type" href="type.Lazy.html" title="spin::Lazy type">Lazy</a></td><td class="docblock-short"><p>A value which is initialized on the first access. See <a href="lazy/struct.Lazy.html" title="lazy::Lazy"><code>lazy::Lazy</code></a> for documentation.</p>
</td></tr><tr class="module-item"><td><a class="type" href="type.Mutex.html" title="spin::Mutex type">Mutex</a></td><td class="docblock-short"><p>A primitive that synchronizes the execution of multiple threads. See <a href="mutex/struct.Mutex.html" title="mutex::Mutex"><code>mutex::Mutex</code></a> for documentation.</p>
</td></tr><tr class="module-item"><td><a class="type" href="type.Once.html" title="spin::Once type">Once</a></td><td class="docblock-short"><p>A primitive that provides lazy one-time initialization. See <a href="once/struct.Once.html" title="once::Once"><code>once::Once</code></a> for documentation.</p>
</td></tr><tr class="module-item"><td><a class="type" href="type.RwLock.html" title="spin::RwLock type">RwLock</a></td><td class="docblock-short"><p>A lock that provides data access to either one writer or many readers. See <a href="rwlock/struct.RwLock.html" title="rwlock::RwLock"><code>rwlock::RwLock</code></a> for documentation.</p>
</td></tr><tr class="module-item"><td><a class="type" href="type.RwLockUpgradableGuard.html" title="spin::RwLockUpgradableGuard type">RwLockUpgradableGuard</a></td><td class="docblock-short"><p>A guard that provides immutable data access but can be upgraded to <a href="type.RwLockWriteGuard.html" title="RwLockWriteGuard"><code>RwLockWriteGuard</code></a>. See
<a href="rwlock/struct.RwLockUpgradableGuard.html" title="rwlock::RwLockUpgradableGuard"><code>rwlock::RwLockUpgradableGuard</code></a> for documentation.</p>
</td></tr><tr class="module-item"><td><a class="type" href="type.RwLockWriteGuard.html" title="spin::RwLockWriteGuard type">RwLockWriteGuard</a></td><td class="docblock-short"><p>A guard that provides mutable data access. See <a href="rwlock/struct.RwLockWriteGuard.html" title="rwlock::RwLockWriteGuard"><code>rwlock::RwLockWriteGuard</code></a> for documentation.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="spin" data-search-index-js="../search-index.js" data-search-js="../search.js"></div><script src="../main.js"></script></body></html>

8
spin/lazy/index.html Normal file
View File

@ -0,0 +1,8 @@
<!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="Synchronization primitives for lazy evaluation."><meta name="keywords" content="rust, rustlang, rust-lang, lazy"><title>spin::lazy - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../spin/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module lazy</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><div id="sidebar-vars" data-name="lazy" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img src="../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">spin</a>::<wbr><a class="mod" href="#">lazy</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/spin/lazy.rs.html#1-112" title="goto source code">[src]</a></span></h1><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Synchronization primitives for lazy evaluation.</p>
<p>Implementation adapted from the <code>SyncLazy</code> type of the standard library. See:
<a href="https://doc.rust-lang.org/std/lazy/struct.SyncLazy.html">https://doc.rust-lang.org/std/lazy/struct.SyncLazy.html</a></p>
</div></details><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.Lazy.html" title="spin::lazy::Lazy struct">Lazy</a></td><td class="docblock-short"><p>A value which is initialized on the first access.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="spin" data-search-index-js="../../search-index.js" data-search-js="../../search.js"></div><script src="../../main.js"></script></body></html>

View File

@ -0,0 +1 @@
initSidebarItems({"struct":[["Lazy","A value which is initialized on the first access."]]});

View File

@ -0,0 +1,61 @@
<!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 value which is initialized on the first access."><meta name="keywords" content="rust, rustlang, rust-lang, Lazy"><title>Lazy in spin::lazy - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../spin/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><h2 class="location">Struct Lazy</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.as_mut_ptr">as_mut_ptr</a><a href="#method.force">force</a><a href="#method.new">new</a></div><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Deref">Deref</a><a href="#impl-Sync">Sync</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">!Sync</a><a href="#impl-Unpin">Unpin</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><h2 class="location">Other items in<br><a href="../index.html">spin</a>::<wbr><a href="index.html">lazy</a></h2><div id="sidebar-vars" data-name="Lazy" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img src="../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="../index.html">spin</a>::<wbr><a href="index.html">lazy</a>::<wbr><a class="struct" href="#">Lazy</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/spin/lazy.rs.html#41-44" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust struct">pub struct Lazy&lt;T, F&nbsp;=&nbsp;fn() -&gt; T, R&nbsp;=&nbsp;<a class="struct" href="../relax/struct.Spin.html" title="struct spin::relax::Spin">Spin</a>&gt; { /* fields omitted */ }</pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A value which is initialized on the first access.</p>
<p>This type is a thread-safe <code>Lazy</code>, and can be used in statics.</p>
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std::collections::HashMap</span>;
<span class="kw">use</span> <span class="ident">spin::Lazy</span>;
<span class="kw">static</span> <span class="ident">HASHMAP</span>: <span class="ident">Lazy</span><span class="op">&lt;</span><span class="ident">HashMap</span><span class="op">&lt;</span><span class="ident">i32</span>, <span class="ident">String</span><span class="op">&gt;</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">Lazy::new</span>(<span class="op">|</span><span class="op">|</span> {
<span class="macro">println!</span>(<span class="string">&quot;initializing&quot;</span>);
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">m</span> <span class="op">=</span> <span class="ident">HashMap::new</span>();
<span class="ident">m</span>.<span class="ident">insert</span>(<span class="number">13</span>, <span class="string">&quot;Spica&quot;</span>.<span class="ident">to_string</span>());
<span class="ident">m</span>.<span class="ident">insert</span>(<span class="number">74</span>, <span class="string">&quot;Hoyten&quot;</span>.<span class="ident">to_string</span>());
<span class="ident">m</span>
});
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="macro">println!</span>(<span class="string">&quot;ready&quot;</span>);
<span class="ident">std::thread::spawn</span>(<span class="op">|</span><span class="op">|</span> {
<span class="macro">println!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">HASHMAP</span>.<span class="ident">get</span>(<span class="kw-2">&amp;</span><span class="number">13</span>));
}).<span class="ident">join</span>().<span class="ident">unwrap</span>();
<span class="macro">println!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">HASHMAP</span>.<span class="ident">get</span>(<span class="kw-2">&amp;</span><span class="number">74</span>));
<span class="comment">// Prints:</span>
<span class="comment">// ready</span>
<span class="comment">// initializing</span>
<span class="comment">// Some(&quot;Spica&quot;)</span>
<span class="comment">// Some(&quot;Hoyten&quot;)</span>
}</pre></div>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, F, R&gt; <a class="struct" href="struct.Lazy.html" title="struct spin::lazy::Lazy">Lazy</a>&lt;T, F, R&gt;</h3><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/spin/lazy.rs.html#60-74" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.new" class="method has-srclink"><h4 class="code-header">pub const fn <a href="#method.new" class="fnname">new</a>(f: F) -&gt; Self</h4><a href="#method.new" class="anchor"></a><a class="srclink" href="../../src/spin/lazy.rs.html#63-65" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Creates a new lazy value with the given initializing
function.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.as_mut_ptr" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.as_mut_ptr" class="fnname">as_mut_ptr</a>(&amp;self) -&gt; *mut T</h4><a href="#method.as_mut_ptr" class="anchor"></a><a class="srclink" href="../../src/spin/lazy.rs.html#71-73" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Retrieves a mutable pointer to the inner data.</p>
<p>This is especially useful when interfacing with low level code or FFI where the caller
explicitly knows that it has exclusive access to the inner data. Note that reading from
this pointer is UB until initialized or directly written to.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-1" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, F:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -&gt; T, R:&nbsp;<a class="trait" href="../relax/trait.RelaxStrategy.html" title="trait spin::relax::RelaxStrategy">RelaxStrategy</a>&gt; <a class="struct" href="struct.Lazy.html" title="struct spin::lazy::Lazy">Lazy</a>&lt;T, F, R&gt;</h3><a href="#impl-1" class="anchor"></a><a class="srclink" href="../../src/spin/lazy.rs.html#76-97" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.force" class="method has-srclink"><h4 class="code-header">pub fn <a href="#method.force" class="fnname">force</a>(this: &amp;Self) -&gt; &amp;T</h4><a href="#method.force" class="anchor"></a><a class="srclink" href="../../src/spin/lazy.rs.html#91-96" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Forces the evaluation of this lazy value and
returns a reference to result. This is equivalent
to the <code>Deref</code> impl, but is explicit.</p>
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">spin::Lazy</span>;
<span class="kw">let</span> <span class="ident">lazy</span> <span class="op">=</span> <span class="ident">Lazy::new</span>(<span class="op">|</span><span class="op">|</span> <span class="number">92</span>);
<span class="macro">assert_eq!</span>(<span class="ident">Lazy::force</span>(<span class="kw-2">&amp;</span><span class="ident">lazy</span>), <span class="kw-2">&amp;</span><span class="number">92</span>);
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span><span class="kw-2">*</span><span class="ident">lazy</span>, <span class="kw-2">&amp;</span><span class="number">92</span>);</pre></div>
</div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Debug" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>, F, R&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.Lazy.html" title="struct spin::lazy::Lazy">Lazy</a>&lt;T, F, R&gt;</h3><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../src/spin/lazy.rs.html#46-50" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.54.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4><a href="#method.fmt" class="anchor"></a><a class="srclink" href="../../src/spin/lazy.rs.html#47-49" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.54.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Default" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/default/trait.Default.html" title="trait core::default::Default">Default</a>, R&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="struct.Lazy.html" title="struct spin::lazy::Lazy">Lazy</a>&lt;T, fn() -&gt; T, R&gt;</h3><a href="#impl-Default" class="anchor"></a><a class="srclink" href="../../src/spin/lazy.rs.html#107-112" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.default" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/default/trait.Default.html#tymethod.default" class="fnname">default</a>() -&gt; Self</h4><a href="#method.default" class="anchor"></a><a class="srclink" href="../../src/spin/lazy.rs.html#109-111" title="goto source code">[src]</a></div></summary><div class="docblock"><p>Creates a new lazy value using <code>Default</code> as the initializing function.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Deref" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, F:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -&gt; T, R:&nbsp;<a class="trait" href="../relax/trait.RelaxStrategy.html" title="trait spin::relax::RelaxStrategy">RelaxStrategy</a>&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="struct.Lazy.html" title="struct spin::lazy::Lazy">Lazy</a>&lt;T, F, R&gt;</h3><a href="#impl-Deref" class="anchor"></a><a class="srclink" href="../../src/spin/lazy.rs.html#99-105" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Target" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html#associatedtype.Target" class="type">Target</a> = T</h4><a href="#associatedtype.Target" class="anchor"></a></div></summary><div class='docblock'><p>The resulting type after dereferencing.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.deref" class="method trait-impl has-srclink"><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.54.0/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.deref" class="anchor"></a><a class="srclink" href="../../src/spin/lazy.rs.html#102-104" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Dereferences the value.</p>
</div></details></div></details><div id="impl-Sync" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, F:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Lazy.html" title="struct spin::lazy::Lazy">Lazy</a>&lt;T, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="struct" href="../once/struct.Once.html" title="struct spin::once::Once">Once</a>&lt;T&gt;: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,&nbsp;</span></h3><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/spin/lazy.rs.html#57" title="goto source code">[src]</a></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-Send" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, F, R&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Lazy.html" title="struct spin::lazy::Lazy">Lazy</a>&lt;T, F, R&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,&nbsp;</span></h3><a href="#impl-Send" class="anchor"></a></div><div id="impl-Sync-1" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, F&nbsp;=&nbsp;fn() -&gt; T, R&nbsp;=&nbsp;<a class="struct" href="../relax/struct.Spin.html" title="struct spin::relax::Spin">Spin</a>&gt; !<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Lazy.html" title="struct spin::lazy::Lazy">Lazy</a>&lt;T, F, R&gt;</h3><a href="#impl-Sync-1" class="anchor"></a></div><div id="impl-Unpin" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, F, R&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Lazy.html" title="struct spin::lazy::Lazy">Lazy</a>&lt;T, F, R&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></h3><a href="#impl-Unpin" class="anchor"></a></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Any" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#131-135" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.54.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4><a href="#method.type_id" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/any.rs.html#132" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4><a href="#method.borrow" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4><a href="#method.borrow_mut" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#217" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#544-548" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</h4><a href="#method.from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#545" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#533-540" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</h4><a href="#method.into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#537" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#581-590" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.54.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4><a href="#associatedtype.Error" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_from" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#587" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></h3><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#567-576" title="goto source code">[src]</a></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4><a href="#associatedtype.Error-1" class="anchor"></a></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.54.0/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.54.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4><a href="#method.try_into" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#573" title="goto source code">[src]</a></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="spin" data-search-index-js="../../search-index.js" data-search-js="../../search.js"></div><script src="../../main.js"></script></body></html>

11
spin/lock_api/index.html Normal file
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="Spin synchronisation primitives, but compatible with `lock_api`."><meta name="keywords" content="rust, rustlang, rust-lang, lock_api"><title>spin::lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../spin/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module lock_api</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#types">Type Definitions</a></li></ul></div><div id="sidebar-vars" data-name="lock_api" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img src="../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">spin</a>::<wbr><a class="mod" href="#">lock_api</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/spin/lib.rs.html#155-186" title="goto source code">[src]</a></span></h1><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Spin synchronisation primitives, but compatible with <a href="https://crates.io/crates/lock_api"><code>lock_api</code></a>.</p>
</div></details><h2 id="types" class="section-header"><a href="#types">Type Definitions</a></h2>
<table><tr class="module-item"><td><a class="type" href="type.Mutex.html" title="spin::lock_api::Mutex type">Mutex</a></td><td class="docblock-short"><p>A lock that provides mutually exclusive data access (compatible with <a href="https://crates.io/crates/lock_api"><code>lock_api</code></a>).</p>
</td></tr><tr class="module-item"><td><a class="type" href="type.MutexGuard.html" title="spin::lock_api::MutexGuard type">MutexGuard</a></td><td class="docblock-short"><p>A guard that provides mutable data access (compatible with <a href="https://crates.io/crates/lock_api"><code>lock_api</code></a>).</p>
</td></tr><tr class="module-item"><td><a class="type" href="type.RwLock.html" title="spin::lock_api::RwLock type">RwLock</a></td><td class="docblock-short"><p>A lock that provides data access to either one writer or many readers (compatible with <a href="https://crates.io/crates/lock_api"><code>lock_api</code></a>).</p>
</td></tr><tr class="module-item"><td><a class="type" href="type.RwLockReadGuard.html" title="spin::lock_api::RwLockReadGuard type">RwLockReadGuard</a></td><td class="docblock-short"><p>A guard that provides immutable data access (compatible with <a href="https://crates.io/crates/lock_api"><code>lock_api</code></a>).</p>
</td></tr><tr class="module-item"><td><a class="type" href="type.RwLockUpgradableReadGuard.html" title="spin::lock_api::RwLockUpgradableReadGuard type">RwLockUpgradableReadGuard</a></td><td class="docblock-short"><p>A guard that provides immutable data access but can be upgraded to <a href="type.RwLockWriteGuard.html" title="RwLockWriteGuard"><code>RwLockWriteGuard</code></a> (compatible with <a href="https://crates.io/crates/lock_api"><code>lock_api</code></a>).</p>
</td></tr><tr class="module-item"><td><a class="type" href="type.RwLockWriteGuard.html" title="spin::lock_api::RwLockWriteGuard type">RwLockWriteGuard</a></td><td class="docblock-short"><p>A guard that provides mutable data access (compatible with <a href="https://crates.io/crates/lock_api"><code>lock_api</code></a>).</p>
</td></tr></table></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="spin" data-search-index-js="../../search-index.js" data-search-js="../../search.js"></div><script src="../../main.js"></script></body></html>

View File

@ -0,0 +1 @@
initSidebarItems({"type":[["Mutex","A lock that provides mutually exclusive data access (compatible with `lock_api`)."],["MutexGuard","A guard that provides mutable data access (compatible with `lock_api`)."],["RwLock","A lock that provides data access to either one writer or many readers (compatible with `lock_api`)."],["RwLockReadGuard","A guard that provides immutable data access (compatible with `lock_api`)."],["RwLockUpgradableReadGuard","A guard that provides immutable data access but can be upgraded to [`RwLockWriteGuard`] (compatible with `lock_api`)."],["RwLockWriteGuard","A guard that provides mutable data access (compatible with `lock_api`)."]]});

View File

@ -0,0 +1,4 @@
<!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 lock that provides mutually exclusive data access (compatible with `lock_api`)."><meta name="keywords" content="rust, rustlang, rust-lang, Mutex"><title>Mutex in spin::lock_api - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../spin/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><h2 class="location">Type Definition Mutex</h2><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../index.html">spin</a>::<wbr><a href="index.html">lock_api</a></h2><div id="sidebar-vars" data-name="Mutex" data-ty="type" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img src="../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img src="../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Type Definition <a href="../index.html">spin</a>::<wbr><a href="index.html">lock_api</a>::<wbr><a class="type" href="#">Mutex</a><button id="copy-path" onclick="copy_path(this)" title="copy path"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item import" title="Copy item import to clipboard"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/spin/lib.rs.html#159" title="goto source code">[src]</a></span></h1><pre class="rust typedef">type Mutex&lt;T&gt; = <a class="struct" href="../../lock_api/mutex/struct.Mutex.html" title="struct lock_api::mutex::Mutex">Mutex</a>&lt;<a class="type" href="../type.Mutex.html" title="type spin::Mutex">Mutex</a>&lt;()&gt;, T&gt;;</pre><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A lock that provides mutually exclusive data access (compatible with <a href="https://crates.io/crates/lock_api"><code>lock_api</code></a>).</p>
</div></details></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="spin" data-search-index-js="../../search-index.js" data-search-js="../../search.js"></div><script src="../../main.js"></script></body></html>

Some files were not shown because too many files have changed in this diff Show More