Sophie

Sophie

distrib > Mageia > 6 > armv7hl > media > core-updates > by-pkgid > 4e2dbb669434a7691662cb2f0ad38972 > files > 12303

rust-doc-1.28.0-1.mga6.armv7hl.rpm

<!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 `BTreeSet` struct in crate `std`."><meta name="keywords" content="rust, rustlang, rust-lang, BTreeSet"><title>std::collections::BTreeSet - 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="../../light.css" id="themeStyle"><script src="../../storage.js"></script><link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"></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">&#9776;</div><a href='../../std/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a><p class='location'>Struct BTreeSet</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.new">new</a><a href="#method.range">range</a><a href="#method.difference">difference</a><a href="#method.symmetric_difference">symmetric_difference</a><a href="#method.intersection">intersection</a><a href="#method.union">union</a><a href="#method.clear">clear</a><a href="#method.contains">contains</a><a href="#method.get">get</a><a href="#method.is_disjoint">is_disjoint</a><a href="#method.is_subset">is_subset</a><a href="#method.is_superset">is_superset</a><a href="#method.insert">insert</a><a href="#method.replace">replace</a><a href="#method.remove">remove</a><a href="#method.take">take</a><a href="#method.append">append</a><a href="#method.split_off">split_off</a><a href="#method.iter">iter</a><a href="#method.len">len</a><a href="#method.is_empty">is_empty</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-BitAnd%3C%26%27b%20BTreeSet%3CT%3E%3E">BitAnd&lt;&amp;&#39;b BTreeSet&lt;T&gt;&gt;</a><a href="#impl-PartialOrd%3CBTreeSet%3CT%3E%3E">PartialOrd&lt;BTreeSet&lt;T&gt;&gt;</a><a href="#impl-Ord">Ord</a><a href="#impl-FromIterator%3CT%3E">FromIterator&lt;T&gt;</a><a href="#impl-Default">Default</a><a href="#impl-Sub%3C%26%27b%20BTreeSet%3CT%3E%3E">Sub&lt;&amp;&#39;b BTreeSet&lt;T&gt;&gt;</a><a href="#impl-Debug">Debug</a><a href="#impl-Clone">Clone</a><a href="#impl-Hash">Hash</a><a href="#impl-BitOr%3C%26%27b%20BTreeSet%3CT%3E%3E">BitOr&lt;&amp;&#39;b BTreeSet&lt;T&gt;&gt;</a><a href="#impl-Eq">Eq</a><a href="#impl-Extend%3CT%3E">Extend&lt;T&gt;</a><a href="#impl-Extend%3C%26%27a%20T%3E">Extend&lt;&amp;&#39;a T&gt;</a><a href="#impl-PartialEq%3CBTreeSet%3CT%3E%3E">PartialEq&lt;BTreeSet&lt;T&gt;&gt;</a><a href="#impl-IntoIterator">IntoIterator</a><a href="#impl-BitXor%3C%26%27b%20BTreeSet%3CT%3E%3E">BitXor&lt;&amp;&#39;b BTreeSet&lt;T&gt;&gt;</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div></div><p class='location'><a href='../index.html'>std</a>::<wbr><a href='index.html'>collections</a></p><script>window.sidebarCurrent = {name: 'BTreeSet', 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"><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>std</a>::<wbr><a href='index.html'>collections</a>::<wbr><a class="struct" href=''>BTreeSet</a></span><span class='out-of-band'><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/alloc/btree/set.rs.html#72-74' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct BTreeSet&lt;T&gt; { /* fields omitted */ }</pre></div><div class='docblock'><p>A set based on a B-Tree.</p>
<p>See <a href="struct.BTreeMap.html"><code>BTreeMap</code></a>'s documentation for a detailed discussion of this collection's performance
benefits and drawbacks.</p>
<p>It is a logic error for an item to be modified in such a way that the item's ordering relative
to any other item, as determined by the <a href="../../std/cmp/trait.Ord.html"><code>Ord</code></a> trait, changes while it is in the set. This is
normally only possible through <a href="../../std/cell/struct.Cell.html"><code>Cell</code></a>, <a href="../../std/cell/struct.RefCell.html"><code>RefCell</code></a>, global state, I/O, or unsafe code.</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">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="comment">// Type inference lets us omit an explicit type signature (which</span>
<span class="comment">// would be `BTreeSet&lt;&amp;str&gt;` in this example).</span>
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">books</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();

<span class="comment">// Add some books.</span>
<span class="ident">books</span>.<span class="ident">insert</span>(<span class="string">&quot;A Dance With Dragons&quot;</span>);
<span class="ident">books</span>.<span class="ident">insert</span>(<span class="string">&quot;To Kill a Mockingbird&quot;</span>);
<span class="ident">books</span>.<span class="ident">insert</span>(<span class="string">&quot;The Odyssey&quot;</span>);
<span class="ident">books</span>.<span class="ident">insert</span>(<span class="string">&quot;The Great Gatsby&quot;</span>);

<span class="comment">// Check for a specific one.</span>
<span class="kw">if</span> <span class="op">!</span><span class="ident">books</span>.<span class="ident">contains</span>(<span class="string">&quot;The Winds of Winter&quot;</span>) {
    <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;We have {} books, but The Winds of Winter ain&#39;t one.&quot;</span>,
             <span class="ident">books</span>.<span class="ident">len</span>());
}

<span class="comment">// Remove a book.</span>
<span class="ident">books</span>.<span class="ident">remove</span>(<span class="string">&quot;The Odyssey&quot;</span>);

