mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-12-26 20:09:33 +01:00
349 lines
138 KiB
HTML
349 lines
138 KiB
HTML
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A hash set where the iteration order of the values is independent of their hash values."><title>IndexSet in indexmap::set - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-b0742ba02757f159.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="indexmap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.83.0 (90b35a623 2024-11-26)" data-channel="1.83.0" data-search-js="search-f0d225181b97f9a4.js" data-settings-js="settings-805db61a62df4bd2.js" ><script src="../../static.files/storage-1d39b6787ed640ff.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-f070b9041d14864c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-0111fcff984fae8f.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.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" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../indexmap/index.html">indexmap</a><span class="version">1.9.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Index<wbr>Set</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#order" title="Order">Order</a></li><li><a href="#indices" title="Indices">Indices</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.capacity" title="capacity">capacity</a></li><li><a href="#method.clear" title="clear">clear</a></li><li><a href="#method.contains" title="contains">contains</a></li><li><a href="#method.difference" title="difference">difference</a></li><li><a href="#method.drain" title="drain">drain</a></li><li><a href="#method.first" title="first">first</a></li><li><a href="#method.get" title="get">get</a></li><li><a href="#method.get_full" title="get_full">get_full</a></li><li><a href="#method.get_index" title="get_index">get_index</a></li><li><a href="#method.get_index_of" title="get_index_of">get_index_of</a></li><li><a href="#method.hasher" title="hasher">hasher</a></li><li><a href="#method.insert" title="insert">insert</a></li><li><a href="#method.insert_full" title="insert_full">insert_full</a></li><li><a href="#method.intersection" title="intersection">intersection</a></li><li><a href="#method.is_disjoint" title="is_disjoint">is_disjoint</a></li><li><a href="#method.is_empty" title="is_empty">is_empty</a></li><li><a href="#method.is_subset" title="is_subset">is_subset</a></li><li><a href="#method.is_superset" title="is_superset">is_superset</a></li><li><a href="#method.iter" title="iter">iter</a></li><li><a href="#method.last" title="last">last</a></li><li><a href="#method.len" title="len">len</a></li><li><a href="#method.move_index" title="move_index">move_index</a></li><li><a href="#method.new" title="new">new</a></li><li><a href="#method.pop" title="pop">pop</a></li><li><
|
|||
|
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 class="doc-anchor" href="#order">§</a>Order</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 class="doc-anchor" href="#indices">§</a>Indices</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 class="doc-anchor" href="#examples">§</a>Examples</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="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-IndexSet%3CT%3E" class="impl"><a class="src 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="toggle method-toggle" open><summary><section id="method.new" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#130-134">source</a><h4 class="code-header">pub fn <a href="#method.new" class="fn">new</a>() -> Self</h4></section></summary><div class="docblock"><p>Create a new set. (Does not allocate.)</p>
|
|||
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.with_capacity" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#140-144">source</a><h4 class="code-header">pub fn <a href="#method.with_capacity" class="fn">with_capacity</a>(n: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>) -> 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="toggle implementors-toggle" open><summary><section id="impl-IndexSet%3CT,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#147-250">source</a><a href="#impl-IndexSet%3CT,+S%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="toggle method-toggle" open><summary><section id="method.with_capacity_and_hasher" class="method"><a class="src 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="fn">with_capacity_and_hasher</a>(n: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>, 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="toggle method-toggle" open><summary><section id="method.with_hasher" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#162-166">source</a><h4 class="code-header">pub const fn <a href="#method.with_hasher" class="fn">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="toggle method-toggle" open><summary><section id="method.capacity" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#169-171">source</a><h4 class="code-header">pub fn <a href="#method.capacity" class="fn">capacity</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Computes in <strong>O(1)</strong> time.</p>
|
|||
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.hasher" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#174-176">source</a><h4 class="code-header">pub fn <a href="#method.hasher" class="fn">hasher</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&S</a></h4></section></summary><div class="docblock"><p>Return a reference to the set’s <code>BuildHasher</code>.</p>
|
|||
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.len" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#181-183">source</a><h4 class="code-header">pub fn <a href="#method.len" class="fn">len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a></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="toggle method-toggle" open><summary><section id="method.is_empty" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#188-190">source</a><h4 class="code-header">pub fn <a href="#method.is_empty" class="fn">is_empty</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a></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="toggle method-toggle" open><summary><section id="method.iter" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#193-197">source</a><h4 class="code-header">pub fn <a href="#method.iter" class="fn">iter</a>(&self) -> <a class="struct" href="struct.Iter.html" title="struct indexmap::set::Iter">Iter</a><'_, T> <a href="#" class="tooltip" data-notable-ty="Iter<'_, T>">ⓘ</a></h4></section></summary><div class="docblock"><p>Return an iterator over the values of the set, in their order</p>
|
|||
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.clear" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#202-204">source</a><h4 class="code-header">pub fn <a href="#method.clear" class="fn">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="toggle method-toggle" open><summary><section id="method.truncate" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#209-211">source</a><h4 class="code-header">pub fn <a href="#method.truncate" class="fn">truncate</a>(&mut self, len: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>)</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="toggle method-toggle" open><summary><section id="method.drain" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#226-233">source</a><h4 class="code-header">pub fn <a href="#method.drain" class="fn">drain</a><R>(&mut self, range: R) -> <a class="struct" href="struct.Drain.html" title="struct indexmap::set::Drain">Drain</a><'_, T> <a href="#" class="tooltip" data-notable-ty="Drain<'_, T>">ⓘ</a><div class="where">where
|
|||
|
R: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a><<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>>,</div></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="toggle method-toggle" open><summary><section id="method.split_off" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#242-249">source</a><h4 class="code-header">pub fn <a href="#method.split_off" class="fn">split_off</a>(&mut self, at: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>) -> Self<div class="where">where
|
|||
|
S: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></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="toggle implementors-toggle" open><summary><section id="impl-IndexSet%3CT,+S%3E-1" class="impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#252-651">source</a><a href="#impl-IndexSet%3CT,+S%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><div class="where">where
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>,
|
|||
|
S: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.reserve" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#260-262">source</a><h4 class="code-header">pub fn <a href="#method.reserve" class="fn">reserve</a>(&mut self, additional: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>)</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="toggle method-toggle" open><summary><section id="method.shrink_to_fit" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#267-269">source</a><h4 class="code-header">pub fn <a href="#method.shrink_to_fit" class="fn">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="toggle method-toggle" open><summary><section id="method.shrink_to" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#274-276">source</a><h4 class="code-header">pub fn <a href="#method.shrink_to" class="fn">shrink_to</a>(&mut self, min_capacity: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>)</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="toggle method-toggle" open><summary><section id="method.insert" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#286-288">source</a><h4 class="code-header">pub fn <a href="#method.insert" class="fn">insert</a>(&mut self, value: T) -> <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a></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="toggle method-toggle" open><summary><section id="method.insert_full" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#299-310">source</a><h4 class="code-header">pub fn <a href="#method.insert_full" class="fn">insert_full</a>(&mut self, value: T) -> (<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a>)</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="toggle method-toggle" open><summary><section id="method.difference" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#315-323">source</a><h4 class="code-header">pub fn <a href="#method.difference" class="fn">difference</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.Difference.html" title="struct indexmap::set::Difference">Difference</a><'a, T, S2> <a href="#" class="tooltip" data-notable-ty="Difference<'a, T, S2>">ⓘ</a><div class="where">where
|
|||
|
S2: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,</div></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="toggle method-toggle" open><summary><section id="method.symmetric_difference" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#330-340">source</a><h4 class="code-header">pub fn <a href="#method.symmetric_difference" class="fn">symmetric_difference</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.SymmetricDifference.html" title="struct indexmap::set::SymmetricDifference">SymmetricDifference</a><'a, T, S, S2> <a href="#" class="tooltip" data-notable-ty="SymmetricDifference<'a, T, S, S2>">ⓘ</a><div class="where">where
|
|||
|
S2: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,</div></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="toggle method-toggle" open><summary><section id="method.intersection" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#345-353">source</a><h4 class="code-header">pub fn <a href="#method.intersection" class="fn">intersection</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.Intersection.html" title="struct indexmap::set::Intersection">Intersection</a><'a, T, S2> <a href="#" class="tooltip" data-notable-ty="Intersection<'a, T, S2>">ⓘ</a><div class="where">where
|
|||
|
S2: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,</div></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="toggle method-toggle" open><summary><section id="method.union" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#359-366">source</a><h4 class="code-header">pub fn <a href="#method.union" class="fn">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> <a href="#" class="tooltip" data-notable-ty="Union<'a, T, S>">ⓘ</a><div class="where">where
|
|||
|
S2: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,</div></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="toggle method-toggle" open><summary><section id="method.contains" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#371-376">source</a><h4 class="code-header">pub fn <a href="#method.contains" class="fn">contains</a><Q>(&self, value: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&Q</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a><div class="where">where
|
|||
|
Q: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T> + ?<a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></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="toggle method-toggle" open><summary><section id="method.get" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#382-387">source</a><h4 class="code-header">pub fn <a href="#method.get" class="fn">get</a><Q>(&self, value: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&Q</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&T</a>><div class="where">where
|
|||
|
Q: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T> + ?<a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></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="toggle method-toggle" open><summary><section id="method.get_full" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#390-395">source</a><h4 class="code-header">pub fn <a href="#method.get_full" class="fn">get_full</a><Q>(&self, value: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&Q</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&T</a>)><div class="where">where
|
|||
|
Q: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T> + ?<a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Return item index and value</p>
|
|||
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_index_of" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#398-403">source</a><h4 class="code-header">pub fn <a href="#method.get_index_of" class="fn">get_index_of</a><Q>(&self, value: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&Q</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>><div class="where">where
|
|||
|
Q: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T> + ?<a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Return item index, if it exists in the set</p>
|
|||
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.replace" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#410-412">source</a><h4 class="code-header">pub fn <a href="#method.replace" class="fn">replace</a>(&mut self, value: T) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><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="toggle method-toggle" open><summary><section id="method.replace_full" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#419-430">source</a><h4 class="code-header">pub fn <a href="#method.replace_full" class="fn">replace_full</a>(&mut self, value: T) -> (<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>, <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><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="toggle method-toggle" open><summary><section id="method.remove" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#438-443">source</a><h4 class="code-header">pub fn <a href="#method.remove" class="fn">remove</a><Q>(&mut self, value: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&Q</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a><div class="where">where
|
|||
|
Q: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T> + ?<a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></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="toggle method-toggle" open><summary><section id="method.swap_remove" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#454-459">source</a><h4 class="code-header">pub fn <a href="#method.swap_remove" class="fn">swap_remove</a><Q>(&mut self, value: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&Q</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a><div class="where">where
|
|||
|
Q: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T> + ?<a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></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="toggle method-toggle" open><summary><section id="method.shift_remove" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#470-475">source</a><h4 class="code-header">pub fn <a href="#method.shift_remove" class="fn">shift_remove</a><Q>(&mut self, value: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&Q</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a><div class="where">where
|
|||
|
Q: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T> + ?<a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></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="toggle method-toggle" open><summary><section id="method.take" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#485-490">source</a><h4 class="code-header">pub fn <a href="#method.take" class="fn">take</a><Q>(&mut self, value: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&Q</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><T><div class="where">where
|
|||
|
Q: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T> + ?<a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></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="toggle method-toggle" open><summary><section id="method.swap_take" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#502-507">source</a><h4 class="code-header">pub fn <a href="#method.swap_take" class="fn">swap_take</a><Q>(&mut self, value: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&Q</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><T><div class="where">where
|
|||
|
Q: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T> + ?<a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></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="toggle method-toggle" open><summary><section id="method.shift_take" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#519-524">source</a><h4 class="code-header">pub fn <a href="#method.shift_take" class="fn">shift_take</a><Q>(&mut self, value: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&Q</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><T><div class="where">where
|
|||
|
Q: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T> + ?<a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></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="toggle method-toggle" open><summary><section id="method.swap_remove_full" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#533-538">source</a><h4 class="code-header">pub fn <a href="#method.swap_remove_full" class="fn">swap_remove_full</a><Q>(&mut self, value: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&Q</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>, T)><div class="where">where
|
|||
|
Q: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T> + ?<a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></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="toggle method-toggle" open><summary><section id="method.shift_remove_full" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#547-552">source</a><h4 class="code-header">pub fn <a href="#method.shift_remove_full" class="fn">shift_remove_full</a><Q>(&mut self, value: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&Q</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>, T)><div class="where">where
|
|||
|
Q: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><T> + ?<a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></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="toggle method-toggle" open><summary><section id="method.pop" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#559-561">source</a><h4 class="code-header">pub fn <a href="#method.pop" class="fn">pop</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><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="toggle method-toggle" open><summary><section id="method.retain" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#570-575">source</a><h4 class="code-header">pub fn <a href="#method.retain" class="fn">retain</a><F>(&mut self, keep: F)<div class="where">where
|
|||
|
F: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&T</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a>,</div></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="toggle method-toggle" open><summary><section id="method.sort" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#580-585">source</a><h4 class="code-header">pub fn <a href="#method.sort" class="fn">sort</a>(&mut self)<div class="where">where
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,</div></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" title="method indexmap::set::IndexSet::sort_by"><code>sort_by</code></a> for details.</p>
|
|||
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.sort_by" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#590-595">source</a><h4 class="code-header">pub fn <a href="#method.sort_by" class="fn">sort_by</a><F>(&mut self, cmp: F)<div class="where">where
|
|||
|
F: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&T</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&T</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>,</div></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="toggle method-toggle" open><summary><section id="method.sorted_by" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#601-610">source</a><h4 class="code-header">pub fn <a href="#method.sorted_by" class="fn">sorted_by</a><F>(self, cmp: F) -> <a class="struct" href="struct.IntoIter.html" title="struct indexmap::set::IntoIter">IntoIter</a><T> <a href="#" class="tooltip" data-notable-ty="IntoIter<T>">ⓘ</a><div class="where">where
|
|||
|
F: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&T</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&T</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>,</div></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="toggle method-toggle" open><summary><section id="method.sort_unstable" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#615-620">source</a><h4 class="code-header">pub fn <a href="#method.sort_unstable" class="fn">sort_unstable</a>(&mut self)<div class="where">where
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,</div></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" title="method indexmap::set::IndexSet::sort_unstable_by"><code>sort_unstable_by</code></a> for details.</p>
|
|||
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.sort_unstable_by" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#625-630">source</a><h4 class="code-header">pub fn <a href="#method.sort_unstable_by" class="fn">sort_unstable_by</a><F>(&mut self, cmp: F)<div class="where">where
|
|||
|
F: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&T</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&T</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>,</div></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="toggle method-toggle" open><summary><section id="method.sorted_unstable_by" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#634-643">source</a><h4 class="code-header">pub fn <a href="#method.sorted_unstable_by" class="fn">sorted_unstable_by</a><F>(self, cmp: F) -> <a class="struct" href="struct.IntoIter.html" title="struct indexmap::set::IntoIter">IntoIter</a><T> <a href="#" class="tooltip" data-notable-ty="IntoIter<T>">ⓘ</a><div class="where">where
|
|||
|
F: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&T</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&T</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>,</div></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="toggle method-toggle" open><summary><section id="method.reverse" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#648-650">source</a><h4 class="code-header">pub fn <a href="#method.reverse" class="fn">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="toggle implementors-toggle" open><summary><section id="impl-IndexSet%3CT,+S%3E-2" class="impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#653-722">source</a><a href="#impl-IndexSet%3CT,+S%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="toggle method-toggle" open><summary><section id="method.get_index" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#659-661">source</a><h4 class="code-header">pub fn <a href="#method.get_index" class="fn">get_index</a>(&self, index: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&T</a>></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="toggle method-toggle" open><summary><section id="method.first" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#666-668">source</a><h4 class="code-header">pub fn <a href="#method.first" class="fn">first</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&T</a>></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="toggle method-toggle" open><summary><section id="method.last" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#673-675">source</a><h4 class="code-header">pub fn <a href="#method.last" class="fn">last</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&T</a>></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="toggle method-toggle" open><summary><section id="method.swap_remove_index" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#686-688">source</a><h4 class="code-header">pub fn <a href="#method.swap_remove_index" class="fn">swap_remove_index</a>(&mut self, index: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><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="toggle method-toggle" open><summary><section id="method.shift_remove_index" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#699-701">source</a><h4 class="code-header">pub fn <a href="#method.shift_remove_index" class="fn">shift_remove_index</a>(&mut self, index: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><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="toggle method-toggle" open><summary><section id="method.move_index" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#712-714">source</a><h4 class="code-header">pub fn <a href="#method.move_index" class="fn">move_index</a>(&mut self, from: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>, to: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>)</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="toggle method-toggle" open><summary><section id="method.swap_indices" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#719-721">source</a><h4 class="code-header">pub fn <a href="#method.swap_indices" class="fn">swap_indices</a>(&mut self, a: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>, b: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>)</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="toggle implementors-toggle" open><summary><section id="impl-IndexSet%3CT,+S%3E-3" class="impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#983-1015">source</a><a href="#impl-IndexSet%3CT,+S%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><div class="where">where
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a>,
|
|||
|
S: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.is_disjoint" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#989-998">source</a><h4 class="code-header">pub fn <a href="#method.is_disjoint" class="fn">is_disjoint</a><S2>(&self, other: &<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>) -> <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a><div class="where">where
|
|||
|
S2: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,</div></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="toggle method-toggle" open><summary><section id="method.is_subset" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#1001-1006">source</a><h4 class="code-header">pub fn <a href="#method.is_subset" class="fn">is_subset</a><S2>(&self, other: &<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>) -> <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a><div class="where">where
|
|||
|
S2: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,</div></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="toggle method-toggle" open><summary><section id="method.is_superset" class="method"><a class="src rightside" href="../../src/indexmap/set.rs.html#1009-1014">source</a><h4 class="code-header">pub fn <a href="#method.is_superset" class="fn">is_superset</a><S2>(&self, other: &<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>) -> <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a><div class="where">where
|
|||
|
S2: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,</div></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="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-BitAnd%3C%26IndexSet%3CT,+S2%3E%3E-for-%26IndexSet%3CT,+S1%3E" class="impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#1321-1335">source</a><a href="#impl-BitAnd%3C%26IndexSet%3CT,+S2%3E%3E-for-%26IndexSet%3CT,+S1%3E" class="anchor">§</a><h3 class="code-header">impl<T, S1, S2> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/ops/bit/trait.BitAnd.html" title="trait core::ops::bit::BitAnd">BitAnd</a><&<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><div class="where">where
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
|||
|
S1: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/default/trait.Default.html" title="trait core::default::Default">Default</a>,
|
|||
|
S2: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.bitand" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#1332-1334">source</a><a href="#method.bitand" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/ops/bit/trait.BitAnd.html#tymethod.bitand" class="fn">bitand</a>(self, other: &<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>) -> Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/ops/bit/trait.BitAnd.html#associatedtype.Output" title="type core::ops::bit::BitAnd::Output">Output</a></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="toggle" open><summary><section id="associatedtype.Output-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#1327">source</a><a href="#associatedtype.Output-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.83.0/core/ops/bit/trait.BitAnd.html#associatedtype.Output" 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="toggle implementors-toggle" open><summary><section id="impl-BitOr%3C%26IndexSet%3CT,+S2%3E%3E-for-%26IndexSet%3CT,+S1%3E" class="impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#1337-1352">source</a><a href="#impl-BitOr%3C%26IndexSet%3CT,+S2%3E%3E-for-%26IndexSet%3CT,+S1%3E" class="anchor">§</a><h3 class="code-header">impl<T, S1, S2> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/ops/bit/trait.BitOr.html" title="trait core::ops::bit::BitOr">BitOr</a><&<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><div class="where">where
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
|||
|
S1: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/default/trait.Default.html" title="trait core::default::Default">Default</a>,
|
|||
|
S2: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.bitor" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#1349-1351">source</a><a href="#method.bitor" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/ops/bit/trait.BitOr.html#tymethod.bitor" class="fn">bitor</a>(self, other: &<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>) -> Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/ops/bit/trait.BitOr.html#associatedtype.Output" title="type core::ops::bit::BitOr::Output">Output</a></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="toggle" open><summary><section id="associatedtype.Output-2" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#1343">source</a><a href="#associatedtype.Output-2" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.83.0/core/ops/bit/trait.BitOr.html#associatedtype.Output" 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="toggle implementors-toggle" open><summary><section id="impl-BitXor%3C%26IndexSet%3CT,+S2%3E%3E-for-%26IndexSet%3CT,+S1%3E" class="impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#1354-1369">source</a><a href="#impl-BitXor%3C%26IndexSet%3CT,+S2%3E%3E-for-%26IndexSet%3CT,+S1%3E" class="anchor">§</a><h3 class="code-header">impl<T, S1, S2> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/ops/bit/trait.BitXor.html" title="trait core::ops::bit::BitXor">BitXor</a><&<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><div class="where">where
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
|||
|
S1: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/default/trait.Default.html" title="trait core::default::Default">Default</a>,
|
|||
|
S2: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.bitxor" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#1366-1368">source</a><a href="#method.bitxor" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/ops/bit/trait.BitXor.html#tymethod.bitxor" class="fn">bitxor</a>(self, other: &<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>) -> Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/ops/bit/trait.BitXor.html#associatedtype.Output" title="type core::ops::bit::BitXor::Output">Output</a></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="toggle" open><summary><section id="associatedtype.Output-3" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#1360">source</a><a href="#associatedtype.Output-3" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.83.0/core/ops/bit/trait.BitXor.html#associatedtype.Output" 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="toggle implementors-toggle" open><summary><section id="impl-Clone-for-IndexSet%3CT,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#71-85">source</a><a href="#impl-Clone-for-IndexSet%3CT,+S%3E" class="anchor">§</a><h3 class="code-header">impl<T, S> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><div class="where">where
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
|||
|
S: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#76-80">source</a><a href="#method.clone" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/clone/trait.Clone.html#tymethod.clone" class="fn">clone</a>(&self) -> Self</h4></section></summary><div class='docblock'>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.83.0/core/clone/trait.Clone.html#tymethod.clone">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl"><a class="src 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 href="https://doc.rust-lang.org/1.83.0/core/clone/trait.Clone.html#method.clone_from" class="fn">clone_from</a>(&mut self, other: &Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/1.83.0/core/clone/trait.Clone.html#method.clone_from">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-IndexSet%3CT,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#113-125">source</a><a href="#impl-Debug-for-IndexSet%3CT,+S%3E" class="anchor">§</a><h3 class="code-header">impl<T, S> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><div class="where">where
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#117-124">source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/1.83.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/1.83.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.83.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Default-for-IndexSet%3CT,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#953-963">source</a><a href="#impl-Default-for-IndexSet%3CT,+S%3E" class="anchor">§</a><h3 class="code-header">impl<T, S> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><div class="where">where
|
|||
|
S: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/default/trait.Default.html" title="trait core::default::Default">Default</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.default" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#958-962">source</a><a href="#method.default" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/default/trait.Default.html#tymethod.default" class="fn">default</a>() -> Self</h4></section></summary><div class="docblock"><p>Return an empty <code>IndexSet</code></p>
|
|||
|
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Extend%3C%26T%3E-for-IndexSet%3CT,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#942-951">source</a><a href="#impl-Extend%3C%26T%3E-for-IndexSet%3CT,+S%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T, S> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.Extend.html" title="trait core::iter::traits::collect::Extend">Extend</a><<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&'a T</a>> for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><div class="where">where
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> + 'a,
|
|||
|
S: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.extend-1" class="method trait-impl"><a class="src 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 href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.Extend.html#tymethod.extend" class="fn">extend</a><I: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&'a T</a>>>(&mut self, iterable: I)</h4></section></summary><div class='docblock'>Extends a collection with the contents of an iterator. <a href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.Extend.html#tymethod.extend">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.extend_one-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/iter/traits/collect.rs.html#454">source</a><a href="#method.extend_one-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.Extend.html#method.extend_one" class="fn">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="toggle method-toggle" open><summary><section id="method.extend_reserve-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/iter/traits/collect.rs.html#462">source</a><a href="#method.extend_reserve-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.Extend.html#method.extend_reserve" class="fn">extend_reserve</a>(&mut self, additional: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</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'>Reserves capacity in a collection for the given number of additional elements. <a href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.Extend.html#method.extend_reserve">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Extend%3CT%3E-for-IndexSet%3CT,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#931-940">source</a><a href="#impl-Extend%3CT%3E-for-IndexSet%3CT,+S%3E" class="anchor">§</a><h3 class="code-header">impl<T, S> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.Extend.html" title="trait core::iter::traits::collect::Extend">Extend</a><T> for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><div class="where">where
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>,
|
|||
|
S: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.extend" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#936-939">source</a><a href="#method.extend" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.Extend.html#tymethod.extend" class="fn">extend</a><I: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = T>>(&mut self, iterable: I)</h4></section></summary><div class='docblock'>Extends a collection with the contents of an iterator. <a href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.Extend.html#tymethod.extend">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.extend_one" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/iter/traits/collect.rs.html#454">source</a><a href="#method.extend_one" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.Extend.html#method.extend_one" class="fn">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="toggle method-toggle" open><summary><section id="method.extend_reserve" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/iter/traits/collect.rs.html#462">source</a><a href="#method.extend_reserve" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.Extend.html#method.extend_reserve" class="fn">extend_reserve</a>(&mut self, additional: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</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'>Reserves capacity in a collection for the given number of additional elements. <a href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.Extend.html#method.extend_reserve">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-From%3C%5BT;+N%5D%3E-for-IndexSet%3CT%3E" class="impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#913-929">source</a><a href="#impl-From%3C%5BT;+N%5D%3E-for-IndexSet%3CT%3E" class="anchor">§</a><h3 class="code-header">impl<T, const N: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.array.html">[T; N]</a>> for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, <a class="struct" href="https://doc.rust-lang.org/1.83.0/std/hash/random/struct.RandomState.html" title="struct std::hash::random::RandomState">RandomState</a>><div class="where">where
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#926-928">source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(arr: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.array.html">[T; N]</a>) -> Self</h4></section></summary><div class="docblock"><h5 id="examples-2"><a class="doc-anchor" href="#examples-2">§</a>Examples</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="toggle implementors-toggle" open><summary><section id="impl-FromIterator%3CT%3E-for-IndexSet%3CT,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#899-910">source</a><a href="#impl-FromIterator%3CT%3E-for-IndexSet%3CT,+S%3E" class="anchor">§</a><h3 class="code-header">impl<T, S> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.FromIterator.html" title="trait core::iter::traits::collect::FromIterator">FromIterator</a><T> for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><div class="where">where
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>,
|
|||
|
S: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/default/trait.Default.html" title="trait core::default::Default">Default</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from_iter" class="method trait-impl"><a class="src 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 href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.FromIterator.html#tymethod.from_iter" class="fn">from_iter</a><I: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = T>>(iterable: I) -> Self</h4></section></summary><div class='docblock'>Creates a value from an iterator. <a href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.FromIterator.html#tymethod.from_iter">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Index%3Cusize%3E-for-IndexSet%3CT,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#752-762">source</a><a href="#impl-Index%3Cusize%3E-for-IndexSet%3CT,+S%3E" class="anchor">§</a><h3 class="code-header">impl<T, S> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html" title="trait core::ops::index::Index">Index</a><<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>> 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 class="doc-anchor" href="#examples-1">§</a>Examples</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"><a href="#" class="tooltip" title="This example panics">ⓘ</a><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="toggle method-toggle" open><summary><section id="method.index" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#758-761">source</a><a href="#method.index" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#tymethod.index" class="fn">index</a>(&self, index: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&T</a></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="toggle" open><summary><section id="associatedtype.Output" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#753">source</a><a href="#associatedtype.Output" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#associatedtype.Output" class="associatedtype">Output</a> = T</h4></section></summary><div class='docblock'>The returned type after indexing.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IntoIterator-for-%26IndexSet%3CT,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#879-886">source</a><a href="#impl-IntoIterator-for-%26IndexSet%3CT,+S%3E" class="anchor">§</a><h3 class="code-header">impl<'a, T, S> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a> 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="toggle" open><summary><section id="associatedtype.Item" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#880">source</a><a href="#associatedtype.Item" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&'a T</a></h4></section></summary><div class='docblock'>The type of the elements being iterated over.</div></details><details class="toggle" open><summary><section id="associatedtype.IntoIter" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#881">source</a><a href="#associatedtype.IntoIter" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" 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="toggle method-toggle" open><summary><section id="method.into_iter" class="method trait-impl"><a class="src 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 href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter" class="fn">into_iter</a>(self) -> Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" title="type core::iter::traits::collect::IntoIterator::IntoIter">IntoIter</a></h4></section></summary><div class='docblock'>Creates an iterator from a value. <a href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IntoIterator-for-IndexSet%3CT,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#888-897">source</a><a href="#impl-IntoIterator-for-IndexSet%3CT,+S%3E" class="anchor">§</a><h3 class="code-header">impl<T, S> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a> 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="toggle" open><summary><section id="associatedtype.Item-1" class="associatedtyp
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>,
|
|||
|
S1: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,
|
|||
|
S2: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#971-973">source</a><a href="#method.eq" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>) -> <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.83.0/src/core/cmp.rs.html#261">source</a></span><a href="#method.ne" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
|||
|
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Sub%3C%26IndexSet%3CT,+S2%3E%3E-for-%26IndexSet%3CT,+S1%3E" class="impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#1371-1385">source</a><a href="#impl-Sub%3C%26IndexSet%3CT,+S2%3E%3E-for-%26IndexSet%3CT,+S1%3E" class="anchor">§</a><h3 class="code-header">impl<T, S1, S2> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a><&<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><div class="where">where
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
|||
|
S1: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/default/trait.Default.html" title="trait core::default::Default">Default</a>,
|
|||
|
S2: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.sub" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#1382-1384">source</a><a href="#method.sub" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/ops/arith/trait.Sub.html#tymethod.sub" class="fn">sub</a>(self, other: &<a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S2>) -> Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/ops/arith/trait.Sub.html#associatedtype.Output" title="type core::ops::arith::Sub::Output">Output</a></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="toggle" open><summary><section id="associatedtype.Output-4" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#1377">source</a><a href="#associatedtype.Output-4" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.83.0/core/ops/arith/trait.Sub.html#associatedtype.Output" 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,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/set.rs.html#976-981">source</a><a href="#impl-Eq-for-IndexSet%3CT,+S%3E" class="anchor">§</a><h3 class="code-header">impl<T, S> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><div class="where">where
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a>,
|
|||
|
S: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,</div></h3></section></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-IndexSet%3CT,+S%3E" class="impl"><a href="#impl-Freeze-for-IndexSet%3CT,+S%3E" class="anchor">§</a><h3 class="code-header">impl<T, S> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><div class="where">where
|
|||
|
S: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a>,</div></h3></section><section id="impl-RefUnwindSafe-for-IndexSet%3CT,+S%3E" class="impl"><a href="#impl-RefUnwindSafe-for-IndexSet%3CT,+S%3E" class="anchor">§</a><h3 class="code-header">impl<T, S> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><div class="where">where
|
|||
|
S: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,</div></h3></section><section id="impl-Send-for-IndexSet%3CT,+S%3E" class="impl"><a href="#impl-Send-for-IndexSet%3CT,+S%3E" class="anchor">§</a><h3 class="code-header">impl<T, S> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><div class="where">where
|
|||
|
S: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,</div></h3></section><section id="impl-Sync-for-IndexSet%3CT,+S%3E" class="impl"><a href="#impl-Sync-for-IndexSet%3CT,+S%3E" class="anchor">§</a><h3 class="code-header">impl<T, S> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><div class="where">where
|
|||
|
S: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,</div></h3></section><section id="impl-Unpin-for-IndexSet%3CT,+S%3E" class="impl"><a href="#impl-Unpin-for-IndexSet%3CT,+S%3E" class="anchor">§</a><h3 class="code-header">impl<T, S> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><div class="where">where
|
|||
|
S: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h3></section><section id="impl-UnwindSafe-for-IndexSet%3CT,+S%3E" class="impl"><a href="#impl-UnwindSafe-for-IndexSet%3CT,+S%3E" class="anchor">§</a><h3 class="code-header">impl<T, S> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.IndexSet.html" title="struct indexmap::set::IndexSet">IndexSet</a><T, S><div class="where">where
|
|||
|
S: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a>,
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a>,</div></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/any.rs.html#138">source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
|
|||
|
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/any.rs.html#139">source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.83.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.83.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/borrow.rs.html#209">source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T<div class="where">where
|
|||
|
T: ?<a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/borrow.rs.html#211">source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.83.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/borrow.rs.html#217">source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<div class="where">where
|
|||
|
T: ?<a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/borrow.rs.html#218">source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.83.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-CloneToUninit-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/clone.rs.html#273">source</a><a href="#impl-CloneToUninit-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/clone/trait.CloneToUninit.html" title="trait core::clone::CloneToUninit">CloneToUninit</a> for T<div class="where">where
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone_to_uninit" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/clone.rs.html#275">source</a><a href="#method.clone_to_uninit" class="anchor">§</a><h4 class="code-header">unsafe fn <a href="https://doc.rust-lang.org/1.83.0/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit" class="fn">clone_to_uninit</a>(&self, dst: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.pointer.html">*mut T</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>clone_to_uninit</code>)</span></div></span><div class='docblock'>Performs copy-assignment from <code>self</code> to <code>dst</code>. <a href="https://doc.rust-lang.org/1.83.0/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Equivalent%3CK%3E-for-Q" class="impl"><a class="src rightside" href="../../src/indexmap/equivalent.rs.html#18-27">source</a><a href="#impl-Equivalent%3CK%3E-for-Q" class="anchor">§</a><h3 class="code-header">impl<Q, K> <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a><K> for Q<div class="where">where
|
|||
|
Q: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
|
|||
|
K: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.equivalent" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/equivalent.rs.html#24-26">source</a><a href="#method.equivalent" class="anchor">§</a><h4 class="code-header">fn <a href="../trait.Equivalent.html#tymethod.equivalent" class="fn">equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&K</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Compare self to <code>key</code> and return <code>true</code> if they are equal.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/convert/mod.rs.html#765">source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/convert/mod.rs.html#768">source</a><a href="#method.from-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
|||
|
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/convert/mod.rs.html#748-750">source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T<div class="where">where
|
|||
|
U: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/convert/mod.rs.html#758">source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/convert/trait.Into.html#tymethod.into" class="fn">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><a href="https://doc.rust-lang.org/1.83.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
|
|||
|
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-ToOwned-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/alloc/borrow.rs.html#82-84">source</a><a href="#impl-ToOwned-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.83.0/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T<div class="where">where
|
|||
|
T: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/alloc/borrow.rs.html#86">source</a><a href="#associatedtype.Owned" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.83.0/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/alloc/borrow.rs.html#87">source</a><a href="#method.to_owned" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fn">to_owned</a>(&self) -> T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/1.83.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/alloc/borrow.rs.html#91">source</a><a href="#method.clone_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fn">clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&mut T</a>)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/1.83.0/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/convert/mod.rs.html#805-807">source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T<div class="where">where
|
|||
|
U: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/convert/mod.rs.html#809">source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.83.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/convert/mod.rs.html#812">source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/convert/mod.rs.html#790-792">source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T<div class="where">where
|
|||
|
U: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/convert/mod.rs.html#794">source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.83.0/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.83.0/src/core/convert/mod.rs.html#797">source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div><script type="text/json" id="notable-traits-data">{"Difference<'a, T, S2>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Difference.html\" title=\"struct indexmap::set::Difference\">Difference</a><'a, T, S></code></h3><pre><code><div class=\"where\">impl<'a, T, S> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.83.0/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"struct.Difference.html\" title=\"struct indexmap::set::Difference\">Difference</a><'a, T, S><div class=\"where\">where\n T: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.83.0/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> + <a class=\"trait\" href=\"https://doc.rust-lang.org/1.83.0/core/hash/trait.Hash.html\" title=\"trait core::hash::Hash\">Hash</a>,\n S: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.83.0/core/hash/trait.BuildHasher.html\" title=\"trait core::hash::BuildHasher\">BuildHasher</a>,</div></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.83.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = <a class=\"primitive\" href=\"https://doc.rust-lang.org/1.83.0/std/primitive.reference.html\">&'a T</a>;</div>","Drain<'_, T>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Drain.html\" title=\"struct indexmap::set::Drain\">Drain</a><'_, T></code></h3><pre><code><div class=\"where\">impl<T> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.83.0/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"struct.Drain.html\" title=\"struct indexmap::set::Drain\">Drain</a><'_, T></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.83.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associat
|