| <!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">☰</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<&IndexSet<T, S2>></a></li><li><a href="#impl-BitOr%3C%26IndexSet%3CT%2C%20S2%3E%3E-for-%26IndexSet%3CT%2C%20S1%3E">BitOr<&IndexSet<T, S2>></a></li><li><a href="#impl-BitXor%3C%26IndexSet%3CT%2C%20S2%3E%3E-for-%26IndexSet%3CT%2C%20S1%3E">BitXor<&IndexSet<T, S2>></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<&'a T></a></li><li><a href="#impl-Extend%3CT%3E-for-IndexSet%3CT%2C%20S%3E">Extend<T></a></li><li><a href="#impl-From%3C%5BT%3B%20N%5D%3E-for-IndexSet%3CT%2C%20RandomState%3E">From<[T; N]></a></li><li><a href="#impl-FromIterator%3CT%3E-for-IndexSet%3CT%2C%20S%3E">FromIterator<T></a></li><li><a href="#impl-Index%3Cusize%3E-for-IndexSet%3CT%2C%20S%3E">Index<usize></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<IndexSet<T, S2>></a></li><li><a href="#impl-Sub%3C%26IndexSet%3CT%2C%20S2%3E%3E-for-%26IndexSet%3CT%2C%20S1%3E">Sub<&IndexSet<T, S2>></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<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-IndexSet%3CT%2C%20S%3E">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E-for-IndexSet%3CT%2C%20S%3E">From<T></a></li><li><a href="#impl-Into%3CU%3E-for-IndexSet%3CT%2C%20S%3E">Into<U></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<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-IndexSet%3CT%2C%20S%3E">TryInto<U></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">−</span>]</a></span></div><div class="item-decl"><pre class="rust struct"><code>pub struct IndexSet<T, S = RandomState> { /* 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<<span class="kw">_</span>> = <span class="string">"a short treatise on fungi"</span>.chars().collect(); |
| |
| <span class="macro">assert!</span>(letters.contains(<span class="kw-2">&</span><span class="string">'s'</span>)); |
| <span class="macro">assert!</span>(letters.contains(<span class="kw-2">&</span><span class="string">'t'</span>)); |
| <span class="macro">assert!</span>(letters.contains(<span class="kw-2">&</span><span class="string">'u'</span>)); |
| <span class="macro">assert!</span>(!letters.contains(<span class="kw-2">&</span><span class="string">'y'</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<T> <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T></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>() -> 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) -> 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<T, S> <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S></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) -> 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) -> 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>(&self) -> 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>(&self) -> &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>(&self) -> 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>(&self) -> 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>(&self) -> <a class="struct" href="struct.Iter.html" title="struct indexmap::set::Iter">Iter</a><'_, T><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><'a, T></span><code class="content"><span class="where fmt-newline">impl<'a, T> Iterator for <a class="struct" href="struct.Iter.html" title="struct indexmap::set::Iter">Iter</a><'a, T></span><span class="where fmt-newline"> type <a class="associatedtype">Item</a> = &'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>(&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>(&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><R>(&mut self, range: R) -> <a class="struct" href="struct.Drain.html" title="struct indexmap::set::Drain">Drain</a><'_, T><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><'_, T></span><code class="content"><span class="where fmt-newline">impl<T> Iterator for <a class="struct" href="struct.Drain.html" title="struct indexmap::set::Drain">Drain</a><'_, T></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> R: RangeBounds<usize>,</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<usize></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>(&mut self, at: usize) -> Self<span class="where fmt-newline">where<br> 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 > 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<T, S> <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><span class="where fmt-newline">where<br> T: Hash + Eq,<br> 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>(&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>(&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>(&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>(&mut self, value: T) -> 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>(&mut self, value: T) -> (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><'a, S2>(<br> &'a self,<br> other: &'a <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2><br>) -> <a class="struct" href="struct.Difference.html" title="struct indexmap::set::Difference">Difference</a><'a, T, S2><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><'a, T, S></span><code class="content"><span class="where fmt-newline">impl<'a, T, S> Iterator for <a class="struct" href="struct.Difference.html" title="struct indexmap::set::Difference">Difference</a><'a, T, S><span class="where fmt-newline">where<br> T: Eq + Hash,<br> S: BuildHasher,</span></span><span class="where fmt-newline"> type <a class="associatedtype">Item</a> = &'a T;</span></code></span></span></span></span><span class="where fmt-newline">where<br> 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><'a, S2>(<br> &'a self,<br> other: &'a <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2><br>) -> <a class="struct" href="struct.SymmetricDifference.html" title="struct indexmap::set::SymmetricDifference">SymmetricDifference</a><'a, T, S, S2><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><'a, T, S1, S2></span><code class="content"><span class="where fmt-newline">impl<'a, T, S1, S2> Iterator for <a class="struct" href="struct.SymmetricDifference.html" title="struct indexmap::set::SymmetricDifference">SymmetricDifference</a><'a, T, S1, S2><span class="where fmt-newline">where<br> T: Eq + Hash,<br> S1: BuildHasher,<br> S2: BuildHasher,</span></span><span class="where fmt-newline"> type <a class="associatedtype">Item</a> = &'a T;</span></code></span></span></span></span><span class="where fmt-newline">where<br> 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><'a, S2>(<br> &'a self,<br> other: &'a <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2><br>) -> <a class="struct" href="struct.Intersection.html" title="struct indexmap::set::Intersection">Intersection</a><'a, T, S2><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><'a, T, S></span><code class="content"><span class="where fmt-newline">impl<'a, T, S> Iterator for <a class="struct" href="struct.Intersection.html" title="struct indexmap::set::Intersection">Intersection</a><'a, T, S><span class="where fmt-newline">where<br> T: Eq + Hash,<br> S: BuildHasher,</span></span><span class="where fmt-newline"> type <a class="associatedtype">Item</a> = &'a T;</span></code></span></span></span></span><span class="where fmt-newline">where<br> 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><'a, S2>(&'a self, other: &'a <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>) -> <a class="struct" href="struct.Union.html" title="struct indexmap::set::Union">Union</a><'a, T, S><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><'a, T, S></span><code class="content"><span class="where fmt-newline">impl<'a, T, S> Iterator for <a class="struct" href="struct.Union.html" title="struct indexmap::set::Union">Union</a><'a, T, S><span class="where fmt-newline">where<br> T: Eq + Hash,<br> S: BuildHasher,</span></span><span class="where fmt-newline"> type <a class="associatedtype">Item</a> = &'a T;</span></code></span></span></span></span><span class="where fmt-newline">where<br> 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><Q: ?Sized>(&self, value: &Q) -> bool<span class="where fmt-newline">where<br> Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T>,</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><Q: ?Sized>(&self, value: &Q) -> Option<&T><span class="where fmt-newline">where<br> Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T>,</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><Q: ?Sized>(&self, value: &Q) -> Option<(usize, &T)><span class="where fmt-newline">where<br> Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T>,</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><Q: ?Sized>(&self, value: &Q) -> Option<usize><span class="where fmt-newline">where<br> Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T>,</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>(&mut self, value: T) -> Option<T></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>(&mut self, value: T) -> (usize, Option<T>)</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><Q: ?Sized>(&mut self, value: &Q) -> bool<span class="where fmt-newline">where<br> Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T>,</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><Q: ?Sized>(&mut self, value: &Q) -> bool<span class="where fmt-newline">where<br> Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T>,</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><Q: ?Sized>(&mut self, value: &Q) -> bool<span class="where fmt-newline">where<br> Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T>,</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><Q: ?Sized>(&mut self, value: &Q) -> Option<T><span class="where fmt-newline">where<br> Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T>,</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><Q: ?Sized>(&mut self, value: &Q) -> Option<T><span class="where fmt-newline">where<br> Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T>,</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><Q: ?Sized>(&mut self, value: &Q) -> Option<T><span class="where fmt-newline">where<br> Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T>,</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><Q: ?Sized>(&mut self, value: &Q) -> Option<(usize, T)><span class="where fmt-newline">where<br> Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T>,</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><Q: ?Sized>(&mut self, value: &Q) -> Option<(usize, T)><span class="where fmt-newline">where<br> Q: Hash + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T>,</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>(&mut self) -> Option<T></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><F>(&mut self, keep: F)<span class="where fmt-newline">where<br> F: FnMut(&T) -> 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>(&mut self)<span class="where fmt-newline">where<br> 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><F>(&mut self, cmp: F)<span class="where fmt-newline">where<br> F: FnMut(&T, &T) -> 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><F>(self, cmp: F) -> <a class="struct" href="struct.IntoIter.html" title="struct indexmap::set::IntoIter">IntoIter</a><T><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><T></span><code class="content"><span class="where fmt-newline">impl<T> Iterator for <a class="struct" href="struct.IntoIter.html" title="struct indexmap::set::IntoIter">IntoIter</a><T></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> F: FnMut(&T, &T) -> 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>(&mut self)<span class="where fmt-newline">where<br> 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><F>(&mut self, cmp: F)<span class="where fmt-newline">where<br> F: FnMut(&T, &T) -> 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><F>(self, cmp: F) -> <a class="struct" href="struct.IntoIter.html" title="struct indexmap::set::IntoIter">IntoIter</a><T><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><T></span><code class="content"><span class="where fmt-newline">impl<T> Iterator for <a class="struct" href="struct.IntoIter.html" title="struct indexmap::set::IntoIter">IntoIter</a><T></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> F: FnMut(&T, &T) -> 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>(&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<T, S> <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S></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>(&self, index: usize) -> Option<&T></h4></section></summary><div class="docblock"><p>Get a value by index</p> |
| <p>Valid indices are <em>0 <= index < 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>(&self) -> Option<&T></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>(&self) -> Option<&T></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>(&mut self, index: usize) -> Option<T></h4></section></summary><div class="docblock"><p>Remove the value by index</p> |
| <p>Valid indices are <em>0 <= index < 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>(&mut self, index: usize) -> Option<T></h4></section></summary><div class="docblock"><p>Remove the value by index</p> |
| <p>Valid indices are <em>0 <= index < 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>(&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 < to</code>, the other values will shift down while the targeted value moves up.</li> |
| <li>If <code>from > 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>(&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<T, S> <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><span class="where fmt-newline">where<br> T: Eq + Hash,<br> 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><S2>(&self, other: &<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>) -> bool<span class="where fmt-newline">where<br> 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><S2>(&self, other: &<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>) -> bool<span class="where fmt-newline">where<br> 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><S2>(&self, other: &<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>) -> bool<span class="where fmt-newline">where<br> 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<T, S1, S2> BitAnd<&<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>> for &<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S1><span class="where fmt-newline">where<br> T: Eq + Hash + Clone,<br> S1: BuildHasher + Default,<br> 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: &<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>) -> 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><T, S1></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-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<T, S1, S2> BitOr<&<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>> for &<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S1><span class="where fmt-newline">where<br> T: Eq + Hash + Clone,<br> S1: BuildHasher + Default,<br> 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: &<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>) -> 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><T, S1></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<T, S1, S2> BitXor<&<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>> for &<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S1><span class="where fmt-newline">where<br> T: Eq + Hash + Clone,<br> S1: BuildHasher + Default,<br> 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: &<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>) -> 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><T, S1></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<T, S> Clone for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><span class="where fmt-newline">where<br> T: Clone,<br> 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>(&self) -> 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>(&mut self, other: &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<T, S> Debug for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><span class="where fmt-newline">where<br> 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>(&self, f: &mut Formatter<'_>) -> 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<T, S> Default for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><span class="where fmt-newline">where<br> 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>() -> 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<'a, T, S> Extend<&'a T> for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><span class="where fmt-newline">where<br> T: Hash + Eq + Copy + 'a,<br> 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><I: IntoIterator<Item = &'a T>>(&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>(&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>(&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<T, S> Extend<T> for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><span class="where fmt-newline">where<br> T: Hash + Eq,<br> 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><I: IntoIterator<Item = T>>(&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>(&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>(&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<T, const N: usize> From<[T; N]> for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, RandomState><span class="where fmt-newline">where<br> 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]) -> 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<<span class="kw">_</span>> = [<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<T, S> FromIterator<T> for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><span class="where fmt-newline">where<br> T: Hash + Eq,<br> 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><I: IntoIterator<Item = T>>(iterable: I) -> 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<T, S> Index<usize> for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S></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">"Lorem ipsum dolor sit amet"</span>.split_whitespace() { |
| set.insert(word.to_string()); |
| } |
| <span class="macro">assert_eq!</span>(set[<span class="number">0</span>], <span class="string">"Lorem"</span>); |
| <span class="macro">assert_eq!</span>(set[<span class="number">1</span>], <span class="string">"ipsum"</span>); |
| set.reverse(); |
| <span class="macro">assert_eq!</span>(set[<span class="number">0</span>], <span class="string">"amet"</span>); |
| <span class="macro">assert_eq!</span>(set[<span class="number">1</span>], <span class="string">"sit"</span>); |
| set.sort(); |
| <span class="macro">assert_eq!</span>(set[<span class="number">0</span>], <span class="string">"Lorem"</span>); |
| <span class="macro">assert_eq!</span>(set[<span class="number">1</span>], <span class="string">"amet"</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">"foo"</span>); |
| <span class="macro">println!</span>(<span class="string">"{:?}"</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>(&self, index: usize) -> &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<'a, T, S> IntoIterator for &'a <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S></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> = &'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><'a, T></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) -> 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<T, S> IntoIterator for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S></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><T></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) -> 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<T, S1, S2> PartialEq<<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>> for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S1><span class="where fmt-newline">where<br> T: Hash + Eq,<br> S1: BuildHasher,<br> 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>(&self, other: &<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>) -> 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>(&self, other: &Rhs) -> 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<T, S1, S2> Sub<&<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>> for &<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S1><span class="where fmt-newline">where<br> T: Eq + Hash + Clone,<br> S1: BuildHasher + Default,<br> 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: &<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>) -> 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><T, S1></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<T, S> Eq for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><span class="where fmt-newline">where<br> T: Eq + Hash,<br> 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<T, S> RefUnwindSafe for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><span class="where fmt-newline">where<br> S: RefUnwindSafe,<br> 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<T, S> Send for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><span class="where fmt-newline">where<br> S: Send,<br> 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<T, S> Sync for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><span class="where fmt-newline">where<br> S: Sync,<br> 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<T, S> Unpin for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><span class="where fmt-newline">where<br> S: Unpin,<br> 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<T, S> UnwindSafe for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><span class="where fmt-newline">where<br> S: UnwindSafe,<br> 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<T> Any for T<span class="where fmt-newline">where<br> 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>(&self) -> 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<T> Borrow<T> for T<span class="where fmt-newline">where<br> 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>(&self) -> &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<T> BorrowMut<T> for T<span class="where fmt-newline">where<br> 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>(&mut self) -> &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<T> From<T> 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) -> 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<T, U> Into<U> for T<span class="where fmt-newline">where<br> U: From<T>,</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) -> 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]<T> 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<T> ToOwned for T<span class="where fmt-newline">where<br> 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>(&self) -> 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>(&self, target: &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<T, U> TryFrom<U> for T<span class="where fmt-newline">where<br> U: Into<T>,</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) -> Result<T, <T as TryFrom<U>>::Error></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<T, U> TryInto<U> for T<span class="where fmt-newline">where<br> U: TryFrom<T>,</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> = <U as TryFrom<T>>::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) -> Result<U, <U as TryFrom<T>>::Error></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> |