<span class="comment">// Iterate over everything.</span>
<span class="kw">for</span> <span class="ident">book</span> <span class="kw">in</span> <span class="kw-2">&amp;</span><span class="ident">books</span> {
    <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">book</span>);
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0A%2F%2F%20Type%20inference%20lets%20us%20omit%20an%20explicit%20type%20signature%20(which%0A%2F%2F%20would%20be%20%60BTreeSet%3C%26str%3E%60%20in%20this%20example).%0Alet%20mut%20books%20%3D%20BTreeSet%3A%3Anew()%3B%0A%0A%2F%2F%20Add%20some%20books.%0Abooks.insert(%22A%20Dance%20With%20Dragons%22)%3B%0Abooks.insert(%22To%20Kill%20a%20Mockingbird%22)%3B%0Abooks.insert(%22The%20Odyssey%22)%3B%0Abooks.insert(%22The%20Great%20Gatsby%22)%3B%0A%0A%2F%2F%20Check%20for%20a%20specific%20one.%0Aif%20!books.contains(%22The%20Winds%20of%20Winter%22)%20%7B%0A%20%20%20%20println!(%22We%20have%20%7B%7D%20books%2C%20but%20The%20Winds%20of%20Winter%20ain't%20one.%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20books.len())%3B%0A%7D%0A%0A%2F%2F%20Remove%20a%20book.%0Abooks.remove(%22The%20Odyssey%22)%3B%0A%0A%2F%2F%20Iterate%20over%20everything.%0Afor%20book%20in%20%26books%20%7B%0A%20%20%20%20println!(%22%7B%7D%22%2C%20book)%3B%0A%7D%0A%7D">Run</a></pre>
</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'><table class='table-display'><tbody><tr><td><code>impl&lt;T&gt; <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a>,&nbsp;</span></code><a href='#impl' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#215-685' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.new' class="method"><span id='new.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.new' class='fnname'>new</a>() -&gt; <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#227-229' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Makes a new <code>BTreeSet</code> with a reasonable choice of B.</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">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">set</span>: <span class="ident">BTreeSet</span><span class="op">&lt;</span><span class="ident">i32</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0A%23!%5Ballow(unused_mut)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20mut%20set%3A%20BTreeSet%3Ci32%3E%20%3D%20BTreeSet%3A%3Anew()%3B%0A%7D">Run</a></pre>
</div><h4 id='method.range' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../std/collections/btree_set/struct.Range.html" title="struct std::collections::btree_set::Range">Range</a>&lt;'a, T&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../std/collections/btree_set/struct.Range.html" title="struct std::collections::btree_set::Range">Range</a>&lt;'a, T&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, T&gt; <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="struct" href="../../std/collections/btree_set/struct.Range.html" title="struct std::collections::btree_set::Range">Range</a>&lt;'a, T&gt;</span><span class="where fmt-newline">    type <a href='../../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="../primitive.reference.html">&amp;'a </a>T;</span></code></div></div><span id='range.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.range' class='fnname'>range</a>&lt;K, R&gt;(&amp;self, range: R) -&gt; <a class="struct" href="../../std/collections/btree_set/struct.Range.html" title="struct std::collections::btree_set::Range">Range</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../std/ops/trait.RangeBounds.html" title="trait std::ops::RangeBounds">RangeBounds</a>&lt;K&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/borrow/trait.Borrow.html" title="trait std::borrow::Borrow">Borrow</a>&lt;K&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.17.0'>1.17.0</div><a class='srclink' href='../../src/alloc/btree/set.rs.html#254-258' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Constructs a double-ended iterator over a sub-range of elements in the set.
The simplest way is to use the range syntax <code>min..max</code>, thus <code>range(min..max)</code> will
yield elements from min (inclusive) to max (exclusive).
The range may also be entered as <code>(Bound&lt;T&gt;, Bound&lt;T&gt;)</code>, so for example
<code>range((Excluded(4), Included(10)))</code> will yield a left-exclusive, right-inclusive
range from 4 to 10.</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">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">ops</span>::<span class="ident">Bound</span>::<span class="ident">Included</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">set</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();
<span class="ident">set</span>.<span class="ident">insert</span>(<span class="number">3</span>);
<span class="ident">set</span>.<span class="ident">insert</span>(<span class="number">5</span>);
<span class="ident">set</span>.<span class="ident">insert</span>(<span class="number">8</span>);
<span class="kw">for</span> <span class="kw-2">&amp;</span><span class="ident">elem</span> <span class="kw">in</span> <span class="ident">set</span>.<span class="ident">range</span>((<span class="ident">Included</span>(<span class="kw-2">&amp;</span><span class="number">4</span>), <span class="ident">Included</span>(<span class="kw-2">&amp;</span><span class="number">8</span>))) {
    <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">elem</span>);
}
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="number">5</span>), <span class="ident">set</span>.<span class="ident">range</span>(<span class="number">4</span>..).<span class="ident">next</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0Ause%20std%3A%3Aops%3A%3ABound%3A%3AIncluded%3B%0A%0Alet%20mut%20set%20%3D%20BTreeSet%3A%3Anew()%3B%0Aset.insert(3)%3B%0Aset.insert(5)%3B%0Aset.insert(8)%3B%0Afor%20%26elem%20in%20set.range((Included(%264)%2C%20Included(%268)))%20%7B%0A%20%20%20%20println!(%22%7B%7D%22%2C%20elem)%3B%0A%7D%0Aassert_eq!(Some(%265)%2C%20set.range(4..).next())%3B%0A%7D">Run</a></pre>
</div><h4 id='method.difference' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../std/collections/btree_set/struct.Difference.html" title="struct std::collections::btree_set::Difference">Difference</a>&lt;'a, T&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../std/collections/btree_set/struct.Difference.html" title="struct std::collections::btree_set::Difference">Difference</a>&lt;'a, T&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, T&gt; <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="struct" href="../../std/collections/btree_set/struct.Difference.html" title="struct std::collections::btree_set::Difference">Difference</a>&lt;'a, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="../primitive.reference.html">&amp;'a </a>T;</span></code></div></div><span id='difference.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.difference' class='fnname'>difference</a>(&amp;'a self, other: &amp;'a <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;) -&gt; <a class="struct" href="../../std/collections/btree_set/struct.Difference.html" title="struct std::collections::btree_set::Difference">Difference</a>&lt;'a, T&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#281-286' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Visits the values representing the difference,
i.e. the values that are in <code>self</code> but not in <code>other</code>,
in ascending order.</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">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">1</span>);
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">2</span>);

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();
<span class="ident">b</span>.<span class="ident">insert</span>(<span class="number">2</span>);
<span class="ident">b</span>.<span class="ident">insert</span>(<span class="number">3</span>);

<span class="kw">let</span> <span class="ident">diff</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">difference</span>(<span class="kw-2">&amp;</span><span class="ident">b</span>).<span class="ident">cloned</span>().<span class="ident">collect</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">diff</span>, [<span class="number">1</span>]);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20mut%20a%20%3D%20BTreeSet%3A%3Anew()%3B%0Aa.insert(1)%3B%0Aa.insert(2)%3B%0A%0Alet%20mut%20b%20%3D%20BTreeSet%3A%3Anew()%3B%0Ab.insert(2)%3B%0Ab.insert(3)%3B%0A%0Alet%20diff%3A%20Vec%3C_%3E%20%3D%20a.difference(%26b).cloned().collect()%3B%0Aassert_eq!(diff%2C%20%5B1%5D)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.symmetric_difference' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../std/collections/btree_set/struct.SymmetricDifference.html" title="struct std::collections::btree_set::SymmetricDifference">SymmetricDifference</a>&lt;'a, T&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../std/collections/btree_set/struct.SymmetricDifference.html" title="struct std::collections::btree_set::SymmetricDifference">SymmetricDifference</a>&lt;'a, T&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, T&gt; <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="struct" href="../../std/collections/btree_set/struct.SymmetricDifference.html" title="struct std::collections::btree_set::SymmetricDifference">SymmetricDifference</a>&lt;'a, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="../primitive.reference.html">&amp;'a </a>T;</span></code></div></div><span id='symmetric_difference.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.symmetric_difference' class='fnname'>symmetric_difference</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'a self, <br>&nbsp;&nbsp;&nbsp;&nbsp;other: &amp;'a <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;<br>) -&gt; <a class="struct" href="../../std/collections/btree_set/struct.SymmetricDifference.html" title="struct std::collections::btree_set::SymmetricDifference">SymmetricDifference</a>&lt;'a, T&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#309-316' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Visits the values representing the symmetric difference,
i.e. the values that are in <code>self</code> or in <code>other</code> but not in both,
in ascending order.</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">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">1</span>);
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">2</span>);

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();
<span class="ident">b</span>.<span class="ident">insert</span>(<span class="number">2</span>);
<span class="ident">b</span>.<span class="ident">insert</span>(<span class="number">3</span>);

<span class="kw">let</span> <span class="ident">sym_diff</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">symmetric_difference</span>(<span class="kw-2">&amp;</span><span class="ident">b</span>).<span class="ident">cloned</span>().<span class="ident">collect</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">sym_diff</span>, [<span class="number">1</span>, <span class="number">3</span>]);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20mut%20a%20%3D%20BTreeSet%3A%3Anew()%3B%0Aa.insert(1)%3B%0Aa.insert(2)%3B%0A%0Alet%20mut%20b%20%3D%20BTreeSet%3A%3Anew()%3B%0Ab.insert(2)%3B%0Ab.insert(3)%3B%0A%0Alet%20sym_diff%3A%20Vec%3C_%3E%20%3D%20a.symmetric_difference(%26b).cloned().collect()%3B%0Aassert_eq!(sym_diff%2C%20%5B1%2C%203%5D)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.intersection' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../std/collections/btree_set/struct.Intersection.html" title="struct std::collections::btree_set::Intersection">Intersection</a>&lt;'a, T&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../std/collections/btree_set/struct.Intersection.html" title="struct std::collections::btree_set::Intersection">Intersection</a>&lt;'a, T&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, T&gt; <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="struct" href="../../std/collections/btree_set/struct.Intersection.html" title="struct std::collections::btree_set::Intersection">Intersection</a>&lt;'a, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="../primitive.reference.html">&amp;'a </a>T;</span></code></div></div><span id='intersection.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.intersection' class='fnname'>intersection</a>(&amp;'a self, other: &amp;'a <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;) -&gt; <a class="struct" href="../../std/collections/btree_set/struct.Intersection.html" title="struct std::collections::btree_set::Intersection">Intersection</a>&lt;'a, T&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#339-344' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Visits the values representing the intersection,
i.e. the values that are both in <code>self</code> and <code>other</code>,
in ascending order.</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">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">1</span>);
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">2</span>);

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();
<span class="ident">b</span>.<span class="ident">insert</span>(<span class="number">2</span>);
<span class="ident">b</span>.<span class="ident">insert</span>(<span class="number">3</span>);

