332 lines
51 KiB
HTML
332 lines
51 KiB
HTML
|
<!DOCTYPE html>
|
|||
|
<html lang="en">
|
|||
|
<head>
|
|||
|
<meta charset="utf-8">
|
|||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|||
|
<meta name="generator" content="rustdoc">
|
|||
|
<meta name="description" content="API documentation for the Rust `Shared` struct in crate `crossbeam_epoch`.">
|
|||
|
<meta name="keywords" content="rust, rustlang, rust-lang, Shared">
|
|||
|
|
|||
|
<title>crossbeam_epoch::Shared - Rust</title>
|
|||
|
|
|||
|
<link rel="stylesheet" type="text/css" href="../normalize.css">
|
|||
|
<link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle">
|
|||
|
|
|||
|
<link rel="stylesheet" type="text/css" href="../dark.css">
|
|||
|
<link rel="stylesheet" type="text/css" href="../main.css" id="themeStyle">
|
|||
|
<script src="../storage.js"></script>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</head>
|
|||
|
<body class="rustdoc struct">
|
|||
|
<!--[if lte IE 8]>
|
|||
|
<div class="warning">
|
|||
|
This old browser is unsupported and will most likely display funky
|
|||
|
things.
|
|||
|
</div>
|
|||
|
<![endif]-->
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<nav class="sidebar">
|
|||
|
<div class="sidebar-menu">☰</div>
|
|||
|
|
|||
|
<p class='location'>Struct Shared</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.null">null</a><a href="#method.is_null">is_null</a><a href="#method.as_raw">as_raw</a><a href="#method.deref">deref</a><a href="#method.as_ref">as_ref</a><a href="#method.into_owned">into_owned</a><a href="#method.tag">tag</a><a href="#method.with_tag">with_tag</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-From%3CShared%3C%27g%2C%20T%3E%3E">From<Shared<'g, T>></a><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Pointer%3CT%3E">Pointer<T></a><a href="#impl-From%3C*const%20T%3E">From<*const T></a><a href="#impl-PartialEq%3CShared%3C%27g%2C%20T%3E%3E">PartialEq<Shared<'g, T>></a><a href="#impl-Eq">Eq</a><a href="#impl-PartialOrd%3CShared%3C%27g%2C%20T%3E%3E">PartialOrd<Shared<'g, T>></a><a href="#impl-Ord">Ord</a><a href="#impl-Debug">Debug</a><a href="#impl-Pointer">Pointer</a><a href="#impl-Default">Default</a></div></div><p class='location'><a href='index.html'>crossbeam_epoch</a></p><script>window.sidebarCurrent = {name: 'Shared', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
|
|||
|
</nav>
|
|||
|
|
|||
|
<div class="theme-picker">
|
|||
|
<button id="theme-picker" aria-label="Pick another theme!">
|
|||
|
<img src="../brush.svg" width="18" alt="Pick another theme!">
|
|||
|
</button>
|
|||
|
<div id="theme-choices"></div>
|
|||
|
</div>
|
|||
|
<script src="../theme.js"></script>
|
|||
|
<nav class="sub">
|
|||
|
<form class="search-form js-only">
|
|||
|
<div class="search-container">
|
|||
|
<input class="search-input" name="search"
|
|||
|
autocomplete="off"
|
|||
|
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
|
|||
|
type="search">
|
|||
|
</div>
|
|||
|
</form>
|
|||
|
</nav>
|
|||
|
|
|||
|
<section id='main' class="content">
|
|||
|
<h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>crossbeam_epoch</a>::<wbr><a class="struct" href=''>Shared</a></span><span class='out-of-band'><span id='render-detail'>
|
|||
|
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
|
|||
|
[<span class='inner'>−</span>]
|
|||
|
</a>
|
|||
|
</span><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#816-819' title='goto source code'>[src]</a></span></h1>
|
|||
|
<pre class='rust struct'>pub struct Shared<'g, T: 'g> { /* fields omitted */ }</pre><div class='docblock'><p>A pointer to an object protected by the epoch GC.</p>
|
|||
|
<p>The pointer is valid for use only during the lifetime <code>'g</code>.</p>
|
|||
|
<p>The pointer must be properly aligned. Since it is aligned, a tag can be stored into the unused
|
|||
|
least significant bits of the address.</p>
|
|||
|
</div>
|
|||
|
<h2 id='methods' class='small-section-header'>
|
|||
|
Methods<a href='#methods' class='anchor'></a>
|
|||
|
</h2>
|
|||
|
<h3 id='impl' class='impl'><span class='in-band'><code>impl<'g, T> <a class="struct" href="../crossbeam_epoch/struct.Shared.html" title="struct crossbeam_epoch::Shared">Shared</a><'g, T></code><a href='#impl' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#847-1045' title='goto source code'>[src]</a></span></h3>
|
|||
|
<div class='impl-items'><h4 id='method.null' class="method"><span id='null.v' class='invisible'><code>pub fn <a href='#method.null' class='fnname'>null</a>() -> <a class="struct" href="../crossbeam_epoch/struct.Shared.html" title="struct crossbeam_epoch::Shared">Shared</a><'g, T></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#858-863' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>Returns a new null pointer.</p>
|
|||
|
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="kw">use</span> <span class="ident">crossbeam_epoch</span>::<span class="ident">Shared</span>;
|
|||
|
|
|||
|
<span class="kw">let</span> <span class="ident">p</span> <span class="op">=</span> <span class="ident">Shared</span>::<span class="op"><</span><span class="ident">i32</span><span class="op">></span>::<span class="ident">null</span>();
|
|||
|
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">p</span>.<span class="ident">is_null</span>());</pre>
|
|||
|
</div><h4 id='method.is_null' class="method"><span id='is_null.v' class='invisible'><code>pub fn <a href='#method.is_null' class='fnname'>is_null</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#879-881' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>Returns <code>true</code> if the pointer is null.</p>
|
|||
|
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="kw">use</span> <span class="ident">crossbeam_epoch</span>::{<span class="self">self</span> <span class="kw">as</span> <span class="ident">epoch</span>, <span class="ident">Atomic</span>, <span class="ident">Owned</span>};
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">atomic</span>::<span class="ident">Ordering</span>::<span class="ident">SeqCst</span>;
|
|||
|
|
|||
|
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">Atomic</span>::<span class="ident">null</span>();
|
|||
|
<span class="kw">let</span> <span class="ident">guard</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">epoch</span>::<span class="ident">pin</span>();
|
|||
|
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">load</span>(<span class="ident">SeqCst</span>, <span class="ident">guard</span>).<span class="ident">is_null</span>());
|
|||
|
<span class="ident">a</span>.<span class="ident">store</span>(<span class="ident">Owned</span>::<span class="ident">new</span>(<span class="number">1234</span>), <span class="ident">SeqCst</span>);
|
|||
|
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">a</span>.<span class="ident">load</span>(<span class="ident">SeqCst</span>, <span class="ident">guard</span>).<span class="ident">is_null</span>());</pre>
|
|||
|
</div><h4 id='method.as_raw' class="method"><span id='as_raw.v' class='invisible'><code>pub fn <a href='#method.as_raw' class='fnname'>as_raw</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*const T</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#899-902' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>Converts the pointer to a raw pointer (without the tag).</p>
|
|||
|
<h1 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h1>
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="kw">use</span> <span class="ident">crossbeam_epoch</span>::{<span class="self">self</span> <span class="kw">as</span> <span class="ident">epoch</span>, <span class="ident">Atomic</span>, <span class="ident">Owned</span>};
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">atomic</span>::<span class="ident">Ordering</span>::<span class="ident">SeqCst</span>;
|
|||
|
|
|||
|
<span class="kw">let</span> <span class="ident">o</span> <span class="op">=</span> <span class="ident">Owned</span>::<span class="ident">new</span>(<span class="number">1234</span>);
|
|||
|
<span class="kw">let</span> <span class="ident">raw</span> <span class="op">=</span> <span class="kw-2">&</span><span class="kw-2">*</span><span class="ident">o</span> <span class="kw">as</span> <span class="kw-2">*</span><span class="kw">const</span> _;
|
|||
|
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">Atomic</span>::<span class="ident">from</span>(<span class="ident">o</span>);
|
|||
|
|
|||
|
<span class="kw">let</span> <span class="ident">guard</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">epoch</span>::<span class="ident">pin</span>();
|
|||
|
<span class="kw">let</span> <span class="ident">p</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">load</span>(<span class="ident">SeqCst</span>, <span class="ident">guard</span>);
|
|||
|
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">p</span>.<span class="ident">as_raw</span>(), <span class="ident">raw</span>);</pre>
|
|||
|
</div><h4 id='method.deref' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a mut </a>I</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a mut </a>I</h3><code class="content"><span class="where fmt-newline">impl<'a, I> <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a mut </a>I <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline"> type <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::iterator::Iterator::Item">Item</a>;</span><span class="where fmt-newline">impl<'a, R> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a mut </a>R <span class="where fmt-newline">where<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline">impl<'a, W> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a mut </a>W <span class="where fmt-newline">where<br> W: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span></code></div></div><span id='deref.v' class='invisible'><code>pub unsafe fn <a href='#method.deref' class='fnname'>deref</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'g </a>T</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#935-937' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>Dereferences the pointer.</p>
|
|||
|
<p>Returns a reference to the pointee that is valid during the lifetime <code>'g</code>.</p>
|
|||
|
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
|
|||
|
<p>Dereferencing a pointer is unsafe because it could be pointing to invalid memory.</p>
|
|||
|
<p>Another concern is the possiblity of data races due to lack of proper synchronization.
|
|||
|
For example, consider the following scenario:</p>
|
|||
|
<ol>
|
|||
|
<li>A thread creates a new object: <code>a.store(Owned::new(10), Relaxed)</code></li>
|
|||
|
<li>Another thread reads it: <code>*a.load(Relaxed, guard).as_ref().unwrap()</code></li>
|
|||
|
</ol>
|
|||
|
<p>The problem is that relaxed orderings don't synchronize initialization of the object with
|
|||
|
the read from the second thread. This is a data race. A possible solution would be to use
|
|||
|
<code>Release</code> and <code>Acquire</code> orderings.</p>
|
|||
|
<h1 id="examples-3" class="section-header"><a href="#examples-3">Examples</a></h1>
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="kw">use</span> <span class="ident">crossbeam_epoch</span>::{<span class="self">self</span> <span class="kw">as</span> <span class="ident">epoch</span>, <span class="ident">Atomic</span>};
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">atomic</span>::<span class="ident">Ordering</span>::<span class="ident">SeqCst</span>;
|
|||
|
|
|||
|
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">Atomic</span>::<span class="ident">new</span>(<span class="number">1234</span>);
|
|||
|
<span class="kw">let</span> <span class="ident">guard</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">epoch</span>::<span class="ident">pin</span>();
|
|||
|
<span class="kw">let</span> <span class="ident">p</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">load</span>(<span class="ident">SeqCst</span>, <span class="ident">guard</span>);
|
|||
|
<span class="kw">unsafe</span> {
|
|||
|
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">p</span>.<span class="ident">deref</span>(), <span class="kw-2">&</span><span class="number">1234</span>);
|
|||
|
}</pre>
|
|||
|
</div><h4 id='method.as_ref' class="method"><span id='as_ref.v' class='invisible'><code>pub unsafe fn <a href='#method.as_ref' class='fnname'>as_ref</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'g </a>T></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#970-972' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>Converts the pointer to a reference.</p>
|
|||
|
<p>Returns <code>None</code> if the pointer is null, or else a reference to the object wrapped in <code>Some</code>.</p>
|
|||
|
<h1 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h1>
|
|||
|
<p>Dereferencing a pointer is unsafe because it could be pointing to invalid memory.</p>
|
|||
|
<p>Another concern is the possiblity of data races due to lack of proper synchronization.
|
|||
|
For example, consider the following scenario:</p>
|
|||
|
<ol>
|
|||
|
<li>A thread creates a new object: <code>a.store(Owned::new(10), Relaxed)</code></li>
|
|||
|
<li>Another thread reads it: <code>*a.load(Relaxed, guard).as_ref().unwrap()</code></li>
|
|||
|
</ol>
|
|||
|
<p>The problem is that relaxed orderings don't synchronize initialization of the object with
|
|||
|
the read from the second thread. This is a data race. A possible solution would be to use
|
|||
|
<code>Release</code> and <code>Acquire</code> orderings.</p>
|
|||
|
<h1 id="examples-4" class="section-header"><a href="#examples-4">Examples</a></h1>
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="kw">use</span> <span class="ident">crossbeam_epoch</span>::{<span class="self">self</span> <span class="kw">as</span> <span class="ident">epoch</span>, <span class="ident">Atomic</span>};
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">atomic</span>::<span class="ident">Ordering</span>::<span class="ident">SeqCst</span>;
|
|||
|
|
|||
|
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">Atomic</span>::<span class="ident">new</span>(<span class="number">1234</span>);
|
|||
|
<span class="kw">let</span> <span class="ident">guard</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">epoch</span>::<span class="ident">pin</span>();
|
|||
|
<span class="kw">let</span> <span class="ident">p</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">load</span>(<span class="ident">SeqCst</span>, <span class="ident">guard</span>);
|
|||
|
<span class="kw">unsafe</span> {
|
|||
|
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">p</span>.<span class="ident">as_ref</span>(), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="number">1234</span>));
|
|||
|
}</pre>
|
|||
|
</div><h4 id='method.into_owned' class="method"><span id='into_owned.v' class='invisible'><code>pub unsafe fn <a href='#method.into_owned' class='fnname'>into_owned</a>(self) -> <a class="struct" href="../crossbeam_epoch/struct.Owned.html" title="struct crossbeam_epoch::Owned">Owned</a><T></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#998-1004' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>Takes ownership of the pointee.</p>
|
|||
|
<h1 id="panics" class="section-header"><a href="#panics">Panics</a></h1>
|
|||
|
<p>Panics if this pointer is null, but only in debug mode.</p>
|
|||
|
<h1 id="safety-2" class="section-header"><a href="#safety-2">Safety</a></h1>
|
|||
|
<p>This method may be called only if the pointer is valid and nobody else is holding a
|
|||
|
reference to the same object.</p>
|
|||
|
<h1 id="examples-5" class="section-header"><a href="#examples-5">Examples</a></h1>
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="kw">use</span> <span class="ident">crossbeam_epoch</span>::{<span class="self">self</span> <span class="kw">as</span> <span class="ident">epoch</span>, <span class="ident">Atomic</span>};
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">atomic</span>::<span class="ident">Ordering</span>::<span class="ident">SeqCst</span>;
|
|||
|
|
|||
|
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">Atomic</span>::<span class="ident">new</span>(<span class="number">1234</span>);
|
|||
|
<span class="kw">unsafe</span> {
|
|||
|
<span class="kw">let</span> <span class="ident">guard</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">epoch</span>::<span class="ident">unprotected</span>();
|
|||
|
<span class="kw">let</span> <span class="ident">p</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">load</span>(<span class="ident">SeqCst</span>, <span class="ident">guard</span>);
|
|||
|
<span class="ident">drop</span>(<span class="ident">p</span>.<span class="ident">into_owned</span>());
|
|||
|
}</pre>
|
|||
|
</div><h4 id='method.tag' class="method"><span id='tag.v' class='invisible'><code>pub fn <a href='#method.tag' class='fnname'>tag</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#1019-1022' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>Returns the tag stored within the pointer.</p>
|
|||
|
<h1 id="examples-6" class="section-header"><a href="#examples-6">Examples</a></h1>
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="kw">use</span> <span class="ident">crossbeam_epoch</span>::{<span class="self">self</span> <span class="kw">as</span> <span class="ident">epoch</span>, <span class="ident">Atomic</span>, <span class="ident">Owned</span>};
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">atomic</span>::<span class="ident">Ordering</span>::<span class="ident">SeqCst</span>;
|
|||
|
|
|||
|
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">Atomic</span>::<span class="op"><</span><span class="ident">u64</span><span class="op">></span>::<span class="ident">from</span>(<span class="ident">Owned</span>::<span class="ident">new</span>(<span class="number">0u64</span>).<span class="ident">with_tag</span>(<span class="number">2</span>));
|
|||
|
<span class="kw">let</span> <span class="ident">guard</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">epoch</span>::<span class="ident">pin</span>();
|
|||
|
<span class="kw">let</span> <span class="ident">p</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">load</span>(<span class="ident">SeqCst</span>, <span class="ident">guard</span>);
|
|||
|
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">p</span>.<span class="ident">tag</span>(), <span class="number">2</span>);</pre>
|
|||
|
</div><h4 id='method.with_tag' class="method"><span id='with_tag.v' class='invisible'><code>pub fn <a href='#method.with_tag' class='fnname'>with_tag</a>(&self, tag: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="struct" href="../crossbeam_epoch/struct.Shared.html" title="struct crossbeam_epoch::Shared">Shared</a><'g, T></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#1042-1044' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>Returns the same pointer, but tagged with <code>tag</code>. <code>tag</code> is truncated to be fit into the
|
|||
|
unused bits of the pointer to <code>T</code>.</p>
|
|||
|
<h1 id="examples-7" class="section-header"><a href="#examples-7">Examples</a></h1>
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="kw">use</span> <span class="ident">crossbeam_epoch</span>::{<span class="self">self</span> <span class="kw">as</span> <span class="ident">epoch</span>, <span class="ident">Atomic</span>};
|
|||
|
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">sync</span>::<span class="ident">atomic</span>::<span class="ident">Ordering</span>::<span class="ident">SeqCst</span>;
|
|||
|
|
|||
|
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">Atomic</span>::<span class="ident">new</span>(<span class="number">0u64</span>);
|
|||
|
<span class="kw">let</span> <span class="ident">guard</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">epoch</span>::<span class="ident">pin</span>();
|
|||
|
<span class="kw">let</span> <span class="ident">p1</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">load</span>(<span class="ident">SeqCst</span>, <span class="ident">guard</span>);
|
|||
|
<span class="kw">let</span> <span class="ident">p2</span> <span class="op">=</span> <span class="ident">p1</span>.<span class="ident">with_tag</span>(<span class="number">2</span>);
|
|||
|
|
|||
|
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">p1</span>.<span class="ident">tag</span>(), <span class="number">0</span>);
|
|||
|
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">p2</span>.<span class="ident">tag</span>(), <span class="number">2</span>);
|
|||
|
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">p1</span>.<span class="ident">as_raw</span>(), <span class="ident">p2</span>.<span class="ident">as_raw</span>());</pre>
|
|||
|
</div></div>
|
|||
|
<h2 id='implementations' class='small-section-header'>
|
|||
|
Trait Implementations<a href='#implementations' class='anchor'></a>
|
|||
|
</h2>
|
|||
|
<h3 id='impl-From%3CShared%3C%27g%2C%20T%3E%3E' class='impl'><span class='in-band'><code>impl<'g, T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="../crossbeam_epoch/struct.Shared.html" title="struct crossbeam_epoch::Shared">Shared</a><'g, T>> for <a class="struct" href="../crossbeam_epoch/struct.Atomic.html" title="struct crossbeam_epoch::Atomic">Atomic</a><T></code><a href='#impl-From%3CShared%3C%27g%2C%20T%3E%3E' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#542-555' title='goto source code'>[src]</a></span></h3>
|
|||
|
<div class='impl-items'><h4 id='method.from' class="method"><span id='from.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(ptr: <a class="struct" href="../crossbeam_epoch/struct.Shared.html" title="struct crossbeam_epoch::Shared">Shared</a><'g, T>) -> Self</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#552-554' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>Returns a new atomic pointer pointing to <code>ptr</code>.</p>
|
|||
|
<h1 id="examples-8" class="section-header"><a href="#examples-8">Examples</a></h1>
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="kw">use</span> <span class="ident">crossbeam_epoch</span>::{<span class="ident">Atomic</span>, <span class="ident">Shared</span>};
|
|||
|
|
|||
|
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">Atomic</span>::<span class="op"><</span><span class="ident">i32</span><span class="op">></span>::<span class="ident">from</span>(<span class="ident">Shared</span>::<span class="op"><</span><span class="ident">i32</span><span class="op">></span>::<span class="ident">null</span>());</pre>
|
|||
|
</div></div><h3 id='impl-Clone' class='impl'><span class='in-band'><code>impl<'g, T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../crossbeam_epoch/struct.Shared.html" title="struct crossbeam_epoch::Shared">Shared</a><'g, T></code><a href='#impl-Clone' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#821-828' title='goto source code'>[src]</a></span></h3>
|
|||
|
<div class='impl-items'><h4 id='method.clone' class="method"><span id='clone.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> Self</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#822-827' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
|||
|
</div><h4 id='method.clone_from' class="method"><span id='clone_from.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#112-114' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
|||
|
</div></div><h3 id='impl-Copy' class='impl'><span class='in-band'><code>impl<'g, T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../crossbeam_epoch/struct.Shared.html" title="struct crossbeam_epoch::Shared">Shared</a><'g, T></code><a href='#impl-Copy' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#830' title='goto source code'>[src]</a></span></h3>
|
|||
|
<div class='impl-items'></div><h3 id='impl-Pointer%3CT%3E' class='impl'><span class='in-band'><code>impl<'g, T> <a class="trait" href="../crossbeam_epoch/trait.Pointer.html" title="trait crossbeam_epoch::Pointer">Pointer</a><T> for <a class="struct" href="../crossbeam_epoch/struct.Shared.html" title="struct crossbeam_epoch::Shared">Shared</a><'g, T></code><a href='#impl-Pointer%3CT%3E' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#832-845' title='goto source code'>[src]</a></span></h3>
|
|||
|
<div class='impl-items'><h4 id='method.into_usize' class="method"><span id='into_usize.v' class='invisible'><code>fn <a href='../crossbeam_epoch/trait.Pointer.html#tymethod.into_usize' class='fnname'>into_usize</a>(self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#834-836' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>Returns the machine representation of the pointer.</p>
|
|||
|
</div><h4 id='method.from_usize' class="method"><span id='from_usize.v' class='invisible'><code>unsafe fn <a href='../crossbeam_epoch/trait.Pointer.html#tymethod.from_usize' class='fnname'>from_usize</a>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> Self</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#839-844' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>Returns a new pointer pointing to the tagged pointer <code>data</code>.</p>
|
|||
|
</div></div><h3 id='impl-From%3C*const%20T%3E' class='impl'><span class='in-band'><code>impl<'g, T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*const T</a>> for <a class="struct" href="../crossbeam_epoch/struct.Shared.html" title="struct crossbeam_epoch::Shared">Shared</a><'g, T></code><a href='#impl-From%3C*const%20T%3E' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#1047-1066' title='goto source code'>[src]</a></span></h3>
|
|||
|
<div class='impl-items'><h4 id='method.from-1' class="method"><span id='from.v-1' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(raw: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*const T</a>) -> Self</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#1062-1065' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>Returns a new pointer pointing to <code>raw</code>.</p>
|
|||
|
<h1 id="panics-1" class="section-header"><a href="#panics-1">Panics</a></h1>
|
|||
|
<p>Panics if <code>raw</code> is not properly aligned.</p>
|
|||
|
<h1 id="examples-9" class="section-header"><a href="#examples-9">Examples</a></h1>
|
|||
|
<pre class="rust rust-example-rendered">
|
|||
|
<span class="kw">use</span> <span class="ident">crossbeam_epoch</span>::<span class="ident">Shared</span>;
|
|||
|
|
|||
|
<span class="kw">let</span> <span class="ident">p</span> <span class="op">=</span> <span class="kw">unsafe</span> { <span class="ident">Shared</span>::<span class="ident">from</span>(<span class="ident">Box</span>::<span class="ident">into_raw</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="number">1234</span>)) <span class="kw">as</span> <span class="kw-2">*</span><span class="kw">const</span> _) };
|
|||
|
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">p</span>.<span class="ident">is_null</span>());</pre>
|
|||
|
</div></div><h3 id='impl-PartialEq%3CShared%3C%27g%2C%20T%3E%3E' class='impl'><span class='in-band'><code>impl<'g, T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../crossbeam_epoch/struct.Shared.html" title="struct crossbeam_epoch::Shared">Shared</a><'g, T>> for <a class="struct" href="../crossbeam_epoch/struct.Shared.html" title="struct crossbeam_epoch::Shared">Shared</a><'g, T></code><a href='#impl-PartialEq%3CShared%3C%27g%2C%20T%3E%3E' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#1068-1072' title='goto source code'>[src]</a></span></h3>
|
|||
|
<div class='impl-items'><h4 id='method.eq' class="method"><span id='eq.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#1069-1071' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
|||
|
</div><h4 id='method.ne' class="method"><span id='ne.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#121' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>This method tests for <code>!=</code>.</p>
|
|||
|
</div></div><h3 id='impl-Eq' class='impl'><span class='in-band'><code>impl<'g, T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../crossbeam_epoch/struct.Shared.html" title="struct crossbeam_epoch::Shared">Shared</a><'g, T></code><a href='#impl-Eq' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#1074' title='goto source code'>[src]</a></span></h3>
|
|||
|
<div class='impl-items'></div><h3 id='impl-PartialOrd%3CShared%3C%27g%2C%20T%3E%3E' class='impl'><span class='in-band'><code>impl<'g, T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="struct" href="../crossbeam_epoch/struct.Shared.html" title="struct crossbeam_epoch::Shared">Shared</a><'g, T>> for <a class="struct" href="../crossbeam_epoch/struct.Shared.html" title="struct crossbeam_epoch::Shared">Shared</a><'g, T></code><a href='#impl-PartialOrd%3CShared%3C%27g%2C%20T%3E%3E' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#1076-1080' title='goto source code'>[src]</a></span></h3>
|
|||
|
<div class='impl-items'><h4 id='method.partial_cmp' class="method"><span id='partial_cmp.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#1077-1079' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
|
|||
|
</div><h4 id='method.lt' class="method"><span id='lt.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#644-649' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
|
|||
|
</div><h4 id='method.le' class="method"><span id='le.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#666-671' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
|
|||
|
</div><h4 id='method.gt' class="method"><span id='gt.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#687-692' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
|
|||
|
</div><h4 id='method.ge' class="method"><span id='ge.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#709-714' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
|
|||
|
</div></div><h3 id='impl-Ord' class='impl'><span class='in-band'><code>impl<'g, T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="../crossbeam_epoch/struct.Shared.html" title="struct crossbeam_epoch::Shared">Shared</a><'g, T></code><a href='#impl-Ord' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#1082-1086' title='goto source code'>[src]</a></span></h3>
|
|||
|
<div class='impl-items'><h4 id='method.cmp' class="method"><span id='cmp.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#1083-1085' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>This method returns an <code>Ordering</code> between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
|
|||
|
</div><h4 id='method.max' class="method"><span id='max.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.21.0'>1.21.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#460-463' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
|
|||
|
</div><h4 id='method.min' class="method"><span id='min.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.21.0'>1.21.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#476-479' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
|
|||
|
</div></div><h3 id='impl-Debug' class='impl'><span class='in-band'><code>impl<'g, T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../crossbeam_epoch/struct.Shared.html" title="struct crossbeam_epoch::Shared">Shared</a><'g, T></code><a href='#impl-Debug' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#1088-1097' title='goto source code'>[src]</a></span></h3>
|
|||
|
<div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#1089-1096' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
|||
|
</div></div><h3 id='impl-Pointer' class='impl'><span class='in-band'><code>impl<'g, T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Pointer.html" title="trait core::fmt::Pointer">Pointer</a> for <a class="struct" href="../crossbeam_epoch/struct.Shared.html" title="struct crossbeam_epoch::Shared">Shared</a><'g, T></code><a href='#impl-Pointer' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#1099-1103' title='goto source code'>[src]</a></span></h3>
|
|||
|
<div class='impl-items'><h4 id='method.fmt-1' class="method"><span id='fmt.v-1' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Pointer.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#1100-1102' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>Formats the value using the given formatter.</p>
|
|||
|
</div></div><h3 id='impl-Default' class='impl'><span class='in-band'><code>impl<'g, T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../crossbeam_epoch/struct.Shared.html" title="struct crossbeam_epoch::Shared">Shared</a><'g, T></code><a href='#impl-Default' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#1105-1109' title='goto source code'>[src]</a></span></h3>
|
|||
|
<div class='impl-items'><h4 id='method.default' class="method"><span id='default.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> Self</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/crossbeam_epoch/atomic.rs.html#1106-1108' title='goto source code'>[src]</a></span></h4>
|
|||
|
<div class='docblock'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
|
|||
|
</div></div></section>
|
|||
|
<section id='search' class="content hidden"></section>
|
|||
|
|
|||
|
<section class="footer"></section>
|
|||
|
|
|||
|
<aside id="help" class="hidden">
|
|||
|
<div>
|
|||
|
<h1 class="hidden">Help</h1>
|
|||
|
|
|||
|
<div class="shortcuts">
|
|||
|
<h2>Keyboard Shortcuts</h2>
|
|||
|
|
|||
|
<dl>
|
|||
|
<dt><kbd>?</kbd></dt>
|
|||
|
<dd>Show this help dialog</dd>
|
|||
|
<dt><kbd>S</kbd></dt>
|
|||
|
<dd>Focus the search field</dd>
|
|||
|
<dt><kbd>↑</kbd></dt>
|
|||
|
<dd>Move up in search results</dd>
|
|||
|
<dt><kbd>↓</kbd></dt>
|
|||
|
<dd>Move down in search results</dd>
|
|||
|
<dt><kbd>↹</kbd></dt>
|
|||
|
<dd>Switch tab</dd>
|
|||
|
<dt><kbd>⏎</kbd></dt>
|
|||
|
<dd>Go to active search result</dd>
|
|||
|
<dt><kbd>+</kbd></dt>
|
|||
|
<dd>Expand all sections</dd>
|
|||
|
<dt><kbd>-</kbd></dt>
|
|||
|
<dd>Collapse all sections</dd>
|
|||
|
</dl>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="infos">
|
|||
|
<h2>Search Tricks</h2>
|
|||
|
|
|||
|
<p>
|
|||
|
Prefix searches with a type followed by a colon (e.g.
|
|||
|
<code>fn:</code>) to restrict the search to a given type.
|
|||
|
</p>
|
|||
|
|
|||
|
<p>
|
|||
|
Accepted types are: <code>fn</code>, <code>mod</code>,
|
|||
|
<code>struct</code>, <code>enum</code>,
|
|||
|
<code>trait</code>, <code>type</code>, <code>macro</code>,
|
|||
|
and <code>const</code>.
|
|||
|
</p>
|
|||
|
|
|||
|
<p>
|
|||
|
Search functions by type signature (e.g.
|
|||
|
<code>vec -> usize</code> or <code>* -> vec</code>)
|
|||
|
</p>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</aside>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<script>
|
|||
|
window.rootPath = "../";
|
|||
|
window.currentCrate = "crossbeam_epoch";
|
|||
|
</script>
|
|||
|
<script src="../main.js"></script>
|
|||
|
<script defer src="../search-index.js"></script>
|
|||
|
</body>
|
|||
|
</html>
|