blob: d9840b57435a54a1fb18b360d029c64b31b7d167 [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A hash set where the iteration order of the values is independent of their hash values."><meta name="keywords" content="rust, rustlang, rust-lang, IndexSet"><title>IndexSet in indexmap::set - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../indexmap/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../indexmap/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">IndexSet</a></h2><div class="sidebar-elems"><section><h3><a href="#implementations">Methods</a></h3><ul class="block"><li><a href="#method.capacity">capacity</a></li><li><a href="#method.clear">clear</a></li><li><a href="#method.contains">contains</a></li><li><a href="#method.difference">difference</a></li><li><a href="#method.drain">drain</a></li><li><a href="#method.first">first</a></li><li><a href="#method.get">get</a></li><li><a href="#method.get_full">get_full</a></li><li><a href="#method.get_index">get_index</a></li><li><a href="#method.get_index_of">get_index_of</a></li><li><a href="#method.hasher">hasher</a></li><li><a href="#method.insert">insert</a></li><li><a href="#method.insert_full">insert_full</a></li><li><a href="#method.intersection">intersection</a></li><li><a href="#method.is_disjoint">is_disjoint</a></li><li><a href="#method.is_empty">is_empty</a></li><li><a href="#method.is_subset">is_subset</a></li><li><a href="#method.is_superset">is_superset</a></li><li><a href="#method.iter">iter</a></li><li><a href="#method.last">last</a></li><li><a href="#method.len">len</a></li><li><a href="#method.move_index">move_index</a></li><li><a href="#method.new">new</a></li><li><a href="#method.pop">pop</a></li><li><a href="#method.remove">remove</a></li><li><a href="#method.replace">replace</a></li><li><a href="#method.replace_full">replace_full</a></li><li><a href="#method.reserve">reserve</a></li><li><a href="#method.retain">retain</a></li><li><a href="#method.reverse">reverse</a></li><li><a href="#method.shift_remove">shift_remove</a></li><li><a href="#method.shift_remove_full">shift_remove_full</a></li><li><a href="#method.shift_remove_index">shift_remove_index</a></li><li><a href="#method.shift_take">shift_take</a></li><li><a href="#method.shrink_to">shrink_to</a></li><li><a href="#method.shrink_to_fit">shrink_to_fit</a></li><li><a href="#method.sort">sort</a></li><li><a href="#method.sort_by">sort_by</a></li><li><a href="#method.sort_unstable">sort_unstable</a></li><li><a href="#method.sort_unstable_by">sort_unstable_by</a></li><li><a href="#method.sorted_by">sorted_by</a></li><li><a href="#method.sorted_unstable_by">sorted_unstable_by</a></li><li><a href="#method.split_off">split_off</a></li><li><a href="#method.swap_indices">swap_indices</a></li><li><a href="#method.swap_remove">swap_remove</a></li><li><a href="#method.swap_remove_full">swap_remove_full</a></li><li><a href="#method.swap_remove_index">swap_remove_index</a></li><li><a href="#method.swap_take">swap_take</a></li><li><a href="#method.symmetric_difference">symmetric_difference</a></li><li><a href="#method.take">take</a></li><li><a href="#method.truncate">truncate</a></li><li><a href="#method.union">union</a></li><li><a href="#method.with_capacity">with_capacity</a></li><li><a href="#method.with_capacity_and_hasher">with_capacity_and_hasher</a></li><li><a href="#method.with_hasher">with_hasher</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block"><li><a href="#impl-BitAnd%3C%26IndexSet%3CT%2C%20S2%3E%3E-for-%26IndexSet%3CT%2C%20S1%3E">BitAnd&lt;&amp;IndexSet&lt;T, S2&gt;&gt;</a></li><li><a href="#impl-BitOr%3C%26IndexSet%3CT%2C%20S2%3E%3E-for-%26IndexSet%3CT%2C%20S1%3E">BitOr&lt;&amp;IndexSet&lt;T, S2&gt;&gt;</a></li><li><a href="#impl-BitXor%3C%26IndexSet%3CT%2C%20S2%3E%3E-for-%26IndexSet%3CT%2C%20S1%3E">BitXor&lt;&amp;IndexSet&lt;T, S2&gt;&gt;</a></li><li><a href="#impl-Clone-for-IndexSet%3CT%2C%20S%3E">Clone</a></li><li><a href="#impl-Debug-for-IndexSet%3CT%2C%20S%3E">Debug</a></li><li><a href="#impl-Default-for-IndexSet%3CT%2C%20S%3E">Default</a></li><li><a href="#impl-Eq-for-IndexSet%3CT%2C%20S%3E">Eq</a></li><li><a href="#impl-Extend%3C%26%27a%20T%3E-for-IndexSet%3CT%2C%20S%3E">Extend&lt;&amp;&#39;a T&gt;</a></li><li><a href="#impl-Extend%3CT%3E-for-IndexSet%3CT%2C%20S%3E">Extend&lt;T&gt;</a></li><li><a href="#impl-From%3C%5BT%3B%20N%5D%3E-for-IndexSet%3CT%2C%20RandomState%3E">From&lt;[T; N]&gt;</a></li><li><a href="#impl-FromIterator%3CT%3E-for-IndexSet%3CT%2C%20S%3E">FromIterator&lt;T&gt;</a></li><li><a href="#impl-Index%3Cusize%3E-for-IndexSet%3CT%2C%20S%3E">Index&lt;usize&gt;</a></li><li><a href="#impl-IntoIterator-for-%26%27a%20IndexSet%3CT%2C%20S%3E">IntoIterator</a></li><li><a href="#impl-IntoIterator-for-IndexSet%3CT%2C%20S%3E">IntoIterator</a></li><li><a href="#impl-PartialEq%3CIndexSet%3CT%2C%20S2%3E%3E-for-IndexSet%3CT%2C%20S1%3E">PartialEq&lt;IndexSet&lt;T, S2&gt;&gt;</a></li><li><a href="#impl-Sub%3C%26IndexSet%3CT%2C%20S2%3E%3E-for-%26IndexSet%3CT%2C%20S1%3E">Sub&lt;&amp;IndexSet&lt;T, S2&gt;&gt;</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block"><li><a href="#impl-RefUnwindSafe-for-IndexSet%3CT%2C%20S%3E">RefUnwindSafe</a></li><li><a href="#impl-Send-for-IndexSet%3CT%2C%20S%3E">Send</a></li><li><a href="#impl-Sync-for-IndexSet%3CT%2C%20S%3E">Sync</a></li><li><a href="#impl-Unpin-for-IndexSet%3CT%2C%20S%3E">Unpin</a></li><li><a href="#impl-UnwindSafe-for-IndexSet%3CT%2C%20S%3E">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block"><li><a href="#impl-Any-for-IndexSet%3CT%2C%20S%3E">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-IndexSet%3CT%2C%20S%3E">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-IndexSet%3CT%2C%20S%3E">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-From%3CT%3E-for-IndexSet%3CT%2C%20S%3E">From&lt;T&gt;</a></li><li><a href="#impl-Into%3CU%3E-for-IndexSet%3CT%2C%20S%3E">Into&lt;U&gt;</a></li><li><a href="#impl-ToOwned-for-IndexSet%3CT%2C%20S%3E">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E-for-IndexSet%3CT%2C%20S%3E">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E-for-IndexSet%3CT%2C%20S%3E">TryInto&lt;U&gt;</a></li></ul></section><h2><a href="index.html">In indexmap::set</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Struct <a href="../index.html">indexmap</a>::<wbr><a href="index.html">set</a>::<wbr><a class="struct" href="#">IndexSet</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../../src/indexmap/set.rs.html#63-65">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="item-decl"><pre class="rust struct"><code>pub struct IndexSet&lt;T, S&nbsp;=&nbsp;RandomState&gt; { /* private fields */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A hash set where the iteration order of the values is independent of their
hash values.</p>
<p>The interface is closely compatible with the standard <code>HashSet</code>, but also
has additional features.</p>
<h2 id="order"><a href="#order">Order</a></h2>
<p>The values have a consistent order that is determined by the sequence of
insertion and removal calls on the set. The order does not depend on the
values or the hash function at all. Note that insertion order and value
are not affected if a re-insertion is attempted once an element is
already present.</p>
<p>All iterators traverse the set <em>in order</em>. Set operation iterators like
<code>union</code> produce a concatenated order, as do their matching “bitwise”
operators. See their documentation for specifics.</p>
<p>The insertion order is preserved, with <strong>notable exceptions</strong> like the
<code>.remove()</code> or <code>.swap_remove()</code> methods. Methods such as <code>.sort_by()</code> of
course result in a new order, depending on the sorting order.</p>
<h2 id="indices"><a href="#indices">Indices</a></h2>
<p>The values are indexed in a compact range without holes in the range
<code>0..self.len()</code>. For example, the method <code>.get_full</code> looks up the index for
a value, and the method <code>.get_index</code> looks up the value by index.</p>
<h2 id="examples"><a href="#examples">Examples</a></h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>indexmap::IndexSet;
<span class="comment">// Collects which letters appear in a sentence.
</span><span class="kw">let </span>letters: IndexSet&lt;<span class="kw">_</span>&gt; = <span class="string">&quot;a short treatise on fungi&quot;</span>.chars().collect();
<span class="macro">assert!</span>(letters.contains(<span class="kw-2">&amp;</span><span class="string">&#39;s&#39;</span>));
<span class="macro">assert!</span>(letters.contains(<span class="kw-2">&amp;</span><span class="string">&#39;t&#39;</span>));
<span class="macro">assert!</span>(letters.contains(<span class="kw-2">&amp;</span><span class="string">&#39;u&#39;</span>));
<span class="macro">assert!</span>(!letters.contains(<span class="kw-2">&amp;</span><span class="string">&#39;y&#39;</span>));</code></pre></div>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-IndexSet%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#128-145">source</a><a href="#impl-IndexSet%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.new" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#130-134">source</a><h4 class="code-header">pub fn <a href="#method.new" class="fnname">new</a>() -&gt; Self</h4></section></summary><div class="docblock"><p>Create a new set. (Does not allocate.)</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.with_capacity" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#140-144">source</a><h4 class="code-header">pub fn <a href="#method.with_capacity" class="fnname">with_capacity</a>(n: usize) -&gt; Self</h4></section></summary><div class="docblock"><p>Create a new set with capacity for <code>n</code> elements.
(Does not allocate if <code>n</code> is zero.)</p>
<p>Computes in <strong>O(n)</strong> time.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#147-250">source</a><a href="#impl-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, S&gt; <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.with_capacity_and_hasher" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#152-156">source</a><h4 class="code-header">pub fn <a href="#method.with_capacity_and_hasher" class="fnname">with_capacity_and_hasher</a>(n: usize, hash_builder: S) -&gt; Self</h4></section></summary><div class="docblock"><p>Create a new set with capacity for <code>n</code> elements.
(Does not allocate if <code>n</code> is zero.)</p>
<p>Computes in <strong>O(n)</strong> time.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.with_hasher" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#162-166">source</a><h4 class="code-header">pub const fn <a href="#method.with_hasher" class="fnname">with_hasher</a>(hash_builder: S) -&gt; Self</h4></section></summary><div class="docblock"><p>Create a new set with <code>hash_builder</code>.</p>
<p>This function is <code>const</code>, so it
can be called in <code>static</code> contexts.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.capacity" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#169-171">source</a><h4 class="code-header">pub fn <a href="#method.capacity" class="fnname">capacity</a>(&amp;self) -&gt; usize</h4></section></summary><div class="docblock"><p>Computes in <strong>O(1)</strong> time.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.hasher" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#174-176">source</a><h4 class="code-header">pub fn <a href="#method.hasher" class="fnname">hasher</a>(&amp;self) -&gt; &amp;S</h4></section></summary><div class="docblock"><p>Return a reference to the set’s <code>BuildHasher</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.len" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#181-183">source</a><h4 class="code-header">pub fn <a href="#method.len" class="fnname">len</a>(&amp;self) -&gt; usize</h4></section></summary><div class="docblock"><p>Return the number of elements in the set.</p>
<p>Computes in <strong>O(1)</strong> time.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_empty" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#188-190">source</a><h4 class="code-header">pub fn <a href="#method.is_empty" class="fnname">is_empty</a>(&amp;self) -&gt; bool</h4></section></summary><div class="docblock"><p>Returns true if the set contains no elements.</p>
<p>Computes in <strong>O(1)</strong> time.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.iter" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#193-197">source</a><h4 class="code-header">pub fn <a href="#method.iter" class="fnname">iter</a>(&amp;self) -&gt; <a class="struct" href="struct.Iter.html" title="struct indexmap::set::Iter">Iter</a>&lt;'_, T&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Iter.html" title="struct indexmap::set::Iter">Iter</a>&lt;'a, T&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a, T&gt; Iterator for <a class="struct" href="struct.Iter.html" title="struct indexmap::set::Iter">Iter</a>&lt;'a, T&gt;</span><span class="where fmt-newline"> type <a class="associatedtype">Item</a> = &amp;'a T;</span></code></span></span></span></span></h4></section></summary><div class="docblock"><p>Return an iterator over the values of the set, in their order</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clear" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#202-204">source</a><h4 class="code-header">pub fn <a href="#method.clear" class="fnname">clear</a>(&amp;mut self)</h4></section></summary><div class="docblock"><p>Remove all elements in the set, while preserving its capacity.</p>
<p>Computes in <strong>O(n)</strong> time.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.truncate" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#209-211">source</a><h4 class="code-header">pub fn <a href="#method.truncate" class="fnname">truncate</a>(&amp;mut self, len: usize)</h4></section></summary><div class="docblock"><p>Shortens the set, keeping the first <code>len</code> elements and dropping the rest.</p>
<p>If <code>len</code> is greater than the set’s current length, this has no effect.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.drain" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#226-233">source</a><h4 class="code-header">pub fn <a href="#method.drain" class="fnname">drain</a>&lt;R&gt;(&amp;mut self, range: R) -&gt; <a class="struct" href="struct.Drain.html" title="struct indexmap::set::Drain">Drain</a>&lt;'_, T&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Drain.html" title="struct indexmap::set::Drain">Drain</a>&lt;'_, T&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;T&gt; Iterator for <a class="struct" href="struct.Drain.html" title="struct indexmap::set::Drain">Drain</a>&lt;'_, T&gt;</span><span class="where fmt-newline"> type <a class="associatedtype">Item</a> = T;</span></code></span></span></span></span><span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R: RangeBounds&lt;usize&gt;,</span></h4></section></summary><div class="docblock"><p>Clears the <code>IndexSet</code> in the given index range, returning those values
as a drain iterator.</p>
<p>The range may be any type that implements <code>RangeBounds&lt;usize&gt;</code>,
including all of the <code>std::ops::Range*</code> types, or even a tuple pair of
<code>Bound</code> start and end values. To drain the set entirely, use <code>RangeFull</code>
like <code>set.drain(..)</code>.</p>
<p>This shifts down all entries following the drained range to fill the
gap, and keeps the allocated memory for reuse.</p>
<p><em><strong>Panics</strong></em> if the starting point is greater than the end point or if
the end point is greater than the length of the set.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.split_off" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#242-249">source</a><h4 class="code-header">pub fn <a href="#method.split_off" class="fnname">split_off</a>(&amp;mut self, at: usize) -&gt; Self<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Clone,</span></h4></section></summary><div class="docblock"><p>Splits the collection into two at the given index.</p>
<p>Returns a newly allocated set containing the elements in the range
<code>[at, len)</code>. After the call, the original set will be left containing
the elements <code>[0, at)</code> with its previous capacity unchanged.</p>
<p><em><strong>Panics</strong></em> if <code>at &gt; len</code>.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-IndexSet%3CT%2C%20S%3E-1" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#252-651">source</a><a href="#impl-IndexSet%3CT%2C%20S%3E-1" class="anchor"></a><h3 class="code-header">impl&lt;T, S&gt; <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Hash + Eq,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: BuildHasher,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.reserve" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#260-262">source</a><h4 class="code-header">pub fn <a href="#method.reserve" class="fnname">reserve</a>(&amp;mut self, additional: usize)</h4></section></summary><div class="docblock"><p>Reserve capacity for <code>additional</code> more values.</p>
<p>Computes in <strong>O(n)</strong> time.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.shrink_to_fit" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#267-269">source</a><h4 class="code-header">pub fn <a href="#method.shrink_to_fit" class="fnname">shrink_to_fit</a>(&amp;mut self)</h4></section></summary><div class="docblock"><p>Shrink the capacity of the set as much as possible.</p>
<p>Computes in <strong>O(n)</strong> time.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.shrink_to" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#274-276">source</a><h4 class="code-header">pub fn <a href="#method.shrink_to" class="fnname">shrink_to</a>(&amp;mut self, min_capacity: usize)</h4></section></summary><div class="docblock"><p>Shrink the capacity of the set with a lower limit.</p>
<p>Computes in <strong>O(n)</strong> time.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.insert" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#286-288">source</a><h4 class="code-header">pub fn <a href="#method.insert" class="fnname">insert</a>(&amp;mut self, value: T) -&gt; bool</h4></section></summary><div class="docblock"><p>Insert the value into the set.</p>
<p>If an equivalent item already exists in the set, it returns
<code>false</code> leaving the original value in the set and without
altering its insertion order. Otherwise, it inserts the new
item and returns <code>true</code>.</p>
<p>Computes in <strong>O(1)</strong> time (amortized average).</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.insert_full" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#299-310">source</a><h4 class="code-header">pub fn <a href="#method.insert_full" class="fnname">insert_full</a>(&amp;mut self, value: T) -&gt; (usize, bool)</h4></section></summary><div class="docblock"><p>Insert the value into the set, and get its index.</p>
<p>If an equivalent item already exists in the set, it returns
the index of the existing item and <code>false</code>, leaving the
original value in the set and without altering its insertion
order. Otherwise, it inserts the new item and returns the index
of the inserted item and <code>true</code>.</p>
<p>Computes in <strong>O(1)</strong> time (amortized average).</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.difference" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#315-323">source</a><h4 class="code-header">pub fn <a href="#method.difference" class="fnname">difference</a>&lt;'a, S2&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'a self,<br>&nbsp;&nbsp;&nbsp;&nbsp;other: &amp;'a <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S2&gt;<br>) -&gt; <a class="struct" href="struct.Difference.html" title="struct indexmap::set::Difference">Difference</a>&lt;'a, T, S2&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Difference.html" title="struct indexmap::set::Difference">Difference</a>&lt;'a, T, S&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a, T, S&gt; Iterator for <a class="struct" href="struct.Difference.html" title="struct indexmap::set::Difference">Difference</a>&lt;'a, T, S&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Eq + Hash,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: BuildHasher,</span></span><span class="where fmt-newline"> type <a class="associatedtype">Item</a> = &amp;'a T;</span></code></span></span></span></span><span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S2: BuildHasher,</span></h4></section></summary><div class="docblock"><p>Return an iterator over the values that are in <code>self</code> but not <code>other</code>.</p>
<p>Values are produced in the same order that they appear in <code>self</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.symmetric_difference" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#330-340">source</a><h4 class="code-header">pub fn <a href="#method.symmetric_difference" class="fnname">symmetric_difference</a>&lt;'a, S2&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'a self,<br>&nbsp;&nbsp;&nbsp;&nbsp;other: &amp;'a <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S2&gt;<br>) -&gt; <a class="struct" href="struct.SymmetricDifference.html" title="struct indexmap::set::SymmetricDifference">SymmetricDifference</a>&lt;'a, T, S, S2&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.SymmetricDifference.html" title="struct indexmap::set::SymmetricDifference">SymmetricDifference</a>&lt;'a, T, S1, S2&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a, T, S1, S2&gt; Iterator for <a class="struct" href="struct.SymmetricDifference.html" title="struct indexmap::set::SymmetricDifference">SymmetricDifference</a>&lt;'a, T, S1, S2&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Eq + Hash,<br>&nbsp;&nbsp;&nbsp;&nbsp;S1: BuildHasher,<br>&nbsp;&nbsp;&nbsp;&nbsp;S2: BuildHasher,</span></span><span class="where fmt-newline"> type <a class="associatedtype">Item</a> = &amp;'a T;</span></code></span></span></span></span><span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S2: BuildHasher,</span></h4></section></summary><div class="docblock"><p>Return an iterator over the values that are in <code>self</code> or <code>other</code>,
but not in both.</p>
<p>Values from <code>self</code> are produced in their original order, followed by
values from <code>other</code> in their original order.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.intersection" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#345-353">source</a><h4 class="code-header">pub fn <a href="#method.intersection" class="fnname">intersection</a>&lt;'a, S2&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'a self,<br>&nbsp;&nbsp;&nbsp;&nbsp;other: &amp;'a <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S2&gt;<br>) -&gt; <a class="struct" href="struct.Intersection.html" title="struct indexmap::set::Intersection">Intersection</a>&lt;'a, T, S2&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Intersection.html" title="struct indexmap::set::Intersection">Intersection</a>&lt;'a, T, S&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a, T, S&gt; Iterator for <a class="struct" href="struct.Intersection.html" title="struct indexmap::set::Intersection">Intersection</a>&lt;'a, T, S&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Eq + Hash,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: BuildHasher,</span></span><span class="where fmt-newline"> type <a class="associatedtype">Item</a> = &amp;'a T;</span></code></span></span></span></span><span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S2: BuildHasher,</span></h4></section></summary><div class="docblock"><p>Return an iterator over the values that are in both <code>self</code> and <code>other</code>.</p>
<p>Values are produced in the same order that they appear in <code>self</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.union" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#359-366">source</a><h4 class="code-header">pub fn <a href="#method.union" class="fnname">union</a>&lt;'a, S2&gt;(&amp;'a self, other: &amp;'a <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S2&gt;) -&gt; <a class="struct" href="struct.Union.html" title="struct indexmap::set::Union">Union</a>&lt;'a, T, S&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Union.html" title="struct indexmap::set::Union">Union</a>&lt;'a, T, S&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a, T, S&gt; Iterator for <a class="struct" href="struct.Union.html" title="struct indexmap::set::Union">Union</a>&lt;'a, T, S&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Eq + Hash,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: BuildHasher,</span></span><span class="where fmt-newline"> type <a class="associatedtype">Item</a> = &amp;'a T;</span></code></span></span></span></span><span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S2: BuildHasher,</span></h4></section></summary><div class="docblock"><p>Return an iterator over all values that are in <code>self</code> or <code>other</code>.</p>
<p>Values from <code>self</code> are produced in their original order, followed by
values that are unique to <code>other</code> in their original order.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.contains" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#371-376">source</a><h4 class="code-header">pub fn <a href="#method.contains" class="fnname">contains</a>&lt;Q:&nbsp;?Sized&gt;(&amp;self, value: &amp;Q) -&gt; bool<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a>&lt;T&gt;,</span></h4></section></summary><div class="docblock"><p>Return <code>true</code> if an equivalent to <code>value</code> exists in the set.</p>
<p>Computes in <strong>O(1)</strong> time (average).</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.get" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#382-387">source</a><h4 class="code-header">pub fn <a href="#method.get" class="fnname">get</a>&lt;Q:&nbsp;?Sized&gt;(&amp;self, value: &amp;Q) -&gt; Option&lt;&amp;T&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a>&lt;T&gt;,</span></h4></section></summary><div class="docblock"><p>Return a reference to the value stored in the set, if it is present,
else <code>None</code>.</p>
<p>Computes in <strong>O(1)</strong> time (average).</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.get_full" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#390-395">source</a><h4 class="code-header">pub fn <a href="#method.get_full" class="fnname">get_full</a>&lt;Q:&nbsp;?Sized&gt;(&amp;self, value: &amp;Q) -&gt; Option&lt;(usize, &amp;T)&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a>&lt;T&gt;,</span></h4></section></summary><div class="docblock"><p>Return item index and value</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.get_index_of" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#398-403">source</a><h4 class="code-header">pub fn <a href="#method.get_index_of" class="fnname">get_index_of</a>&lt;Q:&nbsp;?Sized&gt;(&amp;self, value: &amp;Q) -&gt; Option&lt;usize&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a>&lt;T&gt;,</span></h4></section></summary><div class="docblock"><p>Return item index, if it exists in the set</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.replace" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#410-412">source</a><h4 class="code-header">pub fn <a href="#method.replace" class="fnname">replace</a>(&amp;mut self, value: T) -&gt; Option&lt;T&gt;</h4></section></summary><div class="docblock"><p>Adds a value to the set, replacing the existing value, if any, that is
equal to the given one, without altering its insertion order. Returns
the replaced value.</p>
<p>Computes in <strong>O(1)</strong> time (average).</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.replace_full" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#419-430">source</a><h4 class="code-header">pub fn <a href="#method.replace_full" class="fnname">replace_full</a>(&amp;mut self, value: T) -&gt; (usize, Option&lt;T&gt;)</h4></section></summary><div class="docblock"><p>Adds a value to the set, replacing the existing value, if any, that is
equal to the given one, without altering its insertion order. Returns
the index of the item and its replaced value.</p>
<p>Computes in <strong>O(1)</strong> time (average).</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.remove" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#438-443">source</a><h4 class="code-header">pub fn <a href="#method.remove" class="fnname">remove</a>&lt;Q:&nbsp;?Sized&gt;(&amp;mut self, value: &amp;Q) -&gt; bool<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a>&lt;T&gt;,</span></h4></section></summary><div class="docblock"><p>Remove the value from the set, and return <code>true</code> if it was present.</p>
<p><strong>NOTE:</strong> This is equivalent to <code>.swap_remove(value)</code>, if you want
to preserve the order of the values in the set, use <code>.shift_remove(value)</code>.</p>
<p>Computes in <strong>O(1)</strong> time (average).</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.swap_remove" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#454-459">source</a><h4 class="code-header">pub fn <a href="#method.swap_remove" class="fnname">swap_remove</a>&lt;Q:&nbsp;?Sized&gt;(&amp;mut self, value: &amp;Q) -&gt; bool<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a>&lt;T&gt;,</span></h4></section></summary><div class="docblock"><p>Remove the value from the set, and return <code>true</code> if it was present.</p>
<p>Like <code>Vec::swap_remove</code>, the value is removed by swapping it with the
last element of the set and popping it off. <strong>This perturbs
the position of what used to be the last element!</strong></p>
<p>Return <code>false</code> if <code>value</code> was not in the set.</p>
<p>Computes in <strong>O(1)</strong> time (average).</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.shift_remove" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#470-475">source</a><h4 class="code-header">pub fn <a href="#method.shift_remove" class="fnname">shift_remove</a>&lt;Q:&nbsp;?Sized&gt;(&amp;mut self, value: &amp;Q) -&gt; bool<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a>&lt;T&gt;,</span></h4></section></summary><div class="docblock"><p>Remove the value from the set, and return <code>true</code> if it was present.</p>
<p>Like <code>Vec::remove</code>, the value is removed by shifting all of the
elements that follow it, preserving their relative order.
<strong>This perturbs the index of all of those elements!</strong></p>
<p>Return <code>false</code> if <code>value</code> was not in the set.</p>
<p>Computes in <strong>O(n)</strong> time (average).</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.take" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#485-490">source</a><h4 class="code-header">pub fn <a href="#method.take" class="fnname">take</a>&lt;Q:&nbsp;?Sized&gt;(&amp;mut self, value: &amp;Q) -&gt; Option&lt;T&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a>&lt;T&gt;,</span></h4></section></summary><div class="docblock"><p>Removes and returns the value in the set, if any, that is equal to the
given one.</p>
<p><strong>NOTE:</strong> This is equivalent to <code>.swap_take(value)</code>, if you need to
preserve the order of the values in the set, use <code>.shift_take(value)</code>
instead.</p>
<p>Computes in <strong>O(1)</strong> time (average).</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.swap_take" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#502-507">source</a><h4 class="code-header">pub fn <a href="#method.swap_take" class="fnname">swap_take</a>&lt;Q:&nbsp;?Sized&gt;(&amp;mut self, value: &amp;Q) -&gt; Option&lt;T&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a>&lt;T&gt;,</span></h4></section></summary><div class="docblock"><p>Removes and returns the value in the set, if any, that is equal to the
given one.</p>
<p>Like <code>Vec::swap_remove</code>, the value is removed by swapping it with the
last element of the set and popping it off. <strong>This perturbs
the position of what used to be the last element!</strong></p>
<p>Return <code>None</code> if <code>value</code> was not in the set.</p>
<p>Computes in <strong>O(1)</strong> time (average).</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.shift_take" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#519-524">source</a><h4 class="code-header">pub fn <a href="#method.shift_take" class="fnname">shift_take</a>&lt;Q:&nbsp;?Sized&gt;(&amp;mut self, value: &amp;Q) -&gt; Option&lt;T&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a>&lt;T&gt;,</span></h4></section></summary><div class="docblock"><p>Removes and returns the value in the set, if any, that is equal to the
given one.</p>
<p>Like <code>Vec::remove</code>, the value is removed by shifting all of the
elements that follow it, preserving their relative order.
<strong>This perturbs the index of all of those elements!</strong></p>
<p>Return <code>None</code> if <code>value</code> was not in the set.</p>
<p>Computes in <strong>O(n)</strong> time (average).</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.swap_remove_full" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#533-538">source</a><h4 class="code-header">pub fn <a href="#method.swap_remove_full" class="fnname">swap_remove_full</a>&lt;Q:&nbsp;?Sized&gt;(&amp;mut self, value: &amp;Q) -&gt; Option&lt;(usize, T)&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a>&lt;T&gt;,</span></h4></section></summary><div class="docblock"><p>Remove the value from the set return it and the index it had.</p>
<p>Like <code>Vec::swap_remove</code>, the value is removed by swapping it with the
last element of the set and popping it off. <strong>This perturbs
the position of what used to be the last element!</strong></p>
<p>Return <code>None</code> if <code>value</code> was not in the set.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.shift_remove_full" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#547-552">source</a><h4 class="code-header">pub fn <a href="#method.shift_remove_full" class="fnname">shift_remove_full</a>&lt;Q:&nbsp;?Sized&gt;(&amp;mut self, value: &amp;Q) -&gt; Option&lt;(usize, T)&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a>&lt;T&gt;,</span></h4></section></summary><div class="docblock"><p>Remove the value from the set return it and the index it had.</p>
<p>Like <code>Vec::remove</code>, the value is removed by shifting all of the
elements that follow it, preserving their relative order.
<strong>This perturbs the index of all of those elements!</strong></p>
<p>Return <code>None</code> if <code>value</code> was not in the set.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.pop" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#559-561">source</a><h4 class="code-header">pub fn <a href="#method.pop" class="fnname">pop</a>(&amp;mut self) -&gt; Option&lt;T&gt;</h4></section></summary><div class="docblock"><p>Remove the last value</p>
<p>This preserves the order of the remaining elements.</p>
<p>Computes in <strong>O(1)</strong> time (average).</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.retain" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#570-575">source</a><h4 class="code-header">pub fn <a href="#method.retain" class="fnname">retain</a>&lt;F&gt;(&amp;mut self, keep: F)<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: FnMut(&amp;T) -&gt; bool,</span></h4></section></summary><div class="docblock"><p>Scan through each value in the set and keep those where the
closure <code>keep</code> returns <code>true</code>.</p>
<p>The elements are visited in order, and remaining elements keep their
order.</p>
<p>Computes in <strong>O(n)</strong> time (average).</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.sort" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#580-585">source</a><h4 class="code-header">pub fn <a href="#method.sort" class="fnname">sort</a>(&amp;mut self)<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Ord,</span></h4></section></summary><div class="docblock"><p>Sort the set’s values by their default ordering.</p>
<p>See <a href="struct.IndexSet.html#method.sort_by"><code>sort_by</code></a> for details.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.sort_by" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#590-595">source</a><h4 class="code-header">pub fn <a href="#method.sort_by" class="fnname">sort_by</a>&lt;F&gt;(&amp;mut self, cmp: F)<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: FnMut(&amp;T, &amp;T) -&gt; Ordering,</span></h4></section></summary><div class="docblock"><p>Sort the set’s values in place using the comparison function <code>cmp</code>.</p>
<p>Computes in <strong>O(n log n)</strong> time and <strong>O(n)</strong> space. The sort is stable.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.sorted_by" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#601-610">source</a><h4 class="code-header">pub fn <a href="#method.sorted_by" class="fnname">sorted_by</a>&lt;F&gt;(self, cmp: F) -&gt; <a class="struct" href="struct.IntoIter.html" title="struct indexmap::set::IntoIter">IntoIter</a>&lt;T&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.IntoIter.html" title="struct indexmap::set::IntoIter">IntoIter</a>&lt;T&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;T&gt; Iterator for <a class="struct" href="struct.IntoIter.html" title="struct indexmap::set::IntoIter">IntoIter</a>&lt;T&gt;</span><span class="where fmt-newline"> type <a class="associatedtype">Item</a> = T;</span></code></span></span></span></span><span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: FnMut(&amp;T, &amp;T) -&gt; Ordering,</span></h4></section></summary><div class="docblock"><p>Sort the values of the set and return a by-value iterator of
the values with the result.</p>
<p>The sort is stable.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.sort_unstable" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#615-620">source</a><h4 class="code-header">pub fn <a href="#method.sort_unstable" class="fnname">sort_unstable</a>(&amp;mut self)<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Ord,</span></h4></section></summary><div class="docblock"><p>Sort the set’s values by their default ordering.</p>
<p>See <a href="struct.IndexSet.html#method.sort_unstable_by"><code>sort_unstable_by</code></a> for details.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.sort_unstable_by" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#625-630">source</a><h4 class="code-header">pub fn <a href="#method.sort_unstable_by" class="fnname">sort_unstable_by</a>&lt;F&gt;(&amp;mut self, cmp: F)<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: FnMut(&amp;T, &amp;T) -&gt; Ordering,</span></h4></section></summary><div class="docblock"><p>Sort the set’s values in place using the comparison funtion <code>cmp</code>.</p>
<p>Computes in <strong>O(n log n)</strong> time. The sort is unstable.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.sorted_unstable_by" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#634-643">source</a><h4 class="code-header">pub fn <a href="#method.sorted_unstable_by" class="fnname">sorted_unstable_by</a>&lt;F&gt;(self, cmp: F) -&gt; <a class="struct" href="struct.IntoIter.html" title="struct indexmap::set::IntoIter">IntoIter</a>&lt;T&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.IntoIter.html" title="struct indexmap::set::IntoIter">IntoIter</a>&lt;T&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;T&gt; Iterator for <a class="struct" href="struct.IntoIter.html" title="struct indexmap::set::IntoIter">IntoIter</a>&lt;T&gt;</span><span class="where fmt-newline"> type <a class="associatedtype">Item</a> = T;</span></code></span></span></span></span><span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: FnMut(&amp;T, &amp;T) -&gt; Ordering,</span></h4></section></summary><div class="docblock"><p>Sort the values of the set and return a by-value iterator of
the values with the result.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.reverse" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#648-650">source</a><h4 class="code-header">pub fn <a href="#method.reverse" class="fnname">reverse</a>(&amp;mut self)</h4></section></summary><div class="docblock"><p>Reverses the order of the set’s values in place.</p>
<p>Computes in <strong>O(n)</strong> time and <strong>O(1)</strong> space.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-IndexSet%3CT%2C%20S%3E-2" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#653-722">source</a><a href="#impl-IndexSet%3CT%2C%20S%3E-2" class="anchor"></a><h3 class="code-header">impl&lt;T, S&gt; <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.get_index" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#659-661">source</a><h4 class="code-header">pub fn <a href="#method.get_index" class="fnname">get_index</a>(&amp;self, index: usize) -&gt; Option&lt;&amp;T&gt;</h4></section></summary><div class="docblock"><p>Get a value by index</p>
<p>Valid indices are <em>0 &lt;= index &lt; self.len()</em></p>
<p>Computes in <strong>O(1)</strong> time.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.first" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#666-668">source</a><h4 class="code-header">pub fn <a href="#method.first" class="fnname">first</a>(&amp;self) -&gt; Option&lt;&amp;T&gt;</h4></section></summary><div class="docblock"><p>Get the first value</p>
<p>Computes in <strong>O(1)</strong> time.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.last" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#673-675">source</a><h4 class="code-header">pub fn <a href="#method.last" class="fnname">last</a>(&amp;self) -&gt; Option&lt;&amp;T&gt;</h4></section></summary><div class="docblock"><p>Get the last value</p>
<p>Computes in <strong>O(1)</strong> time.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.swap_remove_index" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#686-688">source</a><h4 class="code-header">pub fn <a href="#method.swap_remove_index" class="fnname">swap_remove_index</a>(&amp;mut self, index: usize) -&gt; Option&lt;T&gt;</h4></section></summary><div class="docblock"><p>Remove the value by index</p>
<p>Valid indices are <em>0 &lt;= index &lt; self.len()</em></p>
<p>Like <code>Vec::swap_remove</code>, the value is removed by swapping it with the
last element of the set and popping it off. <strong>This perturbs
the position of what used to be the last element!</strong></p>
<p>Computes in <strong>O(1)</strong> time (average).</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.shift_remove_index" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#699-701">source</a><h4 class="code-header">pub fn <a href="#method.shift_remove_index" class="fnname">shift_remove_index</a>(&amp;mut self, index: usize) -&gt; Option&lt;T&gt;</h4></section></summary><div class="docblock"><p>Remove the value by index</p>
<p>Valid indices are <em>0 &lt;= index &lt; self.len()</em></p>
<p>Like <code>Vec::remove</code>, the value is removed by shifting all of the
elements that follow it, preserving their relative order.
<strong>This perturbs the index of all of those elements!</strong></p>
<p>Computes in <strong>O(n)</strong> time (average).</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.move_index" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#712-714">source</a><h4 class="code-header">pub fn <a href="#method.move_index" class="fnname">move_index</a>(&amp;mut self, from: usize, to: usize)</h4></section></summary><div class="docblock"><p>Moves the position of a value from one index to another
by shifting all other values in-between.</p>
<ul>
<li>If <code>from &lt; to</code>, the other values will shift down while the targeted value moves up.</li>
<li>If <code>from &gt; to</code>, the other values will shift up while the targeted value moves down.</li>
</ul>
<p><em><strong>Panics</strong></em> if <code>from</code> or <code>to</code> are out of bounds.</p>
<p>Computes in <strong>O(n)</strong> time (average).</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.swap_indices" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#719-721">source</a><h4 class="code-header">pub fn <a href="#method.swap_indices" class="fnname">swap_indices</a>(&amp;mut self, a: usize, b: usize)</h4></section></summary><div class="docblock"><p>Swaps the position of two values in the set.</p>
<p><em><strong>Panics</strong></em> if <code>a</code> or <code>b</code> are out of bounds.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-IndexSet%3CT%2C%20S%3E-3" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#983-1015">source</a><a href="#impl-IndexSet%3CT%2C%20S%3E-3" class="anchor"></a><h3 class="code-header">impl&lt;T, S&gt; <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Eq + Hash,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: BuildHasher,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_disjoint" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#989-998">source</a><h4 class="code-header">pub fn <a href="#method.is_disjoint" class="fnname">is_disjoint</a>&lt;S2&gt;(&amp;self, other: &amp;<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S2&gt;) -&gt; bool<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S2: BuildHasher,</span></h4></section></summary><div class="docblock"><p>Returns <code>true</code> if <code>self</code> has no elements in common with <code>other</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_subset" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#1001-1006">source</a><h4 class="code-header">pub fn <a href="#method.is_subset" class="fnname">is_subset</a>&lt;S2&gt;(&amp;self, other: &amp;<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S2&gt;) -&gt; bool<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S2: BuildHasher,</span></h4></section></summary><div class="docblock"><p>Returns <code>true</code> if all elements of <code>self</code> are contained in <code>other</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_superset" class="method has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#1009-1014">source</a><h4 class="code-header">pub fn <a href="#method.is_superset" class="fnname">is_superset</a>&lt;S2&gt;(&amp;self, other: &amp;<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S2&gt;) -&gt; bool<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S2: BuildHasher,</span></h4></section></summary><div class="docblock"><p>Returns <code>true</code> if all elements of <code>other</code> are contained in <code>self</code>.</p>
</div></details></div></details></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-BitAnd%3C%26IndexSet%3CT%2C%20S2%3E%3E-for-%26IndexSet%3CT%2C%20S1%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#1321-1335">source</a><a href="#impl-BitAnd%3C%26IndexSet%3CT%2C%20S2%3E%3E-for-%26IndexSet%3CT%2C%20S1%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, S1, S2&gt; BitAnd&lt;&amp;<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S2&gt;&gt; for &amp;<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S1&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Eq + Hash + Clone,<br>&nbsp;&nbsp;&nbsp;&nbsp;S1: BuildHasher + Default,<br>&nbsp;&nbsp;&nbsp;&nbsp;S2: BuildHasher,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.bitand" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#1332-1334">source</a><a href="#method.bitand" class="anchor"></a><h4 class="code-header">fn <a class="fnname">bitand</a>(self, other: &amp;<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S2&gt;) -&gt; Self::Output</h4></section></summary><div class="docblock"><p>Returns the set intersection, cloned into a new set.</p>
<p>Values are collected in the same order that they appear in <code>self</code>.</p>
</div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.Output-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Output-1" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Output</a> = <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S1&gt;</h4></section></summary><div class='docblock'>The resulting type after applying the <code>&amp;</code> operator.</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-BitOr%3C%26IndexSet%3CT%2C%20S2%3E%3E-for-%26IndexSet%3CT%2C%20S1%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#1337-1352">source</a><a href="#impl-BitOr%3C%26IndexSet%3CT%2C%20S2%3E%3E-for-%26IndexSet%3CT%2C%20S1%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, S1, S2&gt; BitOr&lt;&amp;<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S2&gt;&gt; for &amp;<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S1&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Eq + Hash + Clone,<br>&nbsp;&nbsp;&nbsp;&nbsp;S1: BuildHasher + Default,<br>&nbsp;&nbsp;&nbsp;&nbsp;S2: BuildHasher,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.bitor" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#1349-1351">source</a><a href="#method.bitor" class="anchor"></a><h4 class="code-header">fn <a class="fnname">bitor</a>(self, other: &amp;<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S2&gt;) -&gt; Self::Output</h4></section></summary><div class="docblock"><p>Returns the set union, cloned into a new set.</p>
<p>Values from <code>self</code> are collected in their original order, followed by
values that are unique to <code>other</code> in their original order.</p>
</div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.Output-2" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Output-2" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Output</a> = <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S1&gt;</h4></section></summary><div class='docblock'>The resulting type after applying the <code>|</code> operator.</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-BitXor%3C%26IndexSet%3CT%2C%20S2%3E%3E-for-%26IndexSet%3CT%2C%20S1%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#1354-1369">source</a><a href="#impl-BitXor%3C%26IndexSet%3CT%2C%20S2%3E%3E-for-%26IndexSet%3CT%2C%20S1%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, S1, S2&gt; BitXor&lt;&amp;<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S2&gt;&gt; for &amp;<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S1&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Eq + Hash + Clone,<br>&nbsp;&nbsp;&nbsp;&nbsp;S1: BuildHasher + Default,<br>&nbsp;&nbsp;&nbsp;&nbsp;S2: BuildHasher,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.bitxor" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#1366-1368">source</a><a href="#method.bitxor" class="anchor"></a><h4 class="code-header">fn <a class="fnname">bitxor</a>(self, other: &amp;<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S2&gt;) -&gt; Self::Output</h4></section></summary><div class="docblock"><p>Returns the set symmetric-difference, cloned into a new set.</p>
<p>Values from <code>self</code> are collected in their original order, followed by
values from <code>other</code> in their original order.</p>
</div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.Output-3" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Output-3" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Output</a> = <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S1&gt;</h4></section></summary><div class='docblock'>The resulting type after applying the <code>^</code> operator.</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Clone-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#71-85">source</a><a href="#impl-Clone-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, S&gt; Clone for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Clone,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Clone,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#76-80">source</a><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a class="fnname">clone</a>(&amp;self) -&gt; Self</h4></section></summary><div class='docblock'>Returns a copy of the value. <a>Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#82-84">source</a><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a class="fnname">clone_from</a>(&amp;mut self, other: &amp;Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Debug-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#113-125">source</a><a href="#impl-Debug-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, S&gt; Debug for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Debug,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#117-124">source</a><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a class="fnname">fmt</a>(&amp;self, f: &amp;mut Formatter&lt;'_&gt;) -&gt; Result</h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Default-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#953-963">source</a><a href="#impl-Default-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, S&gt; Default for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Default,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.default" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#958-962">source</a><a href="#method.default" class="anchor"></a><h4 class="code-header">fn <a class="fnname">default</a>() -&gt; Self</h4></section></summary><div class="docblock"><p>Return an empty <code>IndexSet</code></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Extend%3C%26%27a%20T%3E-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#942-951">source</a><a href="#impl-Extend%3C%26%27a%20T%3E-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;'a, T, S&gt; Extend&lt;&amp;'a T&gt; for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Hash + Eq + Copy + 'a,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: BuildHasher,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.extend-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#947-950">source</a><a href="#method.extend-1" class="anchor"></a><h4 class="code-header">fn <a class="fnname">extend</a>&lt;I:&nbsp;IntoIterator&lt;Item = &amp;'a T&gt;&gt;(&amp;mut self, iterable: I)</h4></section></summary><div class='docblock'>Extends a collection with the contents of an iterator. <a>Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.extend_one-1" class="method trait-impl has-srclink"><a href="#method.extend_one-1" class="anchor"></a><h4 class="code-header">fn <a class="fnname">extend_one</a>(&amp;mut self, item: A)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>extend_one</code>)</span></div></span><div class='docblock'>Extends a collection with exactly one element.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.extend_reserve-1" class="method trait-impl has-srclink"><a href="#method.extend_reserve-1" class="anchor"></a><h4 class="code-header">fn <a class="fnname">extend_reserve</a>(&amp;mut self, additional: usize)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>extend_one</code>)</span></div></span><div class='docblock'>Reserves capacity in a collection for the given number of additional elements. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Extend%3CT%3E-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#931-940">source</a><a href="#impl-Extend%3CT%3E-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, S&gt; Extend&lt;T&gt; for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Hash + Eq,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: BuildHasher,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.extend" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#936-939">source</a><a href="#method.extend" class="anchor"></a><h4 class="code-header">fn <a class="fnname">extend</a>&lt;I:&nbsp;IntoIterator&lt;Item = T&gt;&gt;(&amp;mut self, iterable: I)</h4></section></summary><div class='docblock'>Extends a collection with the contents of an iterator. <a>Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.extend_one" class="method trait-impl has-srclink"><a href="#method.extend_one" class="anchor"></a><h4 class="code-header">fn <a class="fnname">extend_one</a>(&amp;mut self, item: A)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>extend_one</code>)</span></div></span><div class='docblock'>Extends a collection with exactly one element.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.extend_reserve" class="method trait-impl has-srclink"><a href="#method.extend_reserve" class="anchor"></a><h4 class="code-header">fn <a class="fnname">extend_reserve</a>(&amp;mut self, additional: usize)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>extend_one</code>)</span></div></span><div class='docblock'>Reserves capacity in a collection for the given number of additional elements. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-From%3C%5BT%3B%20N%5D%3E-for-IndexSet%3CT%2C%20RandomState%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#913-929">source</a><a href="#impl-From%3C%5BT%3B%20N%5D%3E-for-IndexSet%3CT%2C%20RandomState%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, const N:&nbsp;usize&gt; From&lt;[T; N]&gt; for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, RandomState&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Eq + Hash,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#926-928">source</a><a href="#method.from" class="anchor"></a><h4 class="code-header">fn <a class="fnname">from</a>(arr: [T; N]) -&gt; Self</h4></section></summary><div class="docblock"><h5 id="examples-2"><a href="#examples-2">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>indexmap::IndexSet;
<span class="kw">let </span>set1 = IndexSet::from([<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>]);
<span class="kw">let </span>set2: IndexSet&lt;<span class="kw">_</span>&gt; = [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>].into();
<span class="macro">assert_eq!</span>(set1, set2);</code></pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-FromIterator%3CT%3E-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#899-910">source</a><a href="#impl-FromIterator%3CT%3E-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, S&gt; FromIterator&lt;T&gt; for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Hash + Eq,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: BuildHasher + Default,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_iter" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#904-909">source</a><a href="#method.from_iter" class="anchor"></a><h4 class="code-header">fn <a class="fnname">from_iter</a>&lt;I:&nbsp;IntoIterator&lt;Item = T&gt;&gt;(iterable: I) -&gt; Self</h4></section></summary><div class='docblock'>Creates a value from an iterator. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Index%3Cusize%3E-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#752-762">source</a><a href="#impl-Index%3Cusize%3E-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, S&gt; Index&lt;usize&gt; for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S&gt;</h3></section></summary><div class="docblock"><p>Access <code>IndexSet</code> values at indexed positions.</p>
<h4 id="examples-1"><a href="#examples-1">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>indexmap::IndexSet;
<span class="kw">let </span><span class="kw-2">mut </span>set = IndexSet::new();
<span class="kw">for </span>word <span class="kw">in </span><span class="string">&quot;Lorem ipsum dolor sit amet&quot;</span>.split_whitespace() {
set.insert(word.to_string());
}
<span class="macro">assert_eq!</span>(set[<span class="number">0</span>], <span class="string">&quot;Lorem&quot;</span>);
<span class="macro">assert_eq!</span>(set[<span class="number">1</span>], <span class="string">&quot;ipsum&quot;</span>);
set.reverse();
<span class="macro">assert_eq!</span>(set[<span class="number">0</span>], <span class="string">&quot;amet&quot;</span>);
<span class="macro">assert_eq!</span>(set[<span class="number">1</span>], <span class="string">&quot;sit&quot;</span>);
set.sort();
<span class="macro">assert_eq!</span>(set[<span class="number">0</span>], <span class="string">&quot;Lorem&quot;</span>);
<span class="macro">assert_eq!</span>(set[<span class="number">1</span>], <span class="string">&quot;amet&quot;</span>);</code></pre></div>
<div class="example-wrap should_panic"><div class='tooltip'></div><pre class="rust rust-example-rendered"><code><span class="kw">use </span>indexmap::IndexSet;
<span class="kw">let </span><span class="kw-2">mut </span>set = IndexSet::new();
set.insert(<span class="string">&quot;foo&quot;</span>);
<span class="macro">println!</span>(<span class="string">&quot;{:?}&quot;</span>, set[<span class="number">10</span>]); <span class="comment">// panics!</span></code></pre></div>
</div><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.index" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#758-761">source</a><a href="#method.index" class="anchor"></a><h4 class="code-header">fn <a class="fnname">index</a>(&amp;self, index: usize) -&gt; &amp;T</h4></section></summary><div class="docblock"><p>Returns a reference to the value at the supplied <code>index</code>.</p>
<p><em><strong>Panics</strong></em> if <code>index</code> is out of bounds.</p>
</div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.Output" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Output" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Output</a> = T</h4></section></summary><div class='docblock'>The returned type after indexing.</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-IntoIterator-for-%26%27a%20IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#879-886">source</a><a href="#impl-IntoIterator-for-%26%27a%20IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;'a, T, S&gt; IntoIterator for &amp;'a <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Item" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Item" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Item</a> = &amp;'a T</h4></section></summary><div class='docblock'>The type of the elements being iterated over.</div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.IntoIter" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.IntoIter" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">IntoIter</a> = <a class="struct" href="struct.Iter.html" title="struct indexmap::set::Iter">Iter</a>&lt;'a, T&gt;</h4></section></summary><div class='docblock'>Which kind of iterator are we turning this into?</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into_iter" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#883-885">source</a><a href="#method.into_iter" class="anchor"></a><h4 class="code-header">fn <a class="fnname">into_iter</a>(self) -&gt; Self::IntoIter</h4></section></summary><div class='docblock'>Creates an iterator from a value. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-IntoIterator-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#888-897">source</a><a href="#impl-IntoIterator-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, S&gt; IntoIterator for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Item-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Item-1" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Item</a> = T</h4></section></summary><div class='docblock'>The type of the elements being iterated over.</div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.IntoIter-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.IntoIter-1" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">IntoIter</a> = <a class="struct" href="struct.IntoIter.html" title="struct indexmap::set::IntoIter">IntoIter</a>&lt;T&gt;</h4></section></summary><div class='docblock'>Which kind of iterator are we turning this into?</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into_iter-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#892-896">source</a><a href="#method.into_iter-1" class="anchor"></a><h4 class="code-header">fn <a class="fnname">into_iter</a>(self) -&gt; Self::IntoIter</h4></section></summary><div class='docblock'>Creates an iterator from a value. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CIndexSet%3CT%2C%20S2%3E%3E-for-IndexSet%3CT%2C%20S1%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#965-974">source</a><a href="#impl-PartialEq%3CIndexSet%3CT%2C%20S2%3E%3E-for-IndexSet%3CT%2C%20S1%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, S1, S2&gt; PartialEq&lt;<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S2&gt;&gt; for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S1&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Hash + Eq,<br>&nbsp;&nbsp;&nbsp;&nbsp;S1: BuildHasher,<br>&nbsp;&nbsp;&nbsp;&nbsp;S2: BuildHasher,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#971-973">source</a><a href="#method.eq" class="anchor"></a><h4 class="code-header">fn <a class="fnname">eq</a>(&amp;self, other: &amp;<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S2&gt;) -&gt; bool</h4></section></summary><div class='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>. <a>Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.ne" class="method trait-impl has-srclink"><span class="since rightside" title="Stable since Rust version 1.0.0">1.0.0</span><a href="#method.ne" class="anchor"></a><h4 class="code-header">const fn <a class="fnname">ne</a>(&amp;self, other: &amp;Rhs) -&gt; bool</h4></section></summary><div class='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Sub%3C%26IndexSet%3CT%2C%20S2%3E%3E-for-%26IndexSet%3CT%2C%20S1%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#1371-1385">source</a><a href="#impl-Sub%3C%26IndexSet%3CT%2C%20S2%3E%3E-for-%26IndexSet%3CT%2C%20S1%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, S1, S2&gt; Sub&lt;&amp;<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S2&gt;&gt; for &amp;<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S1&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Eq + Hash + Clone,<br>&nbsp;&nbsp;&nbsp;&nbsp;S1: BuildHasher + Default,<br>&nbsp;&nbsp;&nbsp;&nbsp;S2: BuildHasher,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.sub" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#1382-1384">source</a><a href="#method.sub" class="anchor"></a><h4 class="code-header">fn <a class="fnname">sub</a>(self, other: &amp;<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S2&gt;) -&gt; Self::Output</h4></section></summary><div class="docblock"><p>Returns the set difference, cloned into a new set.</p>
<p>Values are collected in the same order that they appear in <code>self</code>.</p>
</div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.Output-4" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Output-4" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Output</a> = <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S1&gt;</h4></section></summary><div class='docblock'>The resulting type after applying the <code>-</code> operator.</div></details></div></details><section id="impl-Eq-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/indexmap/set.rs.html#976-981">source</a><a href="#impl-Eq-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, S&gt; Eq for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Eq + Hash,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: BuildHasher,</span></h3></section></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><section id="impl-RefUnwindSafe-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a href="#impl-RefUnwindSafe-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, S&gt; RefUnwindSafe for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: RefUnwindSafe,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: RefUnwindSafe,</span></h3></section><section id="impl-Send-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a href="#impl-Send-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, S&gt; Send for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Send,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Send,</span></h3></section><section id="impl-Sync-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a href="#impl-Sync-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, S&gt; Sync for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Sync,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Sync,</span></h3></section><section id="impl-Unpin-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a href="#impl-Unpin-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, S&gt; Unpin for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Unpin,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Unpin,</span></h3></section><section id="impl-UnwindSafe-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a href="#impl-UnwindSafe-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, S&gt; UnwindSafe for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a>&lt;T, S&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: UnwindSafe,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: UnwindSafe,</span></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a href="#impl-Any-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; Any for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><a href="#method.type_id" class="anchor"></a><h4 class="code-header">fn <a class="fnname">type_id</a>(&amp;self) -&gt; TypeId</h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a href="#impl-Borrow%3CT%3E-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; Borrow&lt;T&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span><a href="#method.borrow" class="anchor"></a><h4 class="code-header">fn <a class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a href="#impl-BorrowMut%3CT%3E-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; BorrowMut&lt;T&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">fn <a class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a href="#impl-From%3CT%3E-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; From&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from-1" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.from-1" class="anchor"></a><h4 class="code-header">fn <a class="fnname">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a href="#impl-Into%3CU%3E-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; Into&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: From&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.into" class="anchor"></a><h4 class="code-header">fn <a class="fnname">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code>[From]&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-ToOwned-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a href="#impl-ToOwned-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; ToOwned for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Clone,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Owned" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl has-srclink"><a href="#method.to_owned" class="anchor"></a><h4 class="code-header">fn <a class="fnname">to_owned</a>(&amp;self) -&gt; T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a>Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl has-srclink"><a href="#method.clone_into" class="anchor"></a><h4 class="code-header">fn <a class="fnname">clone_into</a>(&amp;self, target: &amp;mut T)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a href="#impl-TryFrom%3CU%3E-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; TryFrom&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: Into&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Error</a> = Infallible</h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.try_from" class="anchor"></a><h4 class="code-header">fn <a class="fnname">try_from</a>(value: U) -&gt; Result&lt;T, &lt;T as TryFrom&lt;U&gt;&gt;::Error&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-IndexSet%3CT%2C%20S%3E" class="impl has-srclink"><a href="#impl-TryInto%3CU%3E-for-IndexSet%3CT%2C%20S%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; TryInto&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: TryFrom&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Error</a> = &lt;U as TryFrom&lt;T&gt;&gt;::Error</h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.try_into" class="anchor"></a><h4 class="code-header">fn <a class="fnname">try_into</a>(self) -&gt; Result&lt;U, &lt;U as TryFrom&lt;T&gt;&gt;::Error&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="indexmap" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>