<span class="kw">let</span> <span class="ident">intersection</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">intersection</span>(<span class="kw-2">&amp;</span><span class="ident">b</span>).<span class="ident">cloned</span>().<span class="ident">collect</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">intersection</span>, [<span class="number">2</span>]);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20mut%20a%20%3D%20BTreeSet%3A%3Anew()%3B%0Aa.insert(1)%3B%0Aa.insert(2)%3B%0A%0Alet%20mut%20b%20%3D%20BTreeSet%3A%3Anew()%3B%0Ab.insert(2)%3B%0Ab.insert(3)%3B%0A%0Alet%20intersection%3A%20Vec%3C_%3E%20%3D%20a.intersection(%26b).cloned().collect()%3B%0Aassert_eq!(intersection%2C%20%5B2%5D)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.union' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../std/collections/btree_set/struct.Union.html" title="struct std::collections::btree_set::Union">Union</a>&lt;'a, T&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../std/collections/btree_set/struct.Union.html" title="struct std::collections::btree_set::Union">Union</a>&lt;'a, T&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, T&gt; <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="struct" href="../../std/collections/btree_set/struct.Union.html" title="struct std::collections::btree_set::Union">Union</a>&lt;'a, T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="../primitive.reference.html">&amp;'a </a>T;</span></code></div></div><span id='union.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.union' class='fnname'>union</a>(&amp;'a self, other: &amp;'a <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;) -&gt; <a class="struct" href="../../std/collections/btree_set/struct.Union.html" title="struct std::collections::btree_set::Union">Union</a>&lt;'a, T&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#365-370' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Visits the values representing the union,
i.e. all the values in <code>self</code> or <code>other</code>, without duplicates,
in ascending order.</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">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">1</span>);

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();
<span class="ident">b</span>.<span class="ident">insert</span>(<span class="number">2</span>);

