blob: cad3a30c8349ddd3143ce1def2679b536dd3b175 [file] [log] [blame]
<!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 thread-safe mutable memory location."><meta name="keywords" content="rust, rustlang, rust-lang, AtomicCell"><title>AtomicCell in crossbeam_utils::atomic - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../crossbeam_utils/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../crossbeam_utils/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">AtomicCell</a></h2><div class="sidebar-elems"><section><h3><a href="#implementations">Methods</a></h3><ul class="block"><li><a href="#method.as_ptr">as_ptr</a></li><li><a href="#method.compare_and_swap">compare_and_swap</a></li><li><a href="#method.compare_exchange">compare_exchange</a></li><li><a href="#method.fetch_add">fetch_add</a></li><li><a href="#method.fetch_add-1">fetch_add</a></li><li><a href="#method.fetch_add-10">fetch_add</a></li><li><a href="#method.fetch_add-11">fetch_add</a></li><li><a href="#method.fetch_add-2">fetch_add</a></li><li><a href="#method.fetch_add-3">fetch_add</a></li><li><a href="#method.fetch_add-4">fetch_add</a></li><li><a href="#method.fetch_add-5">fetch_add</a></li><li><a href="#method.fetch_add-6">fetch_add</a></li><li><a href="#method.fetch_add-7">fetch_add</a></li><li><a href="#method.fetch_add-8">fetch_add</a></li><li><a href="#method.fetch_add-9">fetch_add</a></li><li><a href="#method.fetch_and">fetch_and</a></li><li><a href="#method.fetch_and-1">fetch_and</a></li><li><a href="#method.fetch_and-10">fetch_and</a></li><li><a href="#method.fetch_and-11">fetch_and</a></li><li><a href="#method.fetch_and-12">fetch_and</a></li><li><a href="#method.fetch_and-2">fetch_and</a></li><li><a href="#method.fetch_and-3">fetch_and</a></li><li><a href="#method.fetch_and-4">fetch_and</a></li><li><a href="#method.fetch_and-5">fetch_and</a></li><li><a href="#method.fetch_and-6">fetch_and</a></li><li><a href="#method.fetch_and-7">fetch_and</a></li><li><a href="#method.fetch_and-8">fetch_and</a></li><li><a href="#method.fetch_and-9">fetch_and</a></li><li><a href="#method.fetch_max">fetch_max</a></li><li><a href="#method.fetch_max-1">fetch_max</a></li><li><a href="#method.fetch_max-10">fetch_max</a></li><li><a href="#method.fetch_max-11">fetch_max</a></li><li><a href="#method.fetch_max-2">fetch_max</a></li><li><a href="#method.fetch_max-3">fetch_max</a></li><li><a href="#method.fetch_max-4">fetch_max</a></li><li><a href="#method.fetch_max-5">fetch_max</a></li><li><a href="#method.fetch_max-6">fetch_max</a></li><li><a href="#method.fetch_max-7">fetch_max</a></li><li><a href="#method.fetch_max-8">fetch_max</a></li><li><a href="#method.fetch_max-9">fetch_max</a></li><li><a href="#method.fetch_min">fetch_min</a></li><li><a href="#method.fetch_min-1">fetch_min</a></li><li><a href="#method.fetch_min-10">fetch_min</a></li><li><a href="#method.fetch_min-11">fetch_min</a></li><li><a href="#method.fetch_min-2">fetch_min</a></li><li><a href="#method.fetch_min-3">fetch_min</a></li><li><a href="#method.fetch_min-4">fetch_min</a></li><li><a href="#method.fetch_min-5">fetch_min</a></li><li><a href="#method.fetch_min-6">fetch_min</a></li><li><a href="#method.fetch_min-7">fetch_min</a></li><li><a href="#method.fetch_min-8">fetch_min</a></li><li><a href="#method.fetch_min-9">fetch_min</a></li><li><a href="#method.fetch_nand">fetch_nand</a></li><li><a href="#method.fetch_nand-1">fetch_nand</a></li><li><a href="#method.fetch_nand-10">fetch_nand</a></li><li><a href="#method.fetch_nand-11">fetch_nand</a></li><li><a href="#method.fetch_nand-12">fetch_nand</a></li><li><a href="#method.fetch_nand-2">fetch_nand</a></li><li><a href="#method.fetch_nand-3">fetch_nand</a></li><li><a href="#method.fetch_nand-4">fetch_nand</a></li><li><a href="#method.fetch_nand-5">fetch_nand</a></li><li><a href="#method.fetch_nand-6">fetch_nand</a></li><li><a href="#method.fetch_nand-7">fetch_nand</a></li><li><a href="#method.fetch_nand-8">fetch_nand</a></li><li><a href="#method.fetch_nand-9">fetch_nand</a></li><li><a href="#method.fetch_or">fetch_or</a></li><li><a href="#method.fetch_or-1">fetch_or</a></li><li><a href="#method.fetch_or-10">fetch_or</a></li><li><a href="#method.fetch_or-11">fetch_or</a></li><li><a href="#method.fetch_or-12">fetch_or</a></li><li><a href="#method.fetch_or-2">fetch_or</a></li><li><a href="#method.fetch_or-3">fetch_or</a></li><li><a href="#method.fetch_or-4">fetch_or</a></li><li><a href="#method.fetch_or-5">fetch_or</a></li><li><a href="#method.fetch_or-6">fetch_or</a></li><li><a href="#method.fetch_or-7">fetch_or</a></li><li><a href="#method.fetch_or-8">fetch_or</a></li><li><a href="#method.fetch_or-9">fetch_or</a></li><li><a href="#method.fetch_sub">fetch_sub</a></li><li><a href="#method.fetch_sub-1">fetch_sub</a></li><li><a href="#method.fetch_sub-10">fetch_sub</a></li><li><a href="#method.fetch_sub-11">fetch_sub</a></li><li><a href="#method.fetch_sub-2">fetch_sub</a></li><li><a href="#method.fetch_sub-3">fetch_sub</a></li><li><a href="#method.fetch_sub-4">fetch_sub</a></li><li><a href="#method.fetch_sub-5">fetch_sub</a></li><li><a href="#method.fetch_sub-6">fetch_sub</a></li><li><a href="#method.fetch_sub-7">fetch_sub</a></li><li><a href="#method.fetch_sub-8">fetch_sub</a></li><li><a href="#method.fetch_sub-9">fetch_sub</a></li><li><a href="#method.fetch_update">fetch_update</a></li><li><a href="#method.fetch_xor">fetch_xor</a></li><li><a href="#method.fetch_xor-1">fetch_xor</a></li><li><a href="#method.fetch_xor-10">fetch_xor</a></li><li><a href="#method.fetch_xor-11">fetch_xor</a></li><li><a href="#method.fetch_xor-12">fetch_xor</a></li><li><a href="#method.fetch_xor-2">fetch_xor</a></li><li><a href="#method.fetch_xor-3">fetch_xor</a></li><li><a href="#method.fetch_xor-4">fetch_xor</a></li><li><a href="#method.fetch_xor-5">fetch_xor</a></li><li><a href="#method.fetch_xor-6">fetch_xor</a></li><li><a href="#method.fetch_xor-7">fetch_xor</a></li><li><a href="#method.fetch_xor-8">fetch_xor</a></li><li><a href="#method.fetch_xor-9">fetch_xor</a></li><li><a href="#method.into_inner">into_inner</a></li><li><a href="#method.is_lock_free">is_lock_free</a></li><li><a href="#method.load">load</a></li><li><a href="#method.new">new</a></li><li><a href="#method.store">store</a></li><li><a href="#method.swap">swap</a></li><li><a href="#method.take">take</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block"><li><a href="#impl-Debug-for-AtomicCell%3CT%3E">Debug</a></li><li><a href="#impl-Default-for-AtomicCell%3CT%3E">Default</a></li><li><a href="#impl-Drop-for-AtomicCell%3CT%3E">Drop</a></li><li><a href="#impl-From%3CT%3E-for-AtomicCell%3CT%3E">From&lt;T&gt;</a></li><li><a href="#impl-RefUnwindSafe-for-AtomicCell%3CT%3E">RefUnwindSafe</a></li><li><a href="#impl-Send-for-AtomicCell%3CT%3E">Send</a></li><li><a href="#impl-Sync-for-AtomicCell%3CT%3E">Sync</a></li><li><a href="#impl-UnwindSafe-for-AtomicCell%3CT%3E">UnwindSafe</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block"><li><a href="#impl-Unpin-for-AtomicCell%3CT%3E">Unpin</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block"><li><a href="#impl-Any-for-AtomicCell%3CT%3E">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-AtomicCell%3CT%3E">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-AtomicCell%3CT%3E">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-From%3C!%3E-for-AtomicCell%3CT%3E">From&lt;!&gt;</a></li><li><a href="#impl-From%3CT%3E-for-AtomicCell%3CT%3E-1">From&lt;T&gt;</a></li><li><a href="#impl-Into%3CU%3E-for-AtomicCell%3CT%3E">Into&lt;U&gt;</a></li><li><a href="#impl-TryFrom%3CU%3E-for-AtomicCell%3CT%3E">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E-for-AtomicCell%3CT%3E">TryInto&lt;U&gt;</a></li></ul></section><h2><a href="index.html">In crossbeam_utils::atomic</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Struct <a href="../index.html">crossbeam_utils</a>::<wbr><a href="index.html">atomic</a>::<wbr><a class="struct" href="#">AtomicCell</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#33-47">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="item-decl"><pre class="rust struct"><code><div class="code-attribute">#[repr(transparent)]</div>pub struct AtomicCell&lt;T&gt; { /* private fields */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A thread-safe mutable memory location.</p>
<p>This type is equivalent to <a href="std::cell::Cell"><code>Cell</code></a>, except it can also be shared among multiple threads.</p>
<p>Operations on <code>AtomicCell</code>s use atomic instructions whenever possible, and synchronize using
global locks otherwise. You can call <a href="struct.AtomicCell.html#method.is_lock_free"><code>AtomicCell::&lt;T&gt;::is_lock_free()</code></a> to check whether
atomic instructions or locks will be used.</p>
<p>Atomic loads use the <a href="std::sync::atomic::Ordering::Acquire"><code>Acquire</code></a> ordering and atomic stores use the <a href="std::sync::atomic::Ordering::Release"><code>Release</code></a> ordering.</p>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-AtomicCell%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#57-185">source</a><a href="#impl-AtomicCell%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.new" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#67-71">source</a><h4 class="code-header">pub const fn <a href="#method.new" class="fnname">new</a>(val: T) -&gt; <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;T&gt;</h4></section></summary><div class="docblock"><p>Creates a new atomic cell initialized with <code>val</code>.</p>
<h5 id="examples"><a href="#examples">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into_inner" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#88-96">source</a><h4 class="code-header">pub fn <a href="#method.into_inner" class="fnname">into_inner</a>(self) -&gt; T</h4></section></summary><div class="docblock"><p>Consumes the atomic and returns the contained value.</p>
<p>This is safe because passing <code>self</code> by value guarantees that no other threads are
concurrently accessing the atomic data.</p>
<h5 id="examples-1"><a href="#examples-1">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7</span>);
<span class="kw">let </span>v = a.into_inner();
<span class="macro">assert_eq!</span>(v, <span class="number">7</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_lock_free" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#126-128">source</a><h4 class="code-header">pub const fn <a href="#method.is_lock_free" class="fnname">is_lock_free</a>() -&gt; bool</h4></section></summary><div class="docblock"><p>Returns <code>true</code> if operations on values of this type are lock-free.</p>
<p>If the compiler or the platform doesn’t support the necessary atomic instructions,
<code>AtomicCell&lt;T&gt;</code> will use global locks for every potentially concurrent atomic operation.</p>
<h5 id="examples-2"><a href="#examples-2">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="comment">// This type is internally represented as `AtomicUsize` so we can just use atomic
// operations provided by it.
</span><span class="macro">assert_eq!</span>(AtomicCell::&lt;usize&gt;::is_lock_free(), <span class="bool-val">true</span>);
<span class="comment">// A wrapper struct around `isize`.
</span><span class="kw">struct </span>Foo {
bar: isize,
}
<span class="comment">// `AtomicCell&lt;Foo&gt;` will be internally represented as `AtomicIsize`.
</span><span class="macro">assert_eq!</span>(AtomicCell::&lt;Foo&gt;::is_lock_free(), <span class="bool-val">true</span>);
<span class="comment">// Operations on zero-sized types are always lock-free.
</span><span class="macro">assert_eq!</span>(AtomicCell::&lt;()&gt;::is_lock_free(), <span class="bool-val">true</span>);
<span class="comment">// Very large types cannot be represented as any of the standard atomic types, so atomic
// operations on them will have to use global locks for synchronization.
</span><span class="macro">assert_eq!</span>(AtomicCell::&lt;[u8; <span class="number">1000</span>]&gt;::is_lock_free(), <span class="bool-val">false</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.store" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#143-151">source</a><h4 class="code-header">pub fn <a href="#method.store" class="fnname">store</a>(&amp;self, val: T)</h4></section></summary><div class="docblock"><p>Stores <code>val</code> into the atomic cell.</p>
<h5 id="examples-3"><a href="#examples-3">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">7</span>);
a.store(<span class="number">8</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">8</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.swap" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#166-168">source</a><h4 class="code-header">pub fn <a href="#method.swap" class="fnname">swap</a>(&amp;self, val: T) -&gt; T</h4></section></summary><div class="docblock"><p>Stores <code>val</code> into the atomic cell and returns the previous value.</p>
<h5 id="examples-4"><a href="#examples-4">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.swap(<span class="number">8</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">8</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.as_ptr" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#182-184">source</a><h4 class="code-header">pub fn <a href="#method.as_ptr" class="fnname">as_ptr</a>(&amp;self) -&gt; *mut T</h4></section></summary><div class="docblock"><p>Returns a raw pointer to the underlying data in this atomic cell.</p>
<h5 id="examples-5"><a href="#examples-5">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">5</span>);
<span class="kw">let </span>ptr = a.as_ptr();</code></pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-AtomicCell%3CT%3E-1" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#187-204">source</a><a href="#impl-AtomicCell%3CT%3E-1" class="anchor"></a><h3 class="code-header">impl&lt;T:&nbsp;Default&gt; <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.take" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#201-203">source</a><h4 class="code-header">pub fn <a href="#method.take" class="fnname">take</a>(&amp;self) -&gt; T</h4></section></summary><div class="docblock"><p>Takes the value of the atomic cell, leaving <code>Default::default()</code> in its place.</p>
<h5 id="examples-6"><a href="#examples-6">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">5</span>);
<span class="kw">let </span>five = a.take();
<span class="macro">assert_eq!</span>(five, <span class="number">5</span>);
<span class="macro">assert_eq!</span>(a.into_inner(), <span class="number">0</span>);</code></pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-AtomicCell%3CT%3E-2" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#206-221">source</a><a href="#impl-AtomicCell%3CT%3E-2" class="anchor"></a><h3 class="code-header">impl&lt;T:&nbsp;Copy&gt; <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.load" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#218-220">source</a><h4 class="code-header">pub fn <a href="#method.load" class="fnname">load</a>(&amp;self) -&gt; T</h4></section></summary><div class="docblock"><p>Loads a value from the atomic cell.</p>
<h5 id="examples-7"><a href="#examples-7">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">7</span>);</code></pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-AtomicCell%3CT%3E-3" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#223-307">source</a><a href="#impl-AtomicCell%3CT%3E-3" class="anchor"></a><h3 class="code-header">impl&lt;T:&nbsp;Copy + Eq&gt; <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.compare_and_swap" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#245-250">source</a><h4 class="code-header">pub fn <a href="#method.compare_and_swap" class="fnname">compare_and_swap</a>(&amp;self, current: T, new: T) -&gt; T</h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated: Use <code>compare_exchange</code> instead</span></div></span></summary><div class="docblock"><p>If the current value equals <code>current</code>, stores <code>new</code> into the atomic cell.</p>
<p>The return value is always the previous value. If it is equal to <code>current</code>, then the value
was updated.</p>
<h5 id="examples-8"><a href="#examples-8">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">1</span>);
<span class="macro">assert_eq!</span>(a.compare_and_swap(<span class="number">2</span>, <span class="number">3</span>), <span class="number">1</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">1</span>);
<span class="macro">assert_eq!</span>(a.compare_and_swap(<span class="number">1</span>, <span class="number">2</span>), <span class="number">1</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">2</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.compare_exchange" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#270-272">source</a><h4 class="code-header">pub fn <a href="#method.compare_exchange" class="fnname">compare_exchange</a>(&amp;self, current: T, new: T) -&gt; Result&lt;T, T&gt;</h4></section></summary><div class="docblock"><p>If the current value equals <code>current</code>, stores <code>new</code> into the atomic cell.</p>
<p>The return value is a result indicating whether the new value was written and containing
the previous value. On success this value is guaranteed to be equal to <code>current</code>.</p>
<h5 id="examples-9"><a href="#examples-9">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">1</span>);
<span class="macro">assert_eq!</span>(a.compare_exchange(<span class="number">2</span>, <span class="number">3</span>), <span class="prelude-val">Err</span>(<span class="number">1</span>));
<span class="macro">assert_eq!</span>(a.load(), <span class="number">1</span>);
<span class="macro">assert_eq!</span>(a.compare_exchange(<span class="number">1</span>, <span class="number">2</span>), <span class="prelude-val">Ok</span>(<span class="number">1</span>));
<span class="macro">assert_eq!</span>(a.load(), <span class="number">2</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_update" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#294-306">source</a><h4 class="code-header">pub fn <a href="#method.fetch_update" class="fnname">fetch_update</a>&lt;F&gt;(&amp;self, f: F) -&gt; Result&lt;T, T&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: FnMut(T) -&gt; Option&lt;T&gt;,</span></h4></section></summary><div class="docblock"><p>Fetches the value, and applies a function to it that returns an optional
new value. Returns a <code>Result</code> of <code>Ok(previous_value)</code> if the function returned <code>Some(_)</code>, else
<code>Err(previous_value)</code>.</p>
<p>Note: This may call the function multiple times if the value has been changed from other threads in
the meantime, as long as the function returns <code>Some(_)</code>, but the function will have been applied
only once to the stored value.</p>
<h5 id="examples-10"><a href="#examples-10">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.fetch_update(|<span class="kw">_</span>| <span class="prelude-val">None</span>), <span class="prelude-val">Err</span>(<span class="number">7</span>));
<span class="macro">assert_eq!</span>(a.fetch_update(|a| <span class="prelude-val">Some</span>(a + <span class="number">1</span>)), <span class="prelude-val">Ok</span>(<span class="number">7</span>));
<span class="macro">assert_eq!</span>(a.fetch_update(|a| <span class="prelude-val">Some</span>(a + <span class="number">1</span>)), <span class="prelude-val">Ok</span>(<span class="number">8</span>));
<span class="macro">assert_eq!</span>(a.load(), <span class="number">9</span>);</code></pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-AtomicCell%3Cu8%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#722">source</a><a href="#impl-AtomicCell%3Cu8%3E" class="anchor"></a><h3 class="code-header">impl <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;u8&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_add" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#722">source</a><h4 class="code-header">pub fn <a href="#method.fetch_add" class="fnname">fetch_add</a>(&amp;self, val: u8) -&gt; u8</h4></section></summary><div class="docblock"><p>Increments the current value by <code>val</code> and returns the previous value.</p>
<p>The addition wraps on overflow.</p>
<h5 id="examples-11"><a href="#examples-11">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u8</span>);
<span class="macro">assert_eq!</span>(a.fetch_add(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">10</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_sub" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#722">source</a><h4 class="code-header">pub fn <a href="#method.fetch_sub" class="fnname">fetch_sub</a>(&amp;self, val: u8) -&gt; u8</h4></section></summary><div class="docblock"><p>Decrements the current value by <code>val</code> and returns the previous value.</p>
<p>The subtraction wraps on overflow.</p>
<h5 id="examples-12"><a href="#examples-12">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u8</span>);
<span class="macro">assert_eq!</span>(a.fetch_sub(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">4</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_and" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#722">source</a><h4 class="code-header">pub fn <a href="#method.fetch_and" class="fnname">fetch_and</a>(&amp;self, val: u8) -&gt; u8</h4></section></summary><div class="docblock"><p>Applies bitwise “and” to the current value and returns the previous value.</p>
<h5 id="examples-13"><a href="#examples-13">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u8</span>);
<span class="macro">assert_eq!</span>(a.fetch_and(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">3</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_nand" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#722">source</a><h4 class="code-header">pub fn <a href="#method.fetch_nand" class="fnname">fetch_nand</a>(&amp;self, val: u8) -&gt; u8</h4></section></summary><div class="docblock"><p>Applies bitwise “nand” to the current value and returns the previous value.</p>
<h5 id="examples-14"><a href="#examples-14">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u8</span>);
<span class="macro">assert_eq!</span>(a.fetch_nand(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), !(<span class="number">7 </span>&amp; <span class="number">3</span>));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_or" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#722">source</a><h4 class="code-header">pub fn <a href="#method.fetch_or" class="fnname">fetch_or</a>(&amp;self, val: u8) -&gt; u8</h4></section></summary><div class="docblock"><p>Applies bitwise “or” to the current value and returns the previous value.</p>
<h5 id="examples-15"><a href="#examples-15">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u8</span>);
<span class="macro">assert_eq!</span>(a.fetch_or(<span class="number">16</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">23</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_xor" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#722">source</a><h4 class="code-header">pub fn <a href="#method.fetch_xor" class="fnname">fetch_xor</a>(&amp;self, val: u8) -&gt; u8</h4></section></summary><div class="docblock"><p>Applies bitwise “xor” to the current value and returns the previous value.</p>
<h5 id="examples-16"><a href="#examples-16">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u8</span>);
<span class="macro">assert_eq!</span>(a.fetch_xor(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">5</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_max" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#722">source</a><h4 class="code-header">pub fn <a href="#method.fetch_max" class="fnname">fetch_max</a>(&amp;self, val: u8) -&gt; u8</h4></section></summary><div class="docblock"><p>Compares and sets the maximum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-17"><a href="#examples-17">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u8</span>);
<span class="macro">assert_eq!</span>(a.fetch_max(<span class="number">9</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">9</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_min" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#722">source</a><h4 class="code-header">pub fn <a href="#method.fetch_min" class="fnname">fetch_min</a>(&amp;self, val: u8) -&gt; u8</h4></section></summary><div class="docblock"><p>Compares and sets the minimum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-18"><a href="#examples-18">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u8</span>);
<span class="macro">assert_eq!</span>(a.fetch_min(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">2</span>);</code></pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-AtomicCell%3Ci8%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#723">source</a><a href="#impl-AtomicCell%3Ci8%3E" class="anchor"></a><h3 class="code-header">impl <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;i8&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_add-1" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#723">source</a><h4 class="code-header">pub fn <a href="#method.fetch_add-1" class="fnname">fetch_add</a>(&amp;self, val: i8) -&gt; i8</h4></section></summary><div class="docblock"><p>Increments the current value by <code>val</code> and returns the previous value.</p>
<p>The addition wraps on overflow.</p>
<h5 id="examples-19"><a href="#examples-19">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i8</span>);
<span class="macro">assert_eq!</span>(a.fetch_add(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">10</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_sub-1" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#723">source</a><h4 class="code-header">pub fn <a href="#method.fetch_sub-1" class="fnname">fetch_sub</a>(&amp;self, val: i8) -&gt; i8</h4></section></summary><div class="docblock"><p>Decrements the current value by <code>val</code> and returns the previous value.</p>
<p>The subtraction wraps on overflow.</p>
<h5 id="examples-20"><a href="#examples-20">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i8</span>);
<span class="macro">assert_eq!</span>(a.fetch_sub(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">4</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_and-1" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#723">source</a><h4 class="code-header">pub fn <a href="#method.fetch_and-1" class="fnname">fetch_and</a>(&amp;self, val: i8) -&gt; i8</h4></section></summary><div class="docblock"><p>Applies bitwise “and” to the current value and returns the previous value.</p>
<h5 id="examples-21"><a href="#examples-21">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i8</span>);
<span class="macro">assert_eq!</span>(a.fetch_and(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">3</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_nand-1" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#723">source</a><h4 class="code-header">pub fn <a href="#method.fetch_nand-1" class="fnname">fetch_nand</a>(&amp;self, val: i8) -&gt; i8</h4></section></summary><div class="docblock"><p>Applies bitwise “nand” to the current value and returns the previous value.</p>
<h5 id="examples-22"><a href="#examples-22">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i8</span>);
<span class="macro">assert_eq!</span>(a.fetch_nand(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), !(<span class="number">7 </span>&amp; <span class="number">3</span>));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_or-1" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#723">source</a><h4 class="code-header">pub fn <a href="#method.fetch_or-1" class="fnname">fetch_or</a>(&amp;self, val: i8) -&gt; i8</h4></section></summary><div class="docblock"><p>Applies bitwise “or” to the current value and returns the previous value.</p>
<h5 id="examples-23"><a href="#examples-23">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i8</span>);
<span class="macro">assert_eq!</span>(a.fetch_or(<span class="number">16</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">23</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_xor-1" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#723">source</a><h4 class="code-header">pub fn <a href="#method.fetch_xor-1" class="fnname">fetch_xor</a>(&amp;self, val: i8) -&gt; i8</h4></section></summary><div class="docblock"><p>Applies bitwise “xor” to the current value and returns the previous value.</p>
<h5 id="examples-24"><a href="#examples-24">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i8</span>);
<span class="macro">assert_eq!</span>(a.fetch_xor(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">5</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_max-1" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#723">source</a><h4 class="code-header">pub fn <a href="#method.fetch_max-1" class="fnname">fetch_max</a>(&amp;self, val: i8) -&gt; i8</h4></section></summary><div class="docblock"><p>Compares and sets the maximum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-25"><a href="#examples-25">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i8</span>);
<span class="macro">assert_eq!</span>(a.fetch_max(<span class="number">9</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">9</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_min-1" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#723">source</a><h4 class="code-header">pub fn <a href="#method.fetch_min-1" class="fnname">fetch_min</a>(&amp;self, val: i8) -&gt; i8</h4></section></summary><div class="docblock"><p>Compares and sets the minimum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-26"><a href="#examples-26">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i8</span>);
<span class="macro">assert_eq!</span>(a.fetch_min(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">2</span>);</code></pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-AtomicCell%3Cu16%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#724">source</a><a href="#impl-AtomicCell%3Cu16%3E" class="anchor"></a><h3 class="code-header">impl <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;u16&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_add-2" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#724">source</a><h4 class="code-header">pub fn <a href="#method.fetch_add-2" class="fnname">fetch_add</a>(&amp;self, val: u16) -&gt; u16</h4></section></summary><div class="docblock"><p>Increments the current value by <code>val</code> and returns the previous value.</p>
<p>The addition wraps on overflow.</p>
<h5 id="examples-27"><a href="#examples-27">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u16</span>);
<span class="macro">assert_eq!</span>(a.fetch_add(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">10</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_sub-2" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#724">source</a><h4 class="code-header">pub fn <a href="#method.fetch_sub-2" class="fnname">fetch_sub</a>(&amp;self, val: u16) -&gt; u16</h4></section></summary><div class="docblock"><p>Decrements the current value by <code>val</code> and returns the previous value.</p>
<p>The subtraction wraps on overflow.</p>
<h5 id="examples-28"><a href="#examples-28">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u16</span>);
<span class="macro">assert_eq!</span>(a.fetch_sub(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">4</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_and-2" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#724">source</a><h4 class="code-header">pub fn <a href="#method.fetch_and-2" class="fnname">fetch_and</a>(&amp;self, val: u16) -&gt; u16</h4></section></summary><div class="docblock"><p>Applies bitwise “and” to the current value and returns the previous value.</p>
<h5 id="examples-29"><a href="#examples-29">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u16</span>);
<span class="macro">assert_eq!</span>(a.fetch_and(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">3</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_nand-2" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#724">source</a><h4 class="code-header">pub fn <a href="#method.fetch_nand-2" class="fnname">fetch_nand</a>(&amp;self, val: u16) -&gt; u16</h4></section></summary><div class="docblock"><p>Applies bitwise “nand” to the current value and returns the previous value.</p>
<h5 id="examples-30"><a href="#examples-30">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u16</span>);
<span class="macro">assert_eq!</span>(a.fetch_nand(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), !(<span class="number">7 </span>&amp; <span class="number">3</span>));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_or-2" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#724">source</a><h4 class="code-header">pub fn <a href="#method.fetch_or-2" class="fnname">fetch_or</a>(&amp;self, val: u16) -&gt; u16</h4></section></summary><div class="docblock"><p>Applies bitwise “or” to the current value and returns the previous value.</p>
<h5 id="examples-31"><a href="#examples-31">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u16</span>);
<span class="macro">assert_eq!</span>(a.fetch_or(<span class="number">16</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">23</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_xor-2" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#724">source</a><h4 class="code-header">pub fn <a href="#method.fetch_xor-2" class="fnname">fetch_xor</a>(&amp;self, val: u16) -&gt; u16</h4></section></summary><div class="docblock"><p>Applies bitwise “xor” to the current value and returns the previous value.</p>
<h5 id="examples-32"><a href="#examples-32">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u16</span>);
<span class="macro">assert_eq!</span>(a.fetch_xor(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">5</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_max-2" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#724">source</a><h4 class="code-header">pub fn <a href="#method.fetch_max-2" class="fnname">fetch_max</a>(&amp;self, val: u16) -&gt; u16</h4></section></summary><div class="docblock"><p>Compares and sets the maximum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-33"><a href="#examples-33">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u16</span>);
<span class="macro">assert_eq!</span>(a.fetch_max(<span class="number">9</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">9</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_min-2" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#724">source</a><h4 class="code-header">pub fn <a href="#method.fetch_min-2" class="fnname">fetch_min</a>(&amp;self, val: u16) -&gt; u16</h4></section></summary><div class="docblock"><p>Compares and sets the minimum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-34"><a href="#examples-34">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u16</span>);
<span class="macro">assert_eq!</span>(a.fetch_min(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">2</span>);</code></pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-AtomicCell%3Ci16%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#725">source</a><a href="#impl-AtomicCell%3Ci16%3E" class="anchor"></a><h3 class="code-header">impl <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;i16&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_add-3" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#725">source</a><h4 class="code-header">pub fn <a href="#method.fetch_add-3" class="fnname">fetch_add</a>(&amp;self, val: i16) -&gt; i16</h4></section></summary><div class="docblock"><p>Increments the current value by <code>val</code> and returns the previous value.</p>
<p>The addition wraps on overflow.</p>
<h5 id="examples-35"><a href="#examples-35">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i16</span>);
<span class="macro">assert_eq!</span>(a.fetch_add(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">10</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_sub-3" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#725">source</a><h4 class="code-header">pub fn <a href="#method.fetch_sub-3" class="fnname">fetch_sub</a>(&amp;self, val: i16) -&gt; i16</h4></section></summary><div class="docblock"><p>Decrements the current value by <code>val</code> and returns the previous value.</p>
<p>The subtraction wraps on overflow.</p>
<h5 id="examples-36"><a href="#examples-36">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i16</span>);
<span class="macro">assert_eq!</span>(a.fetch_sub(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">4</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_and-3" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#725">source</a><h4 class="code-header">pub fn <a href="#method.fetch_and-3" class="fnname">fetch_and</a>(&amp;self, val: i16) -&gt; i16</h4></section></summary><div class="docblock"><p>Applies bitwise “and” to the current value and returns the previous value.</p>
<h5 id="examples-37"><a href="#examples-37">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i16</span>);
<span class="macro">assert_eq!</span>(a.fetch_and(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">3</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_nand-3" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#725">source</a><h4 class="code-header">pub fn <a href="#method.fetch_nand-3" class="fnname">fetch_nand</a>(&amp;self, val: i16) -&gt; i16</h4></section></summary><div class="docblock"><p>Applies bitwise “nand” to the current value and returns the previous value.</p>
<h5 id="examples-38"><a href="#examples-38">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i16</span>);
<span class="macro">assert_eq!</span>(a.fetch_nand(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), !(<span class="number">7 </span>&amp; <span class="number">3</span>));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_or-3" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#725">source</a><h4 class="code-header">pub fn <a href="#method.fetch_or-3" class="fnname">fetch_or</a>(&amp;self, val: i16) -&gt; i16</h4></section></summary><div class="docblock"><p>Applies bitwise “or” to the current value and returns the previous value.</p>
<h5 id="examples-39"><a href="#examples-39">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i16</span>);
<span class="macro">assert_eq!</span>(a.fetch_or(<span class="number">16</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">23</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_xor-3" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#725">source</a><h4 class="code-header">pub fn <a href="#method.fetch_xor-3" class="fnname">fetch_xor</a>(&amp;self, val: i16) -&gt; i16</h4></section></summary><div class="docblock"><p>Applies bitwise “xor” to the current value and returns the previous value.</p>
<h5 id="examples-40"><a href="#examples-40">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i16</span>);
<span class="macro">assert_eq!</span>(a.fetch_xor(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">5</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_max-3" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#725">source</a><h4 class="code-header">pub fn <a href="#method.fetch_max-3" class="fnname">fetch_max</a>(&amp;self, val: i16) -&gt; i16</h4></section></summary><div class="docblock"><p>Compares and sets the maximum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-41"><a href="#examples-41">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i16</span>);
<span class="macro">assert_eq!</span>(a.fetch_max(<span class="number">9</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">9</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_min-3" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#725">source</a><h4 class="code-header">pub fn <a href="#method.fetch_min-3" class="fnname">fetch_min</a>(&amp;self, val: i16) -&gt; i16</h4></section></summary><div class="docblock"><p>Compares and sets the minimum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-42"><a href="#examples-42">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i16</span>);
<span class="macro">assert_eq!</span>(a.fetch_min(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">2</span>);</code></pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-AtomicCell%3Cu32%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#726">source</a><a href="#impl-AtomicCell%3Cu32%3E" class="anchor"></a><h3 class="code-header">impl <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;u32&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_add-4" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#726">source</a><h4 class="code-header">pub fn <a href="#method.fetch_add-4" class="fnname">fetch_add</a>(&amp;self, val: u32) -&gt; u32</h4></section></summary><div class="docblock"><p>Increments the current value by <code>val</code> and returns the previous value.</p>
<p>The addition wraps on overflow.</p>
<h5 id="examples-43"><a href="#examples-43">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u32</span>);
<span class="macro">assert_eq!</span>(a.fetch_add(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">10</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_sub-4" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#726">source</a><h4 class="code-header">pub fn <a href="#method.fetch_sub-4" class="fnname">fetch_sub</a>(&amp;self, val: u32) -&gt; u32</h4></section></summary><div class="docblock"><p>Decrements the current value by <code>val</code> and returns the previous value.</p>
<p>The subtraction wraps on overflow.</p>
<h5 id="examples-44"><a href="#examples-44">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u32</span>);
<span class="macro">assert_eq!</span>(a.fetch_sub(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">4</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_and-4" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#726">source</a><h4 class="code-header">pub fn <a href="#method.fetch_and-4" class="fnname">fetch_and</a>(&amp;self, val: u32) -&gt; u32</h4></section></summary><div class="docblock"><p>Applies bitwise “and” to the current value and returns the previous value.</p>
<h5 id="examples-45"><a href="#examples-45">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u32</span>);
<span class="macro">assert_eq!</span>(a.fetch_and(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">3</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_nand-4" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#726">source</a><h4 class="code-header">pub fn <a href="#method.fetch_nand-4" class="fnname">fetch_nand</a>(&amp;self, val: u32) -&gt; u32</h4></section></summary><div class="docblock"><p>Applies bitwise “nand” to the current value and returns the previous value.</p>
<h5 id="examples-46"><a href="#examples-46">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u32</span>);
<span class="macro">assert_eq!</span>(a.fetch_nand(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), !(<span class="number">7 </span>&amp; <span class="number">3</span>));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_or-4" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#726">source</a><h4 class="code-header">pub fn <a href="#method.fetch_or-4" class="fnname">fetch_or</a>(&amp;self, val: u32) -&gt; u32</h4></section></summary><div class="docblock"><p>Applies bitwise “or” to the current value and returns the previous value.</p>
<h5 id="examples-47"><a href="#examples-47">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u32</span>);
<span class="macro">assert_eq!</span>(a.fetch_or(<span class="number">16</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">23</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_xor-4" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#726">source</a><h4 class="code-header">pub fn <a href="#method.fetch_xor-4" class="fnname">fetch_xor</a>(&amp;self, val: u32) -&gt; u32</h4></section></summary><div class="docblock"><p>Applies bitwise “xor” to the current value and returns the previous value.</p>
<h5 id="examples-48"><a href="#examples-48">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u32</span>);
<span class="macro">assert_eq!</span>(a.fetch_xor(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">5</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_max-4" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#726">source</a><h4 class="code-header">pub fn <a href="#method.fetch_max-4" class="fnname">fetch_max</a>(&amp;self, val: u32) -&gt; u32</h4></section></summary><div class="docblock"><p>Compares and sets the maximum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-49"><a href="#examples-49">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u32</span>);
<span class="macro">assert_eq!</span>(a.fetch_max(<span class="number">9</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">9</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_min-4" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#726">source</a><h4 class="code-header">pub fn <a href="#method.fetch_min-4" class="fnname">fetch_min</a>(&amp;self, val: u32) -&gt; u32</h4></section></summary><div class="docblock"><p>Compares and sets the minimum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-50"><a href="#examples-50">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u32</span>);
<span class="macro">assert_eq!</span>(a.fetch_min(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">2</span>);</code></pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-AtomicCell%3Ci32%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#727">source</a><a href="#impl-AtomicCell%3Ci32%3E" class="anchor"></a><h3 class="code-header">impl <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;i32&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_add-5" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#727">source</a><h4 class="code-header">pub fn <a href="#method.fetch_add-5" class="fnname">fetch_add</a>(&amp;self, val: i32) -&gt; i32</h4></section></summary><div class="docblock"><p>Increments the current value by <code>val</code> and returns the previous value.</p>
<p>The addition wraps on overflow.</p>
<h5 id="examples-51"><a href="#examples-51">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i32</span>);
<span class="macro">assert_eq!</span>(a.fetch_add(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">10</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_sub-5" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#727">source</a><h4 class="code-header">pub fn <a href="#method.fetch_sub-5" class="fnname">fetch_sub</a>(&amp;self, val: i32) -&gt; i32</h4></section></summary><div class="docblock"><p>Decrements the current value by <code>val</code> and returns the previous value.</p>
<p>The subtraction wraps on overflow.</p>
<h5 id="examples-52"><a href="#examples-52">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i32</span>);
<span class="macro">assert_eq!</span>(a.fetch_sub(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">4</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_and-5" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#727">source</a><h4 class="code-header">pub fn <a href="#method.fetch_and-5" class="fnname">fetch_and</a>(&amp;self, val: i32) -&gt; i32</h4></section></summary><div class="docblock"><p>Applies bitwise “and” to the current value and returns the previous value.</p>
<h5 id="examples-53"><a href="#examples-53">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i32</span>);
<span class="macro">assert_eq!</span>(a.fetch_and(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">3</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_nand-5" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#727">source</a><h4 class="code-header">pub fn <a href="#method.fetch_nand-5" class="fnname">fetch_nand</a>(&amp;self, val: i32) -&gt; i32</h4></section></summary><div class="docblock"><p>Applies bitwise “nand” to the current value and returns the previous value.</p>
<h5 id="examples-54"><a href="#examples-54">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i32</span>);
<span class="macro">assert_eq!</span>(a.fetch_nand(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), !(<span class="number">7 </span>&amp; <span class="number">3</span>));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_or-5" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#727">source</a><h4 class="code-header">pub fn <a href="#method.fetch_or-5" class="fnname">fetch_or</a>(&amp;self, val: i32) -&gt; i32</h4></section></summary><div class="docblock"><p>Applies bitwise “or” to the current value and returns the previous value.</p>
<h5 id="examples-55"><a href="#examples-55">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i32</span>);
<span class="macro">assert_eq!</span>(a.fetch_or(<span class="number">16</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">23</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_xor-5" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#727">source</a><h4 class="code-header">pub fn <a href="#method.fetch_xor-5" class="fnname">fetch_xor</a>(&amp;self, val: i32) -&gt; i32</h4></section></summary><div class="docblock"><p>Applies bitwise “xor” to the current value and returns the previous value.</p>
<h5 id="examples-56"><a href="#examples-56">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i32</span>);
<span class="macro">assert_eq!</span>(a.fetch_xor(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">5</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_max-5" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#727">source</a><h4 class="code-header">pub fn <a href="#method.fetch_max-5" class="fnname">fetch_max</a>(&amp;self, val: i32) -&gt; i32</h4></section></summary><div class="docblock"><p>Compares and sets the maximum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-57"><a href="#examples-57">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i32</span>);
<span class="macro">assert_eq!</span>(a.fetch_max(<span class="number">9</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">9</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_min-5" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#727">source</a><h4 class="code-header">pub fn <a href="#method.fetch_min-5" class="fnname">fetch_min</a>(&amp;self, val: i32) -&gt; i32</h4></section></summary><div class="docblock"><p>Compares and sets the minimum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-58"><a href="#examples-58">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i32</span>);
<span class="macro">assert_eq!</span>(a.fetch_min(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">2</span>);</code></pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-AtomicCell%3Cu64%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#729">source</a><a href="#impl-AtomicCell%3Cu64%3E" class="anchor"></a><h3 class="code-header">impl <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;u64&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_add-6" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#729">source</a><h4 class="code-header">pub fn <a href="#method.fetch_add-6" class="fnname">fetch_add</a>(&amp;self, val: u64) -&gt; u64</h4></section></summary><div class="docblock"><p>Increments the current value by <code>val</code> and returns the previous value.</p>
<p>The addition wraps on overflow.</p>
<h5 id="examples-59"><a href="#examples-59">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u64</span>);
<span class="macro">assert_eq!</span>(a.fetch_add(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">10</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_sub-6" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#729">source</a><h4 class="code-header">pub fn <a href="#method.fetch_sub-6" class="fnname">fetch_sub</a>(&amp;self, val: u64) -&gt; u64</h4></section></summary><div class="docblock"><p>Decrements the current value by <code>val</code> and returns the previous value.</p>
<p>The subtraction wraps on overflow.</p>
<h5 id="examples-60"><a href="#examples-60">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u64</span>);
<span class="macro">assert_eq!</span>(a.fetch_sub(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">4</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_and-6" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#729">source</a><h4 class="code-header">pub fn <a href="#method.fetch_and-6" class="fnname">fetch_and</a>(&amp;self, val: u64) -&gt; u64</h4></section></summary><div class="docblock"><p>Applies bitwise “and” to the current value and returns the previous value.</p>
<h5 id="examples-61"><a href="#examples-61">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u64</span>);
<span class="macro">assert_eq!</span>(a.fetch_and(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">3</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_nand-6" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#729">source</a><h4 class="code-header">pub fn <a href="#method.fetch_nand-6" class="fnname">fetch_nand</a>(&amp;self, val: u64) -&gt; u64</h4></section></summary><div class="docblock"><p>Applies bitwise “nand” to the current value and returns the previous value.</p>
<h5 id="examples-62"><a href="#examples-62">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u64</span>);
<span class="macro">assert_eq!</span>(a.fetch_nand(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), !(<span class="number">7 </span>&amp; <span class="number">3</span>));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_or-6" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#729">source</a><h4 class="code-header">pub fn <a href="#method.fetch_or-6" class="fnname">fetch_or</a>(&amp;self, val: u64) -&gt; u64</h4></section></summary><div class="docblock"><p>Applies bitwise “or” to the current value and returns the previous value.</p>
<h5 id="examples-63"><a href="#examples-63">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u64</span>);
<span class="macro">assert_eq!</span>(a.fetch_or(<span class="number">16</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">23</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_xor-6" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#729">source</a><h4 class="code-header">pub fn <a href="#method.fetch_xor-6" class="fnname">fetch_xor</a>(&amp;self, val: u64) -&gt; u64</h4></section></summary><div class="docblock"><p>Applies bitwise “xor” to the current value and returns the previous value.</p>
<h5 id="examples-64"><a href="#examples-64">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u64</span>);
<span class="macro">assert_eq!</span>(a.fetch_xor(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">5</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_max-6" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#729">source</a><h4 class="code-header">pub fn <a href="#method.fetch_max-6" class="fnname">fetch_max</a>(&amp;self, val: u64) -&gt; u64</h4></section></summary><div class="docblock"><p>Compares and sets the maximum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-65"><a href="#examples-65">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u64</span>);
<span class="macro">assert_eq!</span>(a.fetch_max(<span class="number">9</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">9</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_min-6" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#729">source</a><h4 class="code-header">pub fn <a href="#method.fetch_min-6" class="fnname">fetch_min</a>(&amp;self, val: u64) -&gt; u64</h4></section></summary><div class="docblock"><p>Compares and sets the minimum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-66"><a href="#examples-66">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u64</span>);
<span class="macro">assert_eq!</span>(a.fetch_min(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">2</span>);</code></pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-AtomicCell%3Ci64%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#731">source</a><a href="#impl-AtomicCell%3Ci64%3E" class="anchor"></a><h3 class="code-header">impl <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;i64&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_add-7" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#731">source</a><h4 class="code-header">pub fn <a href="#method.fetch_add-7" class="fnname">fetch_add</a>(&amp;self, val: i64) -&gt; i64</h4></section></summary><div class="docblock"><p>Increments the current value by <code>val</code> and returns the previous value.</p>
<p>The addition wraps on overflow.</p>
<h5 id="examples-67"><a href="#examples-67">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i64</span>);
<span class="macro">assert_eq!</span>(a.fetch_add(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">10</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_sub-7" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#731">source</a><h4 class="code-header">pub fn <a href="#method.fetch_sub-7" class="fnname">fetch_sub</a>(&amp;self, val: i64) -&gt; i64</h4></section></summary><div class="docblock"><p>Decrements the current value by <code>val</code> and returns the previous value.</p>
<p>The subtraction wraps on overflow.</p>
<h5 id="examples-68"><a href="#examples-68">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i64</span>);
<span class="macro">assert_eq!</span>(a.fetch_sub(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">4</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_and-7" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#731">source</a><h4 class="code-header">pub fn <a href="#method.fetch_and-7" class="fnname">fetch_and</a>(&amp;self, val: i64) -&gt; i64</h4></section></summary><div class="docblock"><p>Applies bitwise “and” to the current value and returns the previous value.</p>
<h5 id="examples-69"><a href="#examples-69">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i64</span>);
<span class="macro">assert_eq!</span>(a.fetch_and(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">3</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_nand-7" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#731">source</a><h4 class="code-header">pub fn <a href="#method.fetch_nand-7" class="fnname">fetch_nand</a>(&amp;self, val: i64) -&gt; i64</h4></section></summary><div class="docblock"><p>Applies bitwise “nand” to the current value and returns the previous value.</p>
<h5 id="examples-70"><a href="#examples-70">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i64</span>);
<span class="macro">assert_eq!</span>(a.fetch_nand(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), !(<span class="number">7 </span>&amp; <span class="number">3</span>));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_or-7" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#731">source</a><h4 class="code-header">pub fn <a href="#method.fetch_or-7" class="fnname">fetch_or</a>(&amp;self, val: i64) -&gt; i64</h4></section></summary><div class="docblock"><p>Applies bitwise “or” to the current value and returns the previous value.</p>
<h5 id="examples-71"><a href="#examples-71">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i64</span>);
<span class="macro">assert_eq!</span>(a.fetch_or(<span class="number">16</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">23</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_xor-7" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#731">source</a><h4 class="code-header">pub fn <a href="#method.fetch_xor-7" class="fnname">fetch_xor</a>(&amp;self, val: i64) -&gt; i64</h4></section></summary><div class="docblock"><p>Applies bitwise “xor” to the current value and returns the previous value.</p>
<h5 id="examples-72"><a href="#examples-72">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i64</span>);
<span class="macro">assert_eq!</span>(a.fetch_xor(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">5</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_max-7" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#731">source</a><h4 class="code-header">pub fn <a href="#method.fetch_max-7" class="fnname">fetch_max</a>(&amp;self, val: i64) -&gt; i64</h4></section></summary><div class="docblock"><p>Compares and sets the maximum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-73"><a href="#examples-73">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i64</span>);
<span class="macro">assert_eq!</span>(a.fetch_max(<span class="number">9</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">9</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_min-7" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#731">source</a><h4 class="code-header">pub fn <a href="#method.fetch_min-7" class="fnname">fetch_min</a>(&amp;self, val: i64) -&gt; i64</h4></section></summary><div class="docblock"><p>Compares and sets the minimum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-74"><a href="#examples-74">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i64</span>);
<span class="macro">assert_eq!</span>(a.fetch_min(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">2</span>);</code></pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-AtomicCell%3Cu128%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#739">source</a><a href="#impl-AtomicCell%3Cu128%3E" class="anchor"></a><h3 class="code-header">impl <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;u128&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_add-8" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#739">source</a><h4 class="code-header">pub fn <a href="#method.fetch_add-8" class="fnname">fetch_add</a>(&amp;self, val: u128) -&gt; u128</h4></section></summary><div class="docblock"><p>Increments the current value by <code>val</code> and returns the previous value.</p>
<p>The addition wraps on overflow.</p>
<h5 id="examples-75"><a href="#examples-75">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u128</span>);
<span class="macro">assert_eq!</span>(a.fetch_add(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">10</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_sub-8" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#739">source</a><h4 class="code-header">pub fn <a href="#method.fetch_sub-8" class="fnname">fetch_sub</a>(&amp;self, val: u128) -&gt; u128</h4></section></summary><div class="docblock"><p>Decrements the current value by <code>val</code> and returns the previous value.</p>
<p>The subtraction wraps on overflow.</p>
<h5 id="examples-76"><a href="#examples-76">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u128</span>);
<span class="macro">assert_eq!</span>(a.fetch_sub(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">4</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_and-8" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#739">source</a><h4 class="code-header">pub fn <a href="#method.fetch_and-8" class="fnname">fetch_and</a>(&amp;self, val: u128) -&gt; u128</h4></section></summary><div class="docblock"><p>Applies bitwise “and” to the current value and returns the previous value.</p>
<h5 id="examples-77"><a href="#examples-77">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u128</span>);
<span class="macro">assert_eq!</span>(a.fetch_and(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">3</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_nand-8" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#739">source</a><h4 class="code-header">pub fn <a href="#method.fetch_nand-8" class="fnname">fetch_nand</a>(&amp;self, val: u128) -&gt; u128</h4></section></summary><div class="docblock"><p>Applies bitwise “nand” to the current value and returns the previous value.</p>
<h5 id="examples-78"><a href="#examples-78">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u128</span>);
<span class="macro">assert_eq!</span>(a.fetch_nand(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), !(<span class="number">7 </span>&amp; <span class="number">3</span>));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_or-8" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#739">source</a><h4 class="code-header">pub fn <a href="#method.fetch_or-8" class="fnname">fetch_or</a>(&amp;self, val: u128) -&gt; u128</h4></section></summary><div class="docblock"><p>Applies bitwise “or” to the current value and returns the previous value.</p>
<h5 id="examples-79"><a href="#examples-79">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u128</span>);
<span class="macro">assert_eq!</span>(a.fetch_or(<span class="number">16</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">23</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_xor-8" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#739">source</a><h4 class="code-header">pub fn <a href="#method.fetch_xor-8" class="fnname">fetch_xor</a>(&amp;self, val: u128) -&gt; u128</h4></section></summary><div class="docblock"><p>Applies bitwise “xor” to the current value and returns the previous value.</p>
<h5 id="examples-80"><a href="#examples-80">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u128</span>);
<span class="macro">assert_eq!</span>(a.fetch_xor(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">5</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_max-8" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#739">source</a><h4 class="code-header">pub fn <a href="#method.fetch_max-8" class="fnname">fetch_max</a>(&amp;self, val: u128) -&gt; u128</h4></section></summary><div class="docblock"><p>Compares and sets the maximum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-81"><a href="#examples-81">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u128</span>);
<span class="macro">assert_eq!</span>(a.fetch_max(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">7</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_min-8" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#739">source</a><h4 class="code-header">pub fn <a href="#method.fetch_min-8" class="fnname">fetch_min</a>(&amp;self, val: u128) -&gt; u128</h4></section></summary><div class="docblock"><p>Compares and sets the minimum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-82"><a href="#examples-82">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7u128</span>);
<span class="macro">assert_eq!</span>(a.fetch_min(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">2</span>);</code></pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-AtomicCell%3Ci128%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#740">source</a><a href="#impl-AtomicCell%3Ci128%3E" class="anchor"></a><h3 class="code-header">impl <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;i128&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_add-9" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#740">source</a><h4 class="code-header">pub fn <a href="#method.fetch_add-9" class="fnname">fetch_add</a>(&amp;self, val: i128) -&gt; i128</h4></section></summary><div class="docblock"><p>Increments the current value by <code>val</code> and returns the previous value.</p>
<p>The addition wraps on overflow.</p>
<h5 id="examples-83"><a href="#examples-83">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i128</span>);
<span class="macro">assert_eq!</span>(a.fetch_add(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">10</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_sub-9" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#740">source</a><h4 class="code-header">pub fn <a href="#method.fetch_sub-9" class="fnname">fetch_sub</a>(&amp;self, val: i128) -&gt; i128</h4></section></summary><div class="docblock"><p>Decrements the current value by <code>val</code> and returns the previous value.</p>
<p>The subtraction wraps on overflow.</p>
<h5 id="examples-84"><a href="#examples-84">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i128</span>);
<span class="macro">assert_eq!</span>(a.fetch_sub(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">4</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_and-9" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#740">source</a><h4 class="code-header">pub fn <a href="#method.fetch_and-9" class="fnname">fetch_and</a>(&amp;self, val: i128) -&gt; i128</h4></section></summary><div class="docblock"><p>Applies bitwise “and” to the current value and returns the previous value.</p>
<h5 id="examples-85"><a href="#examples-85">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i128</span>);
<span class="macro">assert_eq!</span>(a.fetch_and(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">3</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_nand-9" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#740">source</a><h4 class="code-header">pub fn <a href="#method.fetch_nand-9" class="fnname">fetch_nand</a>(&amp;self, val: i128) -&gt; i128</h4></section></summary><div class="docblock"><p>Applies bitwise “nand” to the current value and returns the previous value.</p>
<h5 id="examples-86"><a href="#examples-86">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i128</span>);
<span class="macro">assert_eq!</span>(a.fetch_nand(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), !(<span class="number">7 </span>&amp; <span class="number">3</span>));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_or-9" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#740">source</a><h4 class="code-header">pub fn <a href="#method.fetch_or-9" class="fnname">fetch_or</a>(&amp;self, val: i128) -&gt; i128</h4></section></summary><div class="docblock"><p>Applies bitwise “or” to the current value and returns the previous value.</p>
<h5 id="examples-87"><a href="#examples-87">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i128</span>);
<span class="macro">assert_eq!</span>(a.fetch_or(<span class="number">16</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">23</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_xor-9" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#740">source</a><h4 class="code-header">pub fn <a href="#method.fetch_xor-9" class="fnname">fetch_xor</a>(&amp;self, val: i128) -&gt; i128</h4></section></summary><div class="docblock"><p>Applies bitwise “xor” to the current value and returns the previous value.</p>
<h5 id="examples-88"><a href="#examples-88">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i128</span>);
<span class="macro">assert_eq!</span>(a.fetch_xor(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">5</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_max-9" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#740">source</a><h4 class="code-header">pub fn <a href="#method.fetch_max-9" class="fnname">fetch_max</a>(&amp;self, val: i128) -&gt; i128</h4></section></summary><div class="docblock"><p>Compares and sets the maximum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-89"><a href="#examples-89">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i128</span>);
<span class="macro">assert_eq!</span>(a.fetch_max(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">7</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_min-9" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#740">source</a><h4 class="code-header">pub fn <a href="#method.fetch_min-9" class="fnname">fetch_min</a>(&amp;self, val: i128) -&gt; i128</h4></section></summary><div class="docblock"><p>Compares and sets the minimum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-90"><a href="#examples-90">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7i128</span>);
<span class="macro">assert_eq!</span>(a.fetch_min(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">2</span>);</code></pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-AtomicCell%3Cusize%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#742-746">source</a><a href="#impl-AtomicCell%3Cusize%3E" class="anchor"></a><h3 class="code-header">impl <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;usize&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_add-10" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#742-746">source</a><h4 class="code-header">pub fn <a href="#method.fetch_add-10" class="fnname">fetch_add</a>(&amp;self, val: usize) -&gt; usize</h4></section></summary><div class="docblock"><p>Increments the current value by <code>val</code> and returns the previous value.</p>
<p>The addition wraps on overflow.</p>
<h5 id="examples-91"><a href="#examples-91">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7usize</span>);
<span class="macro">assert_eq!</span>(a.fetch_add(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">10</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_sub-10" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#742-746">source</a><h4 class="code-header">pub fn <a href="#method.fetch_sub-10" class="fnname">fetch_sub</a>(&amp;self, val: usize) -&gt; usize</h4></section></summary><div class="docblock"><p>Decrements the current value by <code>val</code> and returns the previous value.</p>
<p>The subtraction wraps on overflow.</p>
<h5 id="examples-92"><a href="#examples-92">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7usize</span>);
<span class="macro">assert_eq!</span>(a.fetch_sub(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">4</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_and-10" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#742-746">source</a><h4 class="code-header">pub fn <a href="#method.fetch_and-10" class="fnname">fetch_and</a>(&amp;self, val: usize) -&gt; usize</h4></section></summary><div class="docblock"><p>Applies bitwise “and” to the current value and returns the previous value.</p>
<h5 id="examples-93"><a href="#examples-93">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7usize</span>);
<span class="macro">assert_eq!</span>(a.fetch_and(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">3</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_nand-10" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#742-746">source</a><h4 class="code-header">pub fn <a href="#method.fetch_nand-10" class="fnname">fetch_nand</a>(&amp;self, val: usize) -&gt; usize</h4></section></summary><div class="docblock"><p>Applies bitwise “nand” to the current value and returns the previous value.</p>
<h5 id="examples-94"><a href="#examples-94">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7usize</span>);
<span class="macro">assert_eq!</span>(a.fetch_nand(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), !(<span class="number">7 </span>&amp; <span class="number">3</span>));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_or-10" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#742-746">source</a><h4 class="code-header">pub fn <a href="#method.fetch_or-10" class="fnname">fetch_or</a>(&amp;self, val: usize) -&gt; usize</h4></section></summary><div class="docblock"><p>Applies bitwise “or” to the current value and returns the previous value.</p>
<h5 id="examples-95"><a href="#examples-95">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7usize</span>);
<span class="macro">assert_eq!</span>(a.fetch_or(<span class="number">16</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">23</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_xor-10" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#742-746">source</a><h4 class="code-header">pub fn <a href="#method.fetch_xor-10" class="fnname">fetch_xor</a>(&amp;self, val: usize) -&gt; usize</h4></section></summary><div class="docblock"><p>Applies bitwise “xor” to the current value and returns the previous value.</p>
<h5 id="examples-96"><a href="#examples-96">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7usize</span>);
<span class="macro">assert_eq!</span>(a.fetch_xor(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">5</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_max-10" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#742-746">source</a><h4 class="code-header">pub fn <a href="#method.fetch_max-10" class="fnname">fetch_max</a>(&amp;self, val: usize) -&gt; usize</h4></section></summary><div class="docblock"><p>Compares and sets the maximum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-97"><a href="#examples-97">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7usize</span>);
<span class="macro">assert_eq!</span>(a.fetch_max(<span class="number">9</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">9</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_min-10" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#742-746">source</a><h4 class="code-header">pub fn <a href="#method.fetch_min-10" class="fnname">fetch_min</a>(&amp;self, val: usize) -&gt; usize</h4></section></summary><div class="docblock"><p>Compares and sets the minimum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-98"><a href="#examples-98">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7usize</span>);
<span class="macro">assert_eq!</span>(a.fetch_min(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">2</span>);</code></pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-AtomicCell%3Cisize%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#747-751">source</a><a href="#impl-AtomicCell%3Cisize%3E" class="anchor"></a><h3 class="code-header">impl <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;isize&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_add-11" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#747-751">source</a><h4 class="code-header">pub fn <a href="#method.fetch_add-11" class="fnname">fetch_add</a>(&amp;self, val: isize) -&gt; isize</h4></section></summary><div class="docblock"><p>Increments the current value by <code>val</code> and returns the previous value.</p>
<p>The addition wraps on overflow.</p>
<h5 id="examples-99"><a href="#examples-99">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7isize</span>);
<span class="macro">assert_eq!</span>(a.fetch_add(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">10</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_sub-11" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#747-751">source</a><h4 class="code-header">pub fn <a href="#method.fetch_sub-11" class="fnname">fetch_sub</a>(&amp;self, val: isize) -&gt; isize</h4></section></summary><div class="docblock"><p>Decrements the current value by <code>val</code> and returns the previous value.</p>
<p>The subtraction wraps on overflow.</p>
<h5 id="examples-100"><a href="#examples-100">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7isize</span>);
<span class="macro">assert_eq!</span>(a.fetch_sub(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">4</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_and-11" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#747-751">source</a><h4 class="code-header">pub fn <a href="#method.fetch_and-11" class="fnname">fetch_and</a>(&amp;self, val: isize) -&gt; isize</h4></section></summary><div class="docblock"><p>Applies bitwise “and” to the current value and returns the previous value.</p>
<h5 id="examples-101"><a href="#examples-101">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7isize</span>);
<span class="macro">assert_eq!</span>(a.fetch_and(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">3</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_nand-11" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#747-751">source</a><h4 class="code-header">pub fn <a href="#method.fetch_nand-11" class="fnname">fetch_nand</a>(&amp;self, val: isize) -&gt; isize</h4></section></summary><div class="docblock"><p>Applies bitwise “nand” to the current value and returns the previous value.</p>
<h5 id="examples-102"><a href="#examples-102">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7isize</span>);
<span class="macro">assert_eq!</span>(a.fetch_nand(<span class="number">3</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), !(<span class="number">7 </span>&amp; <span class="number">3</span>));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_or-11" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#747-751">source</a><h4 class="code-header">pub fn <a href="#method.fetch_or-11" class="fnname">fetch_or</a>(&amp;self, val: isize) -&gt; isize</h4></section></summary><div class="docblock"><p>Applies bitwise “or” to the current value and returns the previous value.</p>
<h5 id="examples-103"><a href="#examples-103">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7isize</span>);
<span class="macro">assert_eq!</span>(a.fetch_or(<span class="number">16</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">23</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_xor-11" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#747-751">source</a><h4 class="code-header">pub fn <a href="#method.fetch_xor-11" class="fnname">fetch_xor</a>(&amp;self, val: isize) -&gt; isize</h4></section></summary><div class="docblock"><p>Applies bitwise “xor” to the current value and returns the previous value.</p>
<h5 id="examples-104"><a href="#examples-104">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7isize</span>);
<span class="macro">assert_eq!</span>(a.fetch_xor(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">5</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_max-11" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#747-751">source</a><h4 class="code-header">pub fn <a href="#method.fetch_max-11" class="fnname">fetch_max</a>(&amp;self, val: isize) -&gt; isize</h4></section></summary><div class="docblock"><p>Compares and sets the maximum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-105"><a href="#examples-105">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7isize</span>);
<span class="macro">assert_eq!</span>(a.fetch_max(<span class="number">9</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">9</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_min-11" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#747-751">source</a><h4 class="code-header">pub fn <a href="#method.fetch_min-11" class="fnname">fetch_min</a>(&amp;self, val: isize) -&gt; isize</h4></section></summary><div class="docblock"><p>Compares and sets the minimum of the current value and <code>val</code>,
and returns the previous value.</p>
<h5 id="examples-106"><a href="#examples-106">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="number">7isize</span>);
<span class="macro">assert_eq!</span>(a.fetch_min(<span class="number">2</span>), <span class="number">7</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="number">2</span>);</code></pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-AtomicCell%3Cbool%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#753-840">source</a><a href="#impl-AtomicCell%3Cbool%3E" class="anchor"></a><h3 class="code-header">impl <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;bool&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_and-12" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#770-773">source</a><h4 class="code-header">pub fn <a href="#method.fetch_and-12" class="fnname">fetch_and</a>(&amp;self, val: bool) -&gt; bool</h4></section></summary><div class="docblock"><p>Applies logical “and” to the current value and returns the previous value.</p>
<h5 id="examples-107"><a href="#examples-107">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="bool-val">true</span>);
<span class="macro">assert_eq!</span>(a.fetch_and(<span class="bool-val">true</span>), <span class="bool-val">true</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="bool-val">true</span>);
<span class="macro">assert_eq!</span>(a.fetch_and(<span class="bool-val">false</span>), <span class="bool-val">true</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="bool-val">false</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_nand-12" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#794-797">source</a><h4 class="code-header">pub fn <a href="#method.fetch_nand-12" class="fnname">fetch_nand</a>(&amp;self, val: bool) -&gt; bool</h4></section></summary><div class="docblock"><p>Applies logical “nand” to the current value and returns the previous value.</p>
<h5 id="examples-108"><a href="#examples-108">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="bool-val">true</span>);
<span class="macro">assert_eq!</span>(a.fetch_nand(<span class="bool-val">false</span>), <span class="bool-val">true</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="bool-val">true</span>);
<span class="macro">assert_eq!</span>(a.fetch_nand(<span class="bool-val">true</span>), <span class="bool-val">true</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="bool-val">false</span>);
<span class="macro">assert_eq!</span>(a.fetch_nand(<span class="bool-val">false</span>), <span class="bool-val">false</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="bool-val">true</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_or-12" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#815-818">source</a><h4 class="code-header">pub fn <a href="#method.fetch_or-12" class="fnname">fetch_or</a>(&amp;self, val: bool) -&gt; bool</h4></section></summary><div class="docblock"><p>Applies logical “or” to the current value and returns the previous value.</p>
<h5 id="examples-109"><a href="#examples-109">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="bool-val">false</span>);
<span class="macro">assert_eq!</span>(a.fetch_or(<span class="bool-val">false</span>), <span class="bool-val">false</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="bool-val">false</span>);
<span class="macro">assert_eq!</span>(a.fetch_or(<span class="bool-val">true</span>), <span class="bool-val">false</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="bool-val">true</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fetch_xor-12" class="method has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#836-839">source</a><h4 class="code-header">pub fn <a href="#method.fetch_xor-12" class="fnname">fetch_xor</a>(&amp;self, val: bool) -&gt; bool</h4></section></summary><div class="docblock"><p>Applies logical “xor” to the current value and returns the previous value.</p>
<h5 id="examples-110"><a href="#examples-110">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>crossbeam_utils::atomic::AtomicCell;
<span class="kw">let </span>a = AtomicCell::new(<span class="bool-val">true</span>);
<span class="macro">assert_eq!</span>(a.fetch_xor(<span class="bool-val">false</span>), <span class="bool-val">true</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="bool-val">true</span>);
<span class="macro">assert_eq!</span>(a.fetch_xor(<span class="bool-val">true</span>), <span class="bool-val">true</span>);
<span class="macro">assert_eq!</span>(a.load(), <span class="bool-val">false</span>);</code></pre></div>
</div></details></div></details></div><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" open><summary><section id="impl-Debug-for-AtomicCell%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#855-861">source</a><a href="#impl-Debug-for-AtomicCell%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T:&nbsp;Copy + Debug&gt; Debug for <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#856-860">source</a><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a class="fnname">fmt</a>(&amp;self, f: &amp;mut Formatter&lt;'_&gt;) -&gt; Result</h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Default-for-AtomicCell%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#842-846">source</a><a href="#impl-Default-for-AtomicCell%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T:&nbsp;Default&gt; Default for <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.default" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#843-845">source</a><a href="#method.default" class="anchor"></a><h4 class="code-header">fn <a class="fnname">default</a>() -&gt; <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;T&gt;</h4></section></summary><div class='docblock'>Returns the “default value” for a type. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Drop-for-AtomicCell%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#311-323">source</a><a href="#impl-Drop-for-AtomicCell%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; Drop for <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.drop" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#312-322">source</a><a href="#method.drop" class="anchor"></a><h4 class="code-header">fn <a class="fnname">drop</a>(&amp;mut self)</h4></section></summary><div class='docblock'>Executes the destructor for this type. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-From%3CT%3E-for-AtomicCell%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#848-853">source</a><a href="#impl-From%3CT%3E-for-AtomicCell%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; From&lt;T&gt; for <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#850-852">source</a><a href="#method.from" class="anchor"></a><h4 class="code-header">fn <a class="fnname">from</a>(val: T) -&gt; <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;T&gt;</h4></section></summary><div class='docblock'>Converts to this type from the input type.</div></details></div></details><section id="impl-RefUnwindSafe-for-AtomicCell%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#55">source</a><a href="#impl-RefUnwindSafe-for-AtomicCell%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; RefUnwindSafe for <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;T&gt;</h3></section><section id="impl-Send-for-AtomicCell%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#49">source</a><a href="#impl-Send-for-AtomicCell%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T:&nbsp;Send&gt; Send for <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;T&gt;</h3></section><section id="impl-Sync-for-AtomicCell%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#50">source</a><a href="#impl-Sync-for-AtomicCell%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T:&nbsp;Send&gt; Sync for <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;T&gt;</h3></section><section id="impl-UnwindSafe-for-AtomicCell%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/crossbeam_utils/atomic/atomic_cell.rs.html#53">source</a><a href="#impl-UnwindSafe-for-AtomicCell%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; UnwindSafe for <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;T&gt;</h3></section></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"><section id="impl-Unpin-for-AtomicCell%3CT%3E" class="impl has-srclink"><a href="#impl-Unpin-for-AtomicCell%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; Unpin for <a class="struct" href="struct.AtomicCell.html" title="struct crossbeam_utils::atomic::AtomicCell">AtomicCell</a>&lt;T&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Unpin,</span></h3></section></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><section id="impl-Any-for-AtomicCell%3CT%3E" class="impl has-srclink"><a href="#impl-Any-for-AtomicCell%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; Any for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><a href="#method.type_id" class="anchor"></a><h4 class="code-header">fn <a class="fnname">type_id</a>(&amp;self) -&gt; TypeId</h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-AtomicCell%3CT%3E" class="impl has-srclink"><a href="#impl-Borrow%3CT%3E-for-AtomicCell%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; Borrow&lt;T&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span><a href="#method.borrow" class="anchor"></a><h4 class="code-header">fn <a class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-AtomicCell%3CT%3E" class="impl has-srclink"><a href="#impl-BorrowMut%3CT%3E-for-AtomicCell%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; BorrowMut&lt;T&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">fn <a class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3C!%3E-for-AtomicCell%3CT%3E" class="impl has-srclink"><a href="#impl-From%3C!%3E-for-AtomicCell%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; From&lt;!&gt; for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from-2" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.from-2" class="anchor"></a><h4 class="code-header">fn <a class="fnname">from</a>(t: !) -&gt; T</h4></section></summary><div class='docblock'>Converts to this type from the input type.</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-AtomicCell%3CT%3E-1" class="impl has-srclink"><a href="#impl-From%3CT%3E-for-AtomicCell%3CT%3E-1" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; From&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from-1" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.from-1" class="anchor"></a><h4 class="code-header">fn <a class="fnname">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-AtomicCell%3CT%3E" class="impl has-srclink"><a href="#impl-Into%3CU%3E-for-AtomicCell%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; Into&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: From&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.into" class="anchor"></a><h4 class="code-header">fn <a class="fnname">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code>[From]&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-AtomicCell%3CT%3E" class="impl has-srclink"><a href="#impl-TryFrom%3CU%3E-for-AtomicCell%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; TryFrom&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: Into&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Error</a> = Infallible</h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.try_from" class="anchor"></a><h4 class="code-header">fn <a class="fnname">try_from</a>(value: U) -&gt; Result&lt;T, &lt;T as TryFrom&lt;U&gt;&gt;::Error&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-AtomicCell%3CT%3E" class="impl has-srclink"><a href="#impl-TryInto%3CU%3E-for-AtomicCell%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; TryInto&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: TryFrom&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Error</a> = &lt;U as TryFrom&lt;T&gt;&gt;::Error</h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.try_into" class="anchor"></a><h4 class="code-header">fn <a class="fnname">try_into</a>(self) -&gt; Result&lt;U, &lt;U as TryFrom&lt;T&gt;&gt;::Error&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="crossbeam_utils" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>