<span class="kw">let</span> <span class="ident">union</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">union</span>(<span class="kw-2">&amp;</span><span class="ident">b</span>).<span class="ident">cloned</span>().<span class="ident">collect</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">union</span>, [<span class="number">1</span>, <span class="number">2</span>]);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20mut%20a%20%3D%20BTreeSet%3A%3Anew()%3B%0Aa.insert(1)%3B%0A%0Alet%20mut%20b%20%3D%20BTreeSet%3A%3Anew()%3B%0Ab.insert(2)%3B%0A%0Alet%20union%3A%20Vec%3C_%3E%20%3D%20a.union(%26b).cloned().collect()%3B%0Aassert_eq!(union%2C%20%5B1%2C%202%5D)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.clear' class="method"><span id='clear.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.clear' class='fnname'>clear</a>(&amp;mut self)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#385-387' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Clears the set, removing all values.</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">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">v</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();
<span class="ident">v</span>.<span class="ident">insert</span>(<span class="number">1</span>);
<span class="ident">v</span>.<span class="ident">clear</span>();
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">v</span>.<span class="ident">is_empty</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20mut%20v%20%3D%20BTreeSet%3A%3Anew()%3B%0Av.insert(1)%3B%0Av.clear()%3B%0Aassert!(v.is_empty())%3B%0A%7D">Run</a></pre>
</div><h4 id='method.contains' class="method"><span id='contains.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.contains' class='fnname'>contains</a>&lt;Q&gt;(&amp;self, value: <a class="primitive" href="../primitive.reference.html">&amp;</a>Q) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/borrow/trait.Borrow.html" title="trait std::borrow::Borrow">Borrow</a>&lt;Q&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#405-410' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns <code>true</code> if the set contains a value.</p>
<p>The value may be any borrowed form of the set's value type,
but the ordering on the borrowed form <em>must</em> match the
ordering on the value type.</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">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="ident">set</span>: <span class="ident">BTreeSet</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>].<span class="ident">iter</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set</span>.<span class="ident">contains</span>(<span class="kw-2">&amp;</span><span class="number">1</span>), <span class="bool-val">true</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set</span>.<span class="ident">contains</span>(<span class="kw-2">&amp;</span><span class="number">4</span>), <span class="bool-val">false</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20set%3A%20BTreeSet%3C_%3E%20%3D%20%5B1%2C%202%2C%203%5D.iter().cloned().collect()%3B%0Aassert_eq!(set.contains(%261)%2C%20true)%3B%0Aassert_eq!(set.contains(%264)%2C%20false)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.get' class="method"><span id='get.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get' class='fnname'>get</a>&lt;Q&gt;(&amp;self, value: <a class="primitive" href="../primitive.reference.html">&amp;</a>Q) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="primitive" href="../primitive.reference.html">&amp;</a>T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/borrow/trait.Borrow.html" title="trait std::borrow::Borrow">Borrow</a>&lt;Q&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.9.0'>1.9.0</div><a class='srclink' href='../../src/alloc/btree/set.rs.html#428-433' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a reference to the value in the set, if any, that is equal to the given value.</p>
<p>The value may be any borrowed form of the set's value type,
but the ordering on the borrowed form <em>must</em> match the
ordering on the value type.</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">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="ident">set</span>: <span class="ident">BTreeSet</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>].<span class="ident">iter</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set</span>.<span class="ident">get</span>(<span class="kw-2">&amp;</span><span class="number">2</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="number">2</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set</span>.<span class="ident">get</span>(<span class="kw-2">&amp;</span><span class="number">4</span>), <span class="prelude-val">None</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20set%3A%20BTreeSet%3C_%3E%20%3D%20%5B1%2C%202%2C%203%5D.iter().cloned().collect()%3B%0Aassert_eq!(set.get(%262)%2C%20Some(%262))%3B%0Aassert_eq!(set.get(%264)%2C%20None)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.is_disjoint' class="method"><span id='is_disjoint.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_disjoint' class='fnname'>is_disjoint</a>(&amp;self, other: &amp;<a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#453-455' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns <code>true</code> if <code>self</code> has no elements in common with <code>other</code>.
This is equivalent to checking for an empty intersection.</p>
<h1 id="examples-10" class="section-header"><a href="#examples-10">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="ident">a</span>: <span class="ident">BTreeSet</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>].<span class="ident">iter</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>();
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">is_disjoint</span>(<span class="kw-2">&amp;</span><span class="ident">b</span>), <span class="bool-val">true</span>);
<span class="ident">b</span>.<span class="ident">insert</span>(<span class="number">4</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">is_disjoint</span>(<span class="kw-2">&amp;</span><span class="ident">b</span>), <span class="bool-val">true</span>);
<span class="ident">b</span>.<span class="ident">insert</span>(<span class="number">1</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">is_disjoint</span>(<span class="kw-2">&amp;</span><span class="ident">b</span>), <span class="bool-val">false</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20a%3A%20BTreeSet%3C_%3E%20%3D%20%5B1%2C%202%2C%203%5D.iter().cloned().collect()%3B%0Alet%20mut%20b%20%3D%20BTreeSet%3A%3Anew()%3B%0A%0Aassert_eq!(a.is_disjoint(%26b)%2C%20true)%3B%0Ab.insert(4)%3B%0Aassert_eq!(a.is_disjoint(%26b)%2C%20true)%3B%0Ab.insert(1)%3B%0Aassert_eq!(a.is_disjoint(%26b)%2C%20false)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.is_subset' class="method"><span id='is_subset.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_subset' class='fnname'>is_subset</a>(&amp;self, other: &amp;<a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#475-498' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns <code>true</code> if the set is a subset of another,
i.e. <code>other</code> contains at least all the values in <code>self</code>.</p>
<h1 id="examples-11" class="section-header"><a href="#examples-11">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="ident">sup</span>: <span class="ident">BTreeSet</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>].<span class="ident">iter</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>();
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">set</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set</span>.<span class="ident">is_subset</span>(<span class="kw-2">&amp;</span><span class="ident">sup</span>), <span class="bool-val">true</span>);
<span class="ident">set</span>.<span class="ident">insert</span>(<span class="number">2</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set</span>.<span class="ident">is_subset</span>(<span class="kw-2">&amp;</span><span class="ident">sup</span>), <span class="bool-val">true</span>);
<span class="ident">set</span>.<span class="ident">insert</span>(<span class="number">4</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set</span>.<span class="ident">is_subset</span>(<span class="kw-2">&amp;</span><span class="ident">sup</span>), <span class="bool-val">false</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20sup%3A%20BTreeSet%3C_%3E%20%3D%20%5B1%2C%202%2C%203%5D.iter().cloned().collect()%3B%0Alet%20mut%20set%20%3D%20BTreeSet%3A%3Anew()%3B%0A%0Aassert_eq!(set.is_subset(%26sup)%2C%20true)%3B%0Aset.insert(2)%3B%0Aassert_eq!(set.is_subset(%26sup)%2C%20true)%3B%0Aset.insert(4)%3B%0Aassert_eq!(set.is_subset(%26sup)%2C%20false)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.is_superset' class="method"><span id='is_superset.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_superset' class='fnname'>is_superset</a>(&amp;self, other: &amp;<a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#521-523' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns <code>true</code> if the set is a superset of another,
i.e. <code>self</code> contains at least all the values in <code>other</code>.</p>
<h1 id="examples-12" class="section-header"><a href="#examples-12">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="ident">sub</span>: <span class="ident">BTreeSet</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> [<span class="number">1</span>, <span class="number">2</span>].<span class="ident">iter</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>();
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">set</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set</span>.<span class="ident">is_superset</span>(<span class="kw-2">&amp;</span><span class="ident">sub</span>), <span class="bool-val">false</span>);

<span class="ident">set</span>.<span class="ident">insert</span>(<span class="number">0</span>);
<span class="ident">set</span>.<span class="ident">insert</span>(<span class="number">1</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set</span>.<span class="ident">is_superset</span>(<span class="kw-2">&amp;</span><span class="ident">sub</span>), <span class="bool-val">false</span>);

<span class="ident">set</span>.<span class="ident">insert</span>(<span class="number">2</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set</span>.<span class="ident">is_superset</span>(<span class="kw-2">&amp;</span><span class="ident">sub</span>), <span class="bool-val">true</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20sub%3A%20BTreeSet%3C_%3E%20%3D%20%5B1%2C%202%5D.iter().cloned().collect()%3B%0Alet%20mut%20set%20%3D%20BTreeSet%3A%3Anew()%3B%0A%0Aassert_eq!(set.is_superset(%26sub)%2C%20false)%3B%0A%0Aset.insert(0)%3B%0Aset.insert(1)%3B%0Aassert_eq!(set.is_superset(%26sub)%2C%20false)%3B%0A%0Aset.insert(2)%3B%0Aassert_eq!(set.is_superset(%26sub)%2C%20true)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.insert' class="method"><span id='insert.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.insert' class='fnname'>insert</a>(&amp;mut self, value: T) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#546-548' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Adds a value to the set.</p>
<p>If the set did not have this value present, <code>true</code> is returned.</p>
<p>If the set did have this value present, <code>false</code> is returned, and the
entry is not updated. See the <a href="index.html#insert-and-complex-keys">module-level documentation</a> for more.</p>
<h1 id="examples-13" class="section-header"><a href="#examples-13">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">set</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set</span>.<span class="ident">insert</span>(<span class="number">2</span>), <span class="bool-val">true</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set</span>.<span class="ident">insert</span>(<span class="number">2</span>), <span class="bool-val">false</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set</span>.<span class="ident">len</span>(), <span class="number">1</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20mut%20set%20%3D%20BTreeSet%3A%3Anew()%3B%0A%0Aassert_eq!(set.insert(2)%2C%20true)%3B%0Aassert_eq!(set.insert(2)%2C%20false)%3B%0Aassert_eq!(set.len()%2C%201)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.replace' class="method"><span id='replace.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.replace' class='fnname'>replace</a>(&amp;mut self, value: T) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;T&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.9.0'>1.9.0</div><a class='srclink' href='../../src/alloc/btree/set.rs.html#566-568' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Adds a value to the set, replacing the existing value, if any, that is equal to the given
one. Returns the replaced value.</p>
<h1 id="examples-14" class="section-header"><a href="#examples-14">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">set</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();
<span class="ident">set</span>.<span class="ident">insert</span>(<span class="ident">Vec</span>::<span class="op">&lt;</span><span class="ident">i32</span><span class="op">&gt;</span>::<span class="ident">new</span>());

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set</span>.<span class="ident">get</span>(<span class="kw-2">&amp;</span>[][..]).<span class="ident">unwrap</span>().<span class="ident">capacity</span>(), <span class="number">0</span>);
<span class="ident">set</span>.<span class="ident">replace</span>(<span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="number">10</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set</span>.<span class="ident">get</span>(<span class="kw-2">&amp;</span>[][..]).<span class="ident">unwrap</span>().<span class="ident">capacity</span>(), <span class="number">10</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20mut%20set%20%3D%20BTreeSet%3A%3Anew()%3B%0Aset.insert(Vec%3A%3A%3Ci32%3E%3A%3Anew())%3B%0A%0Aassert_eq!(set.get(%26%5B%5D%5B..%5D).unwrap().capacity()%2C%200)%3B%0Aset.replace(Vec%3A%3Awith_capacity(10))%3B%0Aassert_eq!(set.get(%26%5B%5D%5B..%5D).unwrap().capacity()%2C%2010)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.remove' class="method"><span id='remove.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.remove' class='fnname'>remove</a>&lt;Q&gt;(&amp;mut self, value: <a class="primitive" href="../primitive.reference.html">&amp;</a>Q) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/borrow/trait.Borrow.html" title="trait std::borrow::Borrow">Borrow</a>&lt;Q&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#589-594' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Removes a value from the set. Returns <code>true</code> if the value was
present in the set.</p>
<p>The value may be any borrowed form of the set's value type,
but the ordering on the borrowed form <em>must</em> match the
ordering on the value type.</p>
<h1 id="examples-15" class="section-header"><a href="#examples-15">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">set</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();

<span class="ident">set</span>.<span class="ident">insert</span>(<span class="number">2</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set</span>.<span class="ident">remove</span>(<span class="kw-2">&amp;</span><span class="number">2</span>), <span class="bool-val">true</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set</span>.<span class="ident">remove</span>(<span class="kw-2">&amp;</span><span class="number">2</span>), <span class="bool-val">false</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20mut%20set%20%3D%20BTreeSet%3A%3Anew()%3B%0A%0Aset.insert(2)%3B%0Aassert_eq!(set.remove(%262)%2C%20true)%3B%0Aassert_eq!(set.remove(%262)%2C%20false)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.take' class="method"><span id='take.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.take' class='fnname'>take</a>&lt;Q&gt;(&amp;mut self, value: <a class="primitive" href="../primitive.reference.html">&amp;</a>Q) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/borrow/trait.Borrow.html" title="trait std::borrow::Borrow">Borrow</a>&lt;Q&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.9.0'>1.9.0</div><a class='srclink' href='../../src/alloc/btree/set.rs.html#612-617' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Removes and returns the value in the set, if any, that is equal to the given one.</p>
<p>The value may be any borrowed form of the set's value type,
but the ordering on the borrowed form <em>must</em> match the
ordering on the value type.</p>
<h1 id="examples-16" class="section-header"><a href="#examples-16">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">set</span>: <span class="ident">BTreeSet</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>].<span class="ident">iter</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set</span>.<span class="ident">take</span>(<span class="kw-2">&amp;</span><span class="number">2</span>), <span class="prelude-val">Some</span>(<span class="number">2</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set</span>.<span class="ident">take</span>(<span class="kw-2">&amp;</span><span class="number">2</span>), <span class="prelude-val">None</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20mut%20set%3A%20BTreeSet%3C_%3E%20%3D%20%5B1%2C%202%2C%203%5D.iter().cloned().collect()%3B%0Aassert_eq!(set.take(%262)%2C%20Some(2))%3B%0Aassert_eq!(set.take(%262)%2C%20None)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.append' class="method"><span id='append.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.append' class='fnname'>append</a>(&amp;mut self, other: &amp;mut <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.11.0'>1.11.0</div><a class='srclink' href='../../src/alloc/btree/set.rs.html#648-650' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Moves all elements from <code>other</code> into <code>Self</code>, leaving <code>other</code> empty.</p>
<h1 id="examples-17" class="section-header"><a href="#examples-17">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">1</span>);
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">2</span>);
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">3</span>);

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();
<span class="ident">b</span>.<span class="ident">insert</span>(<span class="number">3</span>);
<span class="ident">b</span>.<span class="ident">insert</span>(<span class="number">4</span>);
<span class="ident">b</span>.<span class="ident">insert</span>(<span class="number">5</span>);

<span class="ident">a</span>.<span class="ident">append</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">b</span>);

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">len</span>(), <span class="number">5</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">b</span>.<span class="ident">len</span>(), <span class="number">0</span>);

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">contains</span>(<span class="kw-2">&amp;</span><span class="number">1</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">contains</span>(<span class="kw-2">&amp;</span><span class="number">2</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">contains</span>(<span class="kw-2">&amp;</span><span class="number">3</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">contains</span>(<span class="kw-2">&amp;</span><span class="number">4</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">contains</span>(<span class="kw-2">&amp;</span><span class="number">5</span>));<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20mut%20a%20%3D%20BTreeSet%3A%3Anew()%3B%0Aa.insert(1)%3B%0Aa.insert(2)%3B%0Aa.insert(3)%3B%0A%0Alet%20mut%20b%20%3D%20BTreeSet%3A%3Anew()%3B%0Ab.insert(3)%3B%0Ab.insert(4)%3B%0Ab.insert(5)%3B%0A%0Aa.append(%26mut%20b)%3B%0A%0Aassert_eq!(a.len()%2C%205)%3B%0Aassert_eq!(b.len()%2C%200)%3B%0A%0Aassert!(a.contains(%261))%3B%0Aassert!(a.contains(%262))%3B%0Aassert!(a.contains(%263))%3B%0Aassert!(a.contains(%264))%3B%0Aassert!(a.contains(%265))%3B%0A%7D">Run</a></pre>
</div><h4 id='method.split_off' class="method"><span id='split_off.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.split_off' class='fnname'>split_off</a>&lt;Q&gt;(&amp;mut self, key: <a class="primitive" href="../primitive.reference.html">&amp;</a>Q) -&gt; <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/borrow/trait.Borrow.html" title="trait std::borrow::Borrow">Borrow</a>&lt;Q&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.11.0'>1.11.0</div><a class='srclink' href='../../src/alloc/btree/set.rs.html#682-684' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Splits the collection into two at the given key. Returns everything after the given key,
including the key.</p>
<h1 id="examples-18" class="section-header"><a href="#examples-18">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">1</span>);
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">2</span>);
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">3</span>);
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">17</span>);
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">41</span>);

<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">split_off</span>(<span class="kw-2">&amp;</span><span class="number">3</span>);

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">len</span>(), <span class="number">2</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">b</span>.<span class="ident">len</span>(), <span class="number">3</span>);

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">contains</span>(<span class="kw-2">&amp;</span><span class="number">1</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">contains</span>(<span class="kw-2">&amp;</span><span class="number">2</span>));

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">b</span>.<span class="ident">contains</span>(<span class="kw-2">&amp;</span><span class="number">3</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">b</span>.<span class="ident">contains</span>(<span class="kw-2">&amp;</span><span class="number">17</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">b</span>.<span class="ident">contains</span>(<span class="kw-2">&amp;</span><span class="number">41</span>));<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20mut%20a%20%3D%20BTreeSet%3A%3Anew()%3B%0Aa.insert(1)%3B%0Aa.insert(2)%3B%0Aa.insert(3)%3B%0Aa.insert(17)%3B%0Aa.insert(41)%3B%0A%0Alet%20b%20%3D%20a.split_off(%263)%3B%0A%0Aassert_eq!(a.len()%2C%202)%3B%0Aassert_eq!(b.len()%2C%203)%3B%0A%0Aassert!(a.contains(%261))%3B%0Aassert!(a.contains(%262))%3B%0A%0Aassert!(b.contains(%263))%3B%0Aassert!(b.contains(%2617))%3B%0Aassert!(b.contains(%2641))%3B%0A%7D">Run</a></pre>
</div></div><h3 id='impl-1' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T&gt; <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;</code><a href='#impl-1' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#687-753' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.iter' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../std/collections/btree_set/struct.Iter.html" title="struct std::collections::btree_set::Iter">Iter</a>&lt;'a, T&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../std/collections/btree_set/struct.Iter.html" title="struct std::collections::btree_set::Iter">Iter</a>&lt;'a, T&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, T&gt; <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="struct" href="../../std/collections/btree_set/struct.Iter.html" title="struct std::collections::btree_set::Iter">Iter</a>&lt;'a, T&gt;</span><span class="where fmt-newline">    type <a href='../../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="../primitive.reference.html">&amp;'a </a>T;</span></code></div></div><span id='iter.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.iter' class='fnname'>iter</a>(&amp;self) -&gt; <a class="struct" href="../../std/collections/btree_set/struct.Iter.html" title="struct std::collections::btree_set::Iter">Iter</a>&lt;T&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#716-718' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Gets an iterator that visits the values in the <code>BTreeSet</code> in ascending order.</p>
<h1 id="examples-19" class="section-header"><a href="#examples-19">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="ident">set</span>: <span class="ident">BTreeSet</span><span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span> <span class="op">=</span> [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>].<span class="ident">iter</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>();
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">set_iter</span> <span class="op">=</span> <span class="ident">set</span>.<span class="ident">iter</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set_iter</span>.<span class="ident">next</span>(), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set_iter</span>.<span class="ident">next</span>(), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="number">2</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set_iter</span>.<span class="ident">next</span>(), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="number">3</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set_iter</span>.<span class="ident">next</span>(), <span class="prelude-val">None</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20set%3A%20BTreeSet%3Cusize%3E%20%3D%20%5B1%2C%202%2C%203%5D.iter().cloned().collect()%3B%0Alet%20mut%20set_iter%20%3D%20set.iter()%3B%0Aassert_eq!(set_iter.next()%2C%20Some(%261))%3B%0Aassert_eq!(set_iter.next()%2C%20Some(%262))%3B%0Aassert_eq!(set_iter.next()%2C%20Some(%263))%3B%0Aassert_eq!(set_iter.next()%2C%20None)%3B%0A%7D">Run</a></pre>
<p>Values returned by the iterator are returned in ascending order:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="ident">set</span>: <span class="ident">BTreeSet</span><span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span> <span class="op">=</span> [<span class="number">3</span>, <span class="number">1</span>, <span class="number">2</span>].<span class="ident">iter</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>();
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">set_iter</span> <span class="op">=</span> <span class="ident">set</span>.<span class="ident">iter</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set_iter</span>.<span class="ident">next</span>(), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set_iter</span>.<span class="ident">next</span>(), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="number">2</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set_iter</span>.<span class="ident">next</span>(), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="number">3</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">set_iter</span>.<span class="ident">next</span>(), <span class="prelude-val">None</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20set%3A%20BTreeSet%3Cusize%3E%20%3D%20%5B3%2C%201%2C%202%5D.iter().cloned().collect()%3B%0Alet%20mut%20set_iter%20%3D%20set.iter()%3B%0Aassert_eq!(set_iter.next()%2C%20Some(%261))%3B%0Aassert_eq!(set_iter.next()%2C%20Some(%262))%3B%0Aassert_eq!(set_iter.next()%2C%20Some(%263))%3B%0Aassert_eq!(set_iter.next()%2C%20None)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.len' class="method"><span id='len.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.len' class='fnname'>len</a>(&amp;self) -&gt; <a class="primitive" href="../primitive.usize.html">usize</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#733-735' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the number of elements in the set.</p>
<h1 id="examples-20" class="section-header"><a href="#examples-20">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">v</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">v</span>.<span class="ident">len</span>(), <span class="number">0</span>);
<span class="ident">v</span>.<span class="ident">insert</span>(<span class="number">1</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">v</span>.<span class="ident">len</span>(), <span class="number">1</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20mut%20v%20%3D%20BTreeSet%3A%3Anew()%3B%0Aassert_eq!(v.len()%2C%200)%3B%0Av.insert(1)%3B%0Aassert_eq!(v.len()%2C%201)%3B%0A%7D">Run</a></pre>
</div><h4 id='method.is_empty' class="method"><span id='is_empty.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_empty' class='fnname'>is_empty</a>(&amp;self) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#750-752' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns <code>true</code> if the set contains no elements.</p>
<h1 id="examples-21" class="section-header"><a href="#examples-21">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">v</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">v</span>.<span class="ident">is_empty</span>());
<span class="ident">v</span>.<span class="ident">insert</span>(<span class="number">1</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">v</span>.<span class="ident">is_empty</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20mut%20v%20%3D%20BTreeSet%3A%3Anew()%3B%0Aassert!(v.is_empty())%3B%0Av.insert(1)%3B%0Aassert!(!v.is_empty())%3B%0A%7D">Run</a></pre>
</div></div>
                <h2 id='implementations' class='small-section-header'>
                  Trait Implementations<a href='#implementations' class='anchor'></a>
                </h2>
                <div id='implementations-list'><h3 id='impl-BitAnd%3C%26%27b%20BTreeSet%3CT%3E%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a, 'b, T&gt; <a class="trait" href="../../std/ops/trait.BitAnd.html" title="trait std::ops::BitAnd">BitAnd</a>&lt;&amp;'b <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;&gt; for &amp;'a <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a> + <a class="trait" href="../../std/clone/trait.Clone.html" title="trait std::clone::Clone">Clone</a>,&nbsp;</span></code><a href='#impl-BitAnd%3C%26%27b%20BTreeSet%3CT%3E%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#868-888' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Output' class="type"><span id='Output.t' class='invisible'><code>type <a href='../../std/ops/trait.BitAnd.html#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;</code></span></h4>
<div class='docblock'><p>The resulting type after applying the <code>&amp;</code> operator.</p>
</div><h4 id='method.bitand' class="method"><span id='bitand.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/ops/trait.BitAnd.html#tymethod.bitand' class='fnname'>bitand</a>(self, rhs: &amp;<a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;) -&gt; <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#885-887' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the intersection of <code>self</code> and <code>rhs</code> as a new <code>BTreeSet&lt;T&gt;</code>.</p>
<h1 id="examples-22" class="section-header"><a href="#examples-22">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="ident">a</span>: <span class="ident">BTreeSet</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>].<span class="ident">into_iter</span>().<span class="ident">collect</span>();
<span class="kw">let</span> <span class="ident">b</span>: <span class="ident">BTreeSet</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>].<span class="ident">into_iter</span>().<span class="ident">collect</span>();

<span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="kw-2">&amp;</span><span class="ident">a</span> <span class="op">&amp;</span> <span class="kw-2">&amp;</span><span class="ident">b</span>;
<span class="kw">let</span> <span class="ident">result_vec</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">result</span>.<span class="ident">into_iter</span>().<span class="ident">collect</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result_vec</span>, [<span class="number">2</span>, <span class="number">3</span>]);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20a%3A%20BTreeSet%3C_%3E%20%3D%20vec!%5B1%2C%202%2C%203%5D.into_iter().collect()%3B%0Alet%20b%3A%20BTreeSet%3C_%3E%20%3D%20vec!%5B2%2C%203%2C%204%5D.into_iter().collect()%3B%0A%0Alet%20result%20%3D%20%26a%20%26%20%26b%3B%0Alet%20result_vec%3A%20Vec%3C_%3E%20%3D%20result.into_iter().collect()%3B%0Aassert_eq!(result_vec%2C%20%5B2%2C%203%5D)%3B%0A%7D">Run</a></pre>
</div></div><h3 id='impl-PartialOrd%3CBTreeSet%3CT%3E%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T&gt; <a class="trait" href="../../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a>&lt;<a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;&gt; for <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-PartialOrd%3CBTreeSet%3CT%3E%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#70' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method"><span id='partial_cmp.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#70' title='goto source code'>[src]</a></td></tr></tbody></table></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="../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt' class="method"><span id='lt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: &amp;<a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#70' title='goto source code'>[src]</a></td></tr></tbody></table></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>&lt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le' class="method"><span id='le.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: &amp;<a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#70' title='goto source code'>[src]</a></td></tr></tbody></table></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>&lt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.gt' class="method"><span id='gt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: &amp;<a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#70' title='goto source code'>[src]</a></td></tr></tbody></table></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>&gt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id='method.ge' class="method"><span id='ge.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: &amp;<a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#70' title='goto source code'>[src]</a></td></tr></tbody></table></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>&gt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id='impl-Ord' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T&gt; <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a> for <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a>,&nbsp;</span></code><a href='#impl-Ord' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#70' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.cmp' class="method"><span id='cmp.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;) -&gt; <a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#70' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method returns an <code>Ordering</code> between <code>self</code> and <code>other</code>. <a href="../../std/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
</div><h4 id='method.max' class="method"><span id='max.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -&gt; Self</code></span></td><td><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='../../src/core/cmp.rs.html#469-472' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Compares and returns the maximum of two values. <a href="../../std/cmp/trait.Ord.html#method.max">Read more</a></p>
</div><h4 id='method.min' class="method"><span id='min.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -&gt; Self</code></span></td><td><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='../../src/core/cmp.rs.html#485-488' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Compares and returns the minimum of two values. <a href="../../std/cmp/trait.Ord.html#method.min">Read more</a></p>
</div></div><h3 id='impl-FromIterator%3CT%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T&gt; <a class="trait" href="../../std/iter/trait.FromIterator.html" title="trait std::iter::FromIterator">FromIterator</a>&lt;T&gt; for <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a>,&nbsp;</span></code><a href='#impl-FromIterator%3CT%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#756-762' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.from_iter' class="method"><span id='from_iter.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/iter/trait.FromIterator.html#tymethod.from_iter' class='fnname'>from_iter</a>&lt;I&gt;(iter: I) -&gt; <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="../../std/iter/trait.IntoIterator.html" title="trait std::iter::IntoIterator">IntoIterator</a>&lt;Item = T&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#757-761' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates a value from an iterator. <a href="../../std/iter/trait.FromIterator.html#tymethod.from_iter">Read more</a></p>
</div></div><h3 id='impl-Default' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T&gt; <a class="trait" href="../../std/default/trait.Default.html" title="trait std::default::Default">Default</a> for <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a>,&nbsp;</span></code><a href='#impl-Default' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#814-819' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.default' class="method"><span id='default.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -&gt; <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#816-818' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Makes an empty <code>BTreeSet&lt;T&gt;</code> with a reasonable choice of B.</p>
</div></div><h3 id='impl-Sub%3C%26%27b%20BTreeSet%3CT%3E%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a, 'b, T&gt; <a class="trait" href="../../std/ops/trait.Sub.html" title="trait std::ops::Sub">Sub</a>&lt;&amp;'b <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;&gt; for &amp;'a <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a> + <a class="trait" href="../../std/clone/trait.Clone.html" title="trait std::clone::Clone">Clone</a>,&nbsp;</span></code><a href='#impl-Sub%3C%26%27b%20BTreeSet%3CT%3E%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#822-842' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Output-1' class="type"><span id='Output.t-1' class='invisible'><code>type <a href='../../std/ops/trait.Sub.html#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;</code></span></h4>
<div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id='method.sub' class="method"><span id='sub.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/ops/trait.Sub.html#tymethod.sub' class='fnname'>sub</a>(self, rhs: &amp;<a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;) -&gt; <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#839-841' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the difference of <code>self</code> and <code>rhs</code> as a new <code>BTreeSet&lt;T&gt;</code>.</p>
<h1 id="examples-23" class="section-header"><a href="#examples-23">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="ident">a</span>: <span class="ident">BTreeSet</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>].<span class="ident">into_iter</span>().<span class="ident">collect</span>();
<span class="kw">let</span> <span class="ident">b</span>: <span class="ident">BTreeSet</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>].<span class="ident">into_iter</span>().<span class="ident">collect</span>();

<span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="kw-2">&amp;</span><span class="ident">a</span> <span class="op">-</span> <span class="kw-2">&amp;</span><span class="ident">b</span>;
<span class="kw">let</span> <span class="ident">result_vec</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">result</span>.<span class="ident">into_iter</span>().<span class="ident">collect</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result_vec</span>, [<span class="number">1</span>, <span class="number">2</span>]);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20a%3A%20BTreeSet%3C_%3E%20%3D%20vec!%5B1%2C%202%2C%203%5D.into_iter().collect()%3B%0Alet%20b%3A%20BTreeSet%3C_%3E%20%3D%20vec!%5B3%2C%204%2C%205%5D.into_iter().collect()%3B%0A%0Alet%20result%20%3D%20%26a%20-%20%26b%3B%0Alet%20result_vec%3A%20Vec%3C_%3E%20%3D%20result.into_iter().collect()%3B%0Aassert_eq!(result_vec%2C%20%5B1%2C%202%5D)%3B%0A%7D">Run</a></pre>
</div></div><h3 id='impl-Debug' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T&gt; <a class="trait" href="../../std/fmt/trait.Debug.html" title="trait std::fmt::Debug">Debug</a> for <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/fmt/trait.Debug.html" title="trait std::fmt::Debug">Debug</a>,&nbsp;</span></code><a href='#impl-Debug' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#914-918' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="../../std/fmt/struct.Formatter.html" title="struct std::fmt::Formatter">Formatter</a>) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="primitive" href="../primitive.unit.html">()</a>, <a class="struct" href="../../std/fmt/struct.Error.html" title="struct std::fmt::Error">Error</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#915-917' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Formats the value using the given formatter. <a href="../../std/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-Clone' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T&gt; <a class="trait" href="../../std/clone/trait.Clone.html" title="trait std::clone::Clone">Clone</a> for <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/clone/trait.Clone.html" title="trait std::clone::Clone">Clone</a>,&nbsp;</span></code><a href='#impl-Clone' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#70' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.clone' class="method"><span id='clone.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#70' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a copy of the value. <a href="../../std/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'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: <a class="primitive" href="../primitive.reference.html">&amp;</a>Self)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/clone.rs.html#130-132' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="../../std/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id='impl-Hash' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T&gt; <a class="trait" href="../../std/hash/trait.Hash.html" title="trait std::hash::Hash">Hash</a> for <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/hash/trait.Hash.html" title="trait std::hash::Hash">Hash</a>,&nbsp;</span></code><a href='#impl-Hash' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#70' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.hash' class="method"><span id='hash.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a>&lt;__HT&gt;(&amp;self, state: <a class="primitive" href="../primitive.reference.html">&amp;mut </a>__HT) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;__HT: <a class="trait" href="../../std/hash/trait.Hasher.html" title="trait std::hash::Hasher">Hasher</a>,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#70' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="../../std/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
</div><h4 id='method.hash_slice' class="method"><span id='hash_slice.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a>&lt;H&gt;(data: <a class="primitive" href="../primitive.slice.html">&amp;[Self]</a>, state: <a class="primitive" href="../primitive.reference.html">&amp;mut </a>H) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="../../std/hash/trait.Hasher.html" title="trait std::hash::Hasher">Hasher</a>,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.3.0'>1.3.0</div><a class='srclink' href='../../src/core/hash/mod.rs.html#203-209' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="../../std/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
</div></div><h3 id='impl-BitOr%3C%26%27b%20BTreeSet%3CT%3E%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a, 'b, T&gt; <a class="trait" href="../../std/ops/trait.BitOr.html" title="trait std::ops::BitOr">BitOr</a>&lt;&amp;'b <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;&gt; for &amp;'a <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a> + <a class="trait" href="../../std/clone/trait.Clone.html" title="trait std::clone::Clone">Clone</a>,&nbsp;</span></code><a href='#impl-BitOr%3C%26%27b%20BTreeSet%3CT%3E%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#891-911' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Output-2' class="type"><span id='Output.t-2' class='invisible'><code>type <a href='../../std/ops/trait.BitOr.html#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;</code></span></h4>
<div class='docblock'><p>The resulting type after applying the <code>|</code> operator.</p>
</div><h4 id='method.bitor' class="method"><span id='bitor.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/ops/trait.BitOr.html#tymethod.bitor' class='fnname'>bitor</a>(self, rhs: &amp;<a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;) -&gt; <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#908-910' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the union of <code>self</code> and <code>rhs</code> as a new <code>BTreeSet&lt;T&gt;</code>.</p>
<h1 id="examples-24" class="section-header"><a href="#examples-24">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="ident">a</span>: <span class="ident">BTreeSet</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>].<span class="ident">into_iter</span>().<span class="ident">collect</span>();
<span class="kw">let</span> <span class="ident">b</span>: <span class="ident">BTreeSet</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>].<span class="ident">into_iter</span>().<span class="ident">collect</span>();

<span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="kw-2">&amp;</span><span class="ident">a</span> <span class="op">|</span> <span class="kw-2">&amp;</span><span class="ident">b</span>;
<span class="kw">let</span> <span class="ident">result_vec</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">result</span>.<span class="ident">into_iter</span>().<span class="ident">collect</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result_vec</span>, [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>]);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20a%3A%20BTreeSet%3C_%3E%20%3D%20vec!%5B1%2C%202%2C%203%5D.into_iter().collect()%3B%0Alet%20b%3A%20BTreeSet%3C_%3E%20%3D%20vec!%5B3%2C%204%2C%205%5D.into_iter().collect()%3B%0A%0Alet%20result%20%3D%20%26a%20%7C%20%26b%3B%0Alet%20result_vec%3A%20Vec%3C_%3E%20%3D%20result.into_iter().collect()%3B%0Aassert_eq!(result_vec%2C%20%5B1%2C%202%2C%203%2C%204%2C%205%5D)%3B%0A%7D">Run</a></pre>
</div></div><h3 id='impl-Eq' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T&gt; <a class="trait" href="../../std/cmp/trait.Eq.html" title="trait std::cmp::Eq">Eq</a> for <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/cmp/trait.Eq.html" title="trait std::cmp::Eq">Eq</a>,&nbsp;</span></code><a href='#impl-Eq' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#70' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Extend%3CT%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T&gt; <a class="trait" href="../../std/iter/trait.Extend.html" title="trait std::iter::Extend">Extend</a>&lt;T&gt; for <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a>,&nbsp;</span></code><a href='#impl-Extend%3CT%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#797-804' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.extend' class="method"><span id='extend.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/iter/trait.Extend.html#tymethod.extend' class='fnname'>extend</a>&lt;Iter&gt;(&amp;mut self, iter: Iter) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Iter: <a class="trait" href="../../std/iter/trait.IntoIterator.html" title="trait std::iter::IntoIterator">IntoIterator</a>&lt;Item = T&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#799-803' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Extends a collection with the contents of an iterator. <a href="../../std/iter/trait.Extend.html#tymethod.extend">Read more</a></p>
</div></div><h3 id='impl-Extend%3C%26%27a%20T%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a, T&gt; <a class="trait" href="../../std/iter/trait.Extend.html" title="trait std::iter::Extend">Extend</a>&lt;<a class="primitive" href="../primitive.reference.html">&amp;'a </a>T&gt; for <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'a + <a class="trait" href="../../std/marker/trait.Copy.html" title="trait std::marker::Copy">Copy</a> + <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a>,&nbsp;</span></code><a href='#impl-Extend%3C%26%27a%20T%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.2.0'>1.2.0</div><a class='srclink' href='../../src/alloc/btree/set.rs.html#807-811' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.extend-1' class="method"><span id='extend.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/iter/trait.Extend.html#tymethod.extend' class='fnname'>extend</a>&lt;I&gt;(&amp;mut self, iter: I) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="../../std/iter/trait.IntoIterator.html" title="trait std::iter::IntoIterator">IntoIterator</a>&lt;Item = <a class="primitive" href="../primitive.reference.html">&amp;'a </a>T&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#808-810' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Extends a collection with the contents of an iterator. <a href="../../std/iter/trait.Extend.html#tymethod.extend">Read more</a></p>
</div></div><h3 id='impl-PartialEq%3CBTreeSet%3CT%3E%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T&gt; <a class="trait" href="../../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;&gt; for <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-PartialEq%3CBTreeSet%3CT%3E%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#70' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.eq' class="method"><span id='eq.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;<a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#70' title='goto source code'>[src]</a></td></tr></tbody></table></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="../../std/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne' class="method"><span id='ne.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: &amp;<a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#70' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-IntoIterator' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a, T&gt; <a class="trait" href="../../std/iter/trait.IntoIterator.html" title="trait std::iter::IntoIterator">IntoIterator</a> for &amp;'a <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;</code><a href='#impl-IntoIterator' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#787-794' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Item' class="type"><span id='Item.t' class='invisible'><code>type <a href='../../std/iter/trait.IntoIterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="../primitive.reference.html">&amp;'a </a>T</code></span></h4>
<div class='docblock'><p>The type of the elements being iterated over.</p>
</div><h4 id='associatedtype.IntoIter' class="type"><span id='IntoIter.t' class='invisible'><code>type <a href='../../std/iter/trait.IntoIterator.html#associatedtype.IntoIter' class="type">IntoIter</a> = <a class="struct" href="../../std/collections/btree_set/struct.Iter.html" title="struct std::collections::btree_set::Iter">Iter</a>&lt;'a, T&gt;</code></span></h4>
<div class='docblock'><p>Which kind of iterator are we turning this into?</p>
</div><h4 id='method.into_iter' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../std/collections/btree_set/struct.Iter.html" title="struct std::collections::btree_set::Iter">Iter</a>&lt;'a, T&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../std/collections/btree_set/struct.Iter.html" title="struct std::collections::btree_set::Iter">Iter</a>&lt;'a, T&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, T&gt; <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="struct" href="../../std/collections/btree_set/struct.Iter.html" title="struct std::collections::btree_set::Iter">Iter</a>&lt;'a, T&gt;</span><span class="where fmt-newline">    type <a href='../../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="../primitive.reference.html">&amp;'a </a>T;</span></code></div></div><span id='into_iter.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/iter/trait.IntoIterator.html#tymethod.into_iter' class='fnname'>into_iter</a>(self) -&gt; <a class="struct" href="../../std/collections/btree_set/struct.Iter.html" title="struct std::collections::btree_set::Iter">Iter</a>&lt;'a, T&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#791-793' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates an iterator from a value. <a href="../../std/iter/trait.IntoIterator.html#tymethod.into_iter">Read more</a></p>
</div></div><h3 id='impl-IntoIterator-1' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T&gt; <a class="trait" href="../../std/iter/trait.IntoIterator.html" title="trait std::iter::IntoIterator">IntoIterator</a> for <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;</code><a href='#impl-IntoIterator-1' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#765-784' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Item-1' class="type"><span id='Item.t-1' class='invisible'><code>type <a href='../../std/iter/trait.IntoIterator.html#associatedtype.Item' class="type">Item</a> = T</code></span></h4>
<div class='docblock'><p>The type of the elements being iterated over.</p>
</div><h4 id='associatedtype.IntoIter-1' class="type"><span id='IntoIter.t-1' class='invisible'><code>type <a href='../../std/iter/trait.IntoIterator.html#associatedtype.IntoIter' class="type">IntoIter</a> = <a class="struct" href="../../std/collections/btree_set/struct.IntoIter.html" title="struct std::collections::btree_set::IntoIter">IntoIter</a>&lt;T&gt;</code></span></h4>
<div class='docblock'><p>Which kind of iterator are we turning this into?</p>
</div><h4 id='method.into_iter-1' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../std/collections/btree_set/struct.IntoIter.html" title="struct std::collections::btree_set::IntoIter">IntoIter</a>&lt;T&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../std/collections/btree_set/struct.IntoIter.html" title="struct std::collections::btree_set::IntoIter">IntoIter</a>&lt;T&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;T&gt; <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="struct" href="../../std/collections/btree_set/struct.IntoIter.html" title="struct std::collections::btree_set::IntoIter">IntoIter</a>&lt;T&gt;</span><span class="where fmt-newline">    type <a href='../../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = T;</span></code></div></div><span id='into_iter.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/iter/trait.IntoIterator.html#tymethod.into_iter' class='fnname'>into_iter</a>(self) -&gt; <a class="struct" href="../../std/collections/btree_set/struct.IntoIter.html" title="struct std::collections::btree_set::IntoIter">IntoIter</a>&lt;T&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#781-783' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Gets an iterator for moving out the <code>BTreeSet</code>'s contents.</p>
<h1 id="examples-25" class="section-header"><a href="#examples-25">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="ident">set</span>: <span class="ident">BTreeSet</span><span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span> <span class="op">=</span> [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>].<span class="ident">iter</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>();

<span class="kw">let</span> <span class="ident">v</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">set</span>.<span class="ident">into_iter</span>().<span class="ident">collect</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">v</span>, [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>]);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20set%3A%20BTreeSet%3Cusize%3E%20%3D%20%5B1%2C%202%2C%203%2C%204%5D.iter().cloned().collect()%3B%0A%0Alet%20v%3A%20Vec%3C_%3E%20%3D%20set.into_iter().collect()%3B%0Aassert_eq!(v%2C%20%5B1%2C%202%2C%203%2C%204%5D)%3B%0A%7D">Run</a></pre>
</div></div><h3 id='impl-BitXor%3C%26%27b%20BTreeSet%3CT%3E%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a, 'b, T&gt; <a class="trait" href="../../std/ops/trait.BitXor.html" title="trait std::ops::BitXor">BitXor</a>&lt;&amp;'b <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;&gt; for &amp;'a <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a> + <a class="trait" href="../../std/clone/trait.Clone.html" title="trait std::clone::Clone">Clone</a>,&nbsp;</span></code><a href='#impl-BitXor%3C%26%27b%20BTreeSet%3CT%3E%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#845-865' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Output-3' class="type"><span id='Output.t-3' class='invisible'><code>type <a href='../../std/ops/trait.BitXor.html#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;</code></span></h4>
<div class='docblock'><p>The resulting type after applying the <code>^</code> operator.</p>
</div><h4 id='method.bitxor' class="method"><span id='bitxor.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../std/ops/trait.BitXor.html#tymethod.bitxor' class='fnname'>bitxor</a>(self, rhs: &amp;<a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;) -&gt; <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/set.rs.html#862-864' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the symmetric difference of <code>self</code> and <code>rhs</code> as a new <code>BTreeSet&lt;T&gt;</code>.</p>
<h1 id="examples-26" class="section-header"><a href="#examples-26">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;

<span class="kw">let</span> <span class="ident">a</span>: <span class="ident">BTreeSet</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>].<span class="ident">into_iter</span>().<span class="ident">collect</span>();
<span class="kw">let</span> <span class="ident">b</span>: <span class="ident">BTreeSet</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>].<span class="ident">into_iter</span>().<span class="ident">collect</span>();

<span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="kw-2">&amp;</span><span class="ident">a</span> <span class="op">^</span> <span class="kw-2">&amp;</span><span class="ident">b</span>;
<span class="kw">let</span> <span class="ident">result_vec</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">result</span>.<span class="ident">into_iter</span>().<span class="ident">collect</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">result_vec</span>, [<span class="number">1</span>, <span class="number">4</span>]);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Acollections%3A%3ABTreeSet%3B%0A%0Alet%20a%3A%20BTreeSet%3C_%3E%20%3D%20vec!%5B1%2C%202%2C%203%5D.into_iter().collect()%3B%0Alet%20b%3A%20BTreeSet%3C_%3E%20%3D%20vec!%5B2%2C%203%2C%204%5D.into_iter().collect()%3B%0A%0Alet%20result%20%3D%20%26a%20%5E%20%26b%3B%0Alet%20result_vec%3A%20Vec%3C_%3E%20%3D%20result.into_iter().collect()%3B%0Aassert_eq!(result_vec%2C%20%5B1%2C%204%5D)%3B%0A%7D">Run</a></pre>
</div></div></div>
                <h2 id='synthetic-implementations' class='small-section-header'>
                  Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
                </h2>
                <div id='synthetic-implementations-list'>
            <h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T&gt; <a class="trait" href="../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a> for <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a>,&nbsp;</span></code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T&gt; <a class="trait" href="../../std/marker/trait.Sync.html" title="trait std::marker::Sync">Sync</a> for <a class="struct" href="../../std/collections/btree_set/struct.BTreeSet.html" title="struct std::collections::btree_set::BTreeSet">BTreeSet</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/marker/trait.Sync.html" title="trait std::marker::Sync">Sync</a>,&nbsp;</span></code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></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>&#9166;</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><p>Search multiple things at once by splitting your query with comma (e.g. <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "std";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>