<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><metaname="generator"content="rustdoc"><metaname="description"content="A hash table where the iteration order of the key-value pairs is independent of the hash values of the keys."><title>IndexMap in indexmap::map - Rust</title><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><linkrel="stylesheet"href="../../static.files/normalize-76eba96aa4d2e634.css"><linkrel="stylesheet"href="../../static.files/rustdoc-5bc39a1768837dd0.css"><metaname="rustdoc-vars"data-root-path="../../"data-static-root-path="../../static.files/"data-current-crate="indexmap"data-themes=""data-resource-suffix=""data-rustdoc-version="1.77.1 (7cf61ebde 2024-03-27)"data-channel="1.77.1"data-search-js="search-dd67cee4cfa65049.js"data-settings-js="settings-4313503d2e1961c2.js"><scriptsrc="../../static.files/storage-4c98445ec4002617.js"></script><scriptdefersrc="sidebar-items.js"></script><scriptdefersrc="../../static.files/main-48f368f3872407c8.js"></script><noscript><linkrel="stylesheet"href="../../static.files/noscript-04d5337699b92874.css"></noscript><linkrel="alternate icon"type="image/png"href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><linkrel="alternate icon"type="image/png"href="../../static.files/favicon-32x32-422f7d1d52889060.png"><linkrel="icon"type="image/svg+xml"href="../../static.files/favicon-2c020d218678b618.svg"></head><bodyclass="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="mobile-topbar"><buttonclass="sidebar-menu-toggle"title="show sidebar"></button></nav><navclass="sidebar"><divclass="sidebar-crate"><h2><ahref="../../indexmap/index.html">indexmap</a><spanclass="version">2.2.6</span></h2></div><h2class="location"><ahref="#">IndexMap</a></h2><divclass="sidebar-elems"><section><h3><ahref="#implementations">Methods</a></h3><ulclass="block method"><li><ahref="#method.as_mut_slice">as_mut_slice</a></li><li><ahref="#method.as_slice">as_slice</a></li><li><ahref="#method.binary_search_by">binary_search_by</a></li><li><ahref="#method.binary_search_by_key">binary_search_by_key</a></li><li><ahref="#method.binary_search_keys">binary_search_keys</a></li><li><ahref="#method.capacity">capacity</a></li><li><ahref="#method.clear">clear</a></li><li><ahref="#method.contains_key">contains_key</a></li><li><ahref="#method.drain">drain</a></li><li><ahref="#method.entry">entry</a></li><li><ahref="#method.first">first</a></li><li><ahref="#method.first_mut">first_mut</a></li><li><ahref="#method.get">get</a></li><li><ahref="#method.get_full">get_full</a></li><li><ahref="#method.get_full_mut">get_full_mut</a></li><li><ahref="#method.get_index">get_index</a></li><li><ahref="#method.get_index_entry">get_index_entry</a></li><li><ahref="#method.get_index_mut">get_index_mut</a></li><li><ahref="#method.get_index_of">get_index_of</a></li><li><ahref="#method.get_key_value">get_key_value</a></li><li><ahref="#method.get_mut">get_mut</a></li><li><ahref="#method.get_range">get_range</a></li><li><ahref="#method.get_range_mut">get_range_mut</a></li><li><ahref="#method.hasher">hasher</a></li><li><ahref="#method.insert">insert</a></li><li><ahref="#method.insert_full">insert_full</a></li><li><ahref="#method.insert_sorted">insert_sorted</a></li><li><ahref="#met
<main><divclass="width-limiter"><navclass="sub"><formclass="search-form"><span></span><divid="sidebar-button"tabindex="-1"><ahref="../../indexmap/all.html"title="show sidebar"></a></div><inputclass="search-input"name="search"aria-label="Run search in the documentation"autocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"><divid="help-button"tabindex="-1"><ahref="../../help.html"title="help">?</a></div><divid="settings-menu"tabindex="-1"><ahref="../../settings.html"title="settings"><imgwidth="22"height="22"alt="Change settings"src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><sectionid="main-content"class="content"><divclass="main-heading"><h1>Struct <ahref="../index.html">indexmap</a>::<wbr><ahref="index.html">map</a>::<wbr><aclass="struct"href="#">IndexMap</a><buttonid="copy-path"title="Copy item path to clipboard"><imgsrc="../../static.files/clipboard-7571035ce49a181d.svg"width="19"height="18"alt="Copy item path"></button></h1><spanclass="out-of-band"><aclass="src"href="../../src/indexmap/map.rs.html#86-89">source</a> · <buttonid="toggle-all-docs"title="collapse all docs">[<span>−</span>]</button></span></div><preclass="rust item-decl"><code>pub struct IndexMap<K, V, S = <aclass="struct"href="https://doc.rust-lang.org/1.77.1/std/hash/random/struct.RandomState.html"title="struct std::hash::random::RandomState">RandomState</a>> { <spanclass="comment">/* private fields */</span> }</code></pre><detailsclass="toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>A hash table where the iteration order of the key-value pairs is independent
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.with_capacity"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#174-176">source</a><h4class="code-header">pub fn <ahref="#method.with_capacity"class="fn">with_capacity</a>(n: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>) -> Self</h4></section></summary><divclass="docblock"><p>Create a new map with capacity for <code>n</code> key-value pairs. (Does not
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.with_hasher"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#200-205">source</a><h4class="code-header">pub const fn <ahref="#method.with_hasher"class="fn">with_hasher</a>(hash_builder: S) -> Self</h4></section></summary><divclass="docblock"><p>Create a new map with <code>hash_builder</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.capacity"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#213-215">source</a><h4class="code-header">pub fn <ahref="#method.capacity"class="fn">capacity</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a></h4></section></summary><divclass="docblock"><p>Return the number of elements the map can hold without reallocating.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.hasher"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#218-220">source</a><h4class="code-header">pub fn <ahref="#method.hasher"class="fn">hasher</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&S</a></h4></section></summary><divclass="docblock"><p>Return a reference to the map’s <code>BuildHasher</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.len"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#226-228">source</a><h4class="code-header">pub fn <ahref="#method.len"class="fn">len</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a></h4></section></summary><divclass="docblock"><p>Return the number of key-value pairs in the map.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_empty"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#234-236">source</a><h4class="code-header">pub fn <ahref="#method.is_empty"class="fn">is_empty</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Returns true if the map contains no elements.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.iter"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#239-241">source</a><h4class="code-header">pub fn <ahref="#method.iter"class="fn">iter</a>(&self) -><aclass="struct"href="struct.Iter.html"title="struct indexmap::map::Iter">Iter</a><'_, K, V><ahref="#"class="tooltip"data-notable-ty="Iter<'_, K, V>">ⓘ</a></h4></section></summary><divclass="docblock"><p>Return an iterator over the key-value pairs of the map, in their order</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.iter_mut"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#244-246">source</a><h4class="code-header">pub fn <ahref="#method.iter_mut"class="fn">iter_mut</a>(&mut self) -><aclass="struct"href="struct.IterMut.html"title="struct indexmap::map::IterMut">IterMut</a><'_, K, V><ahref="#"class="tooltip"data-notable-ty="IterMut<'_, K, V>">ⓘ</a></h4></section></summary><divclass="docblock"><p>Return an iterator over the key-value pairs of the map, in their order</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.keys"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#249-251">source</a><h4class="code-header">pub fn <ahref="#method.keys"class="fn">keys</a>(&self) -><aclass="struct"href="struct.Keys.html"title="struct indexmap::map::Keys">Keys</a><'_, K, V><ahref="#"class="tooltip"data-notable-ty="Keys<'_, K, V>">ⓘ</a></h4></section></summary><divclass="docblock"><p>Return an iterator over the keys of the map, in their order</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.into_keys"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#254-256">source</a><h4class="code-header">pub fn <ahref="#method.into_keys"class="fn">into_keys</a>(self) -><aclass="struct"href="struct.IntoKeys.html"title="struct indexmap::map::IntoKeys">IntoKeys</a><K, V><ahref="#"class="tooltip"data-notable-ty="IntoKeys<K, V>">ⓘ</a></h4></section></summary><divclass="docblock"><p>Return an owning iterator over the keys of the map, in their order</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.values"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#259-261">source</a><h4class="code-header">pub fn <ahref="#method.values"class="fn">values</a>(&self) -><aclass="struct"href="struct.Values.html"title="struct indexmap::map::Values">Values</a><'_, K, V><ahref="#"class="tooltip"data-notable-ty="Values<'_, K, V>">ⓘ</a></h4></section></summary><divclass="docblock"><p>Return an iterator over the values of the map, in their order</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.values_mut"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#265-267">source</a><h4class="code-header">pub fn <ahref="#method.values_mut"class="fn">values_mut</a>(&mut self) -><aclass="struct"href="struct.ValuesMut.html"title="struct indexmap::map::ValuesMut">ValuesMut</a><'_, K, V><ahref="#"class="tooltip"data-notable-ty="ValuesMut<'_, K, V>">ⓘ</a></h4></section></summary><divclass="docblock"><p>Return an iterator over mutable references to the values of the map,
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.into_values"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#270-272">source</a><h4class="code-header">pub fn <ahref="#method.into_values"class="fn">into_values</a>(self) -><aclass="struct"href="struct.IntoValues.html"title="struct indexmap::map::IntoValues">IntoValues</a><K, V><ahref="#"class="tooltip"data-notable-ty="IntoValues<K, V>">ⓘ</a></h4></section></summary><divclass="docblock"><p>Return an owning iterator over the values of the map, in their order</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.clear"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#277-279">source</a><h4class="code-header">pub fn <ahref="#method.clear"class="fn">clear</a>(&mut self)</h4></section></summary><divclass="docblock"><p>Remove all key-value pairs in the map, while preserving its capacity.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.truncate"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#284-286">source</a><h4class="code-header">pub fn <ahref="#method.truncate"class="fn">truncate</a>(&mut self, len: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>)</h4></section></summary><divclass="docblock"><p>Shortens the map, keeping the first <code>len</code> elements and dropping the rest.</p>
R: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/ops/range/trait.RangeBounds.html"title="trait core::ops::range::RangeBounds">RangeBounds</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>>,</div></h4></section></summary><divclass="docblock"><p>Clears the <code>IndexMap</code> in the given index range, returning those
<p>The range may be any type that implements <ahref="https://doc.rust-lang.org/1.77.1/core/ops/range/trait.RangeBounds.html"title="trait core::ops::range::RangeBounds"><code>RangeBounds<usize></code></a>,
S: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a>,</div></h4></section></summary><divclass="docblock"><p>Splits the collection into two at the given index.</p>
) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.unit.html">()</a>, <aclass="struct"href="../struct.TryReserveError.html"title="struct indexmap::TryReserveError">TryReserveError</a>></h4></section></summary><divclass="docblock"><p>Try to reserve capacity for <code>additional</code> more key-value pairs, without over-allocating.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.shrink_to_fit"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#366-368">source</a><h4class="code-header">pub fn <ahref="#method.shrink_to_fit"class="fn">shrink_to_fit</a>(&mut self)</h4></section></summary><divclass="docblock"><p>Shrink the capacity of the map as much as possible.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.shrink_to"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#373-375">source</a><h4class="code-header">pub fn <ahref="#method.shrink_to"class="fn">shrink_to</a>(&mut self, min_capacity: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>)</h4></section></summary><divclass="docblock"><p>Shrink the capacity of the map with a lower limit.</p>
<p>If an equivalent key already exists in the map: the key remains and
retains in its place in the order, its corresponding value is updated
with <code>value</code>, and the older value is returned inside <code>Some(_)</code>.</p>
<p>If no equivalent key existed in the map: the new key-value pair is
inserted, last in order, and <code>None</code> is returned.</p>
<p>Computes in <strong>O(1)</strong> time (amortized average).</p>
<p>See also <ahref="struct.IndexMap.html#method.entry"title="method indexmap::map::IndexMap::entry"><code>entry</code></a> if you want to insert <em>or</em> modify,
or <ahref="struct.IndexMap.html#method.insert_full"title="method indexmap::map::IndexMap::insert_full"><code>insert_full</code></a> if you need to get the index of
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.insert_full"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#413-416">source</a><h4class="code-header">pub fn <ahref="#method.insert_full"class="fn">insert_full</a>(&mut self, key: K, value: V) -> (<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>, <aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/option/enum.Option.html"title="enum core::option::Option">Option</a><V>)</h4></section></summary><divclass="docblock"><p>Insert a key-value pair in the map, and get their index.</p>
<p>If an equivalent key already exists in the map: the key remains and
retains in its place in the order, its corresponding value is updated
with <code>value</code>, and the older value is returned inside <code>(index, Some(_))</code>.</p>
<p>If no equivalent key existed in the map: the new key-value pair is
inserted, last in order, and <code>(index, None)</code> is returned.</p>
<p>Computes in <strong>O(1)</strong> time (amortized average).</p>
<p>See also <ahref="struct.IndexMap.html#method.entry"title="method indexmap::map::IndexMap::entry"><code>entry</code></a> if you want to insert <em>or</em> modify.</p>
K: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/cmp/trait.Ord.html"title="trait core::cmp::Ord">Ord</a>,</div></h4></section></summary><divclass="docblock"><p>Insert a key-value pair in the map at its ordered position among sorted keys.</p>
<p>This is equivalent to finding the position with
<ahref="struct.IndexMap.html#method.binary_search_keys"title="method indexmap::map::IndexMap::binary_search_keys"><code>binary_search_keys</code></a>, then either updating
it or calling <ahref="struct.IndexMap.html#method.shift_insert"title="method indexmap::map::IndexMap::shift_insert"><code>shift_insert</code></a> for a new key.</p>
<p>If the sorted key is found in the map, its corresponding value is
updated with <code>value</code>, and the older value is returned inside
<code>(index, Some(_))</code>. Otherwise, the new key-value pair is inserted at
the sorted position, and <code>(index, None)</code> is returned.</p>
<p>If the existing keys are <strong>not</strong> already sorted, then the insertion
index is unspecified (like <ahref="https://doc.rust-lang.org/1.77.1/std/primitive.slice.html#method.binary_search"title="method slice::binary_search"><code>slice::binary_search</code></a>), but the key-value
pair is moved to or inserted at that position regardless.</p>
<p>Computes in <strong>O(n)</strong> time (average). Instead of repeating calls to
<code>insert_sorted</code>, it may be faster to call batched <ahref="struct.IndexMap.html#method.insert"title="method indexmap::map::IndexMap::insert"><code>insert</code></a>
or <ahref="struct.IndexMap.html#method.extend"title="method indexmap::map::IndexMap::extend"><code>extend</code></a> and only call <ahref="struct.IndexMap.html#method.sort_keys"title="method indexmap::map::IndexMap::sort_keys"><code>sort_keys</code></a>
or <ahref="struct.IndexMap.html#method.sort_unstable_keys"title="method indexmap::map::IndexMap::sort_unstable_keys"><code>sort_unstable_keys</code></a> once.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.shift_insert"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#462-474">source</a><h4class="code-header">pub fn <ahref="#method.shift_insert"class="fn">shift_insert</a>(&mut self, index: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>, key: K, value: V) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/option/enum.Option.html"title="enum core::option::Option">Option</a><V></h4></section></summary><divclass="docblock"><p>Insert a key-value pair in the map at the given index.</p>
<p>If an equivalent key already exists in the map: the key remains and
is moved to the new position in the map, its corresponding value is updated
with <code>value</code>, and the older value is returned inside <code>Some(_)</code>.</p>
<p>If no equivalent key existed in the map: the new key-value pair is
inserted at the given index, and <code>None</code> is returned.</p>
<p><em><strong>Panics</strong></em> if <code>index</code> is out of bounds.</p>
<p>Computes in <strong>O(n)</strong> time (average).</p>
<p>See also <ahref="struct.IndexMap.html#method.entry"title="method indexmap::map::IndexMap::entry"><code>entry</code></a> if you want to insert <em>or</em> modify,
perhaps only using the index for new entries with <ahref="struct.VacantEntry.html#method.shift_insert"title="method indexmap::map::VacantEntry::shift_insert"><code>VacantEntry::shift_insert</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.entry"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#480-483">source</a><h4class="code-header">pub fn <ahref="#method.entry"class="fn">entry</a>(&mut self, key: K) -><aclass="enum"href="enum.Entry.html"title="enum indexmap::map::Entry">Entry</a><'_, K, V></h4></section></summary><divclass="docblock"><p>Get the given key’s corresponding entry in the map for insertion and/or
I: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/iter/traits/collect/trait.IntoIterator.html"title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.tuple.html">(K, V)</a>>,</div></h4></section></summary><divclass="docblock"><p>Creates a splicing iterator that replaces the specified range in the map
Q: ?<aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a> + <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/hash/trait.Hash.html"title="trait core::hash::Hash">Hash</a> + <aclass="trait"href="../trait.Equivalent.html"title="trait indexmap::Equivalent">Equivalent</a><K>,</div></h4></section></summary><divclass="docblock"><p>Return <code>true</code> if an equivalent to <code>key</code> exists in the map.</p>
Q: ?<aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a> + <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/hash/trait.Hash.html"title="trait core::hash::Hash">Hash</a> + <aclass="trait"href="../trait.Equivalent.html"title="trait indexmap::Equivalent">Equivalent</a><K>,</div></h4></section></summary><divclass="docblock"><p>Return a reference to the value stored for <code>key</code>, if it is present,
Q: ?<aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a> + <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/hash/trait.Hash.html"title="trait core::hash::Hash">Hash</a> + <aclass="trait"href="../trait.Equivalent.html"title="trait indexmap::Equivalent">Equivalent</a><K>,</div></h4></section></summary><divclass="docblock"><p>Return item index, if it exists in the map</p>
Q: ?<aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a> + <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/hash/trait.Hash.html"title="trait core::hash::Hash">Hash</a> + <aclass="trait"href="../trait.Equivalent.html"title="trait indexmap::Equivalent">Equivalent</a><K>,</div></h4></section><spanclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span><span>Deprecated: <code>remove</code> disrupts the map order – use <code>swap_remove</code> or <code>shift_remove</code> for explicit behavior.</span></div></span></summary><divclass="docblock"><p>Remove the key-value pair equivalent to <code>key</code> and return
<p><strong>NOTE:</strong> This is equivalent to <ahref="struct.IndexMap.html#method.swap_remove"title="method indexmap::map::IndexMap::swap_remove"><code>.swap_remove(key)</code></a>, replacing this
entry’s position with the last element, and it is deprecated in favor of calling that
explicitly. If you need to preserve the relative order of the keys in the map, use
Q: ?<aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a> + <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/hash/trait.Hash.html"title="trait core::hash::Hash">Hash</a> + <aclass="trait"href="../trait.Equivalent.html"title="trait indexmap::Equivalent">Equivalent</a><K>,</div></h4></section><spanclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span><span>Deprecated: <code>remove_entry</code> disrupts the map order – use <code>swap_remove_entry</code> or <code>shift_remove_entry</code> for explicit behavior.</span></div></span></summary><divclass="docblock"><p>Remove and return the key-value pair equivalent to <code>key</code>.</p>
<p><strong>NOTE:</strong> This is equivalent to <ahref="struct.IndexMap.html#method.swap_remove_entry"title="method indexmap::map::IndexMap::swap_remove_entry"><code>.swap_remove_entry(key)</code></a>,
replacing this entry’s position with the last element, and it is deprecated in favor of
calling that explicitly. If you need to preserve the relative order of the keys in the map,
use <ahref="struct.IndexMap.html#method.shift_remove_entry"title="method indexmap::map::IndexMap::shift_remove_entry"><code>.shift_remove_entry(key)</code></a> instead.</p>
<p>Like <ahref="https://doc.rust-lang.org/1.77.1/alloc/vec/struct.Vec.html#method.swap_remove"title="method alloc::vec::Vec::swap_remove"><code>Vec::swap_remove</code></a>, the pair is removed by swapping it with the
Q: ?<aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a> + <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/hash/trait.Hash.html"title="trait core::hash::Hash">Hash</a> + <aclass="trait"href="../trait.Equivalent.html"title="trait indexmap::Equivalent">Equivalent</a><K>,</div></h4></section></summary><divclass="docblock"><p>Remove and return the key-value pair equivalent to <code>key</code>.</p>
<p>Like <ahref="https://doc.rust-lang.org/1.77.1/alloc/vec/struct.Vec.html#method.swap_remove"title="method alloc::vec::Vec::swap_remove"><code>Vec::swap_remove</code></a>, the pair is removed by swapping it with the
Q: ?<aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a> + <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/hash/trait.Hash.html"title="trait core::hash::Hash">Hash</a> + <aclass="trait"href="../trait.Equivalent.html"title="trait indexmap::Equivalent">Equivalent</a><K>,</div></h4></section></summary><divclass="docblock"><p>Remove the key-value pair equivalent to <code>key</code> and return it and
<p>Like <ahref="https://doc.rust-lang.org/1.77.1/alloc/vec/struct.Vec.html#method.swap_remove"title="method alloc::vec::Vec::swap_remove"><code>Vec::swap_remove</code></a>, the pair is removed by swapping it with the
<p>Like <ahref="https://doc.rust-lang.org/1.77.1/alloc/vec/struct.Vec.html#method.remove"title="method alloc::vec::Vec::remove"><code>Vec::remove</code></a>, the pair is removed by shifting all of the
Q: ?<aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a> + <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/hash/trait.Hash.html"title="trait core::hash::Hash">Hash</a> + <aclass="trait"href="../trait.Equivalent.html"title="trait indexmap::Equivalent">Equivalent</a><K>,</div></h4></section></summary><divclass="docblock"><p>Remove and return the key-value pair equivalent to <code>key</code>.</p>
<p>Like <ahref="https://doc.rust-lang.org/1.77.1/alloc/vec/struct.Vec.html#method.remove"title="method alloc::vec::Vec::remove"><code>Vec::remove</code></a>, the pair is removed by shifting all of the
Q: ?<aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a> + <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/hash/trait.Hash.html"title="trait core::hash::Hash">Hash</a> + <aclass="trait"href="../trait.Equivalent.html"title="trait indexmap::Equivalent">Equivalent</a><K>,</div></h4></section></summary><divclass="docblock"><p>Remove the key-value pair equivalent to <code>key</code> and return it and
<p>Like <ahref="https://doc.rust-lang.org/1.77.1/alloc/vec/struct.Vec.html#method.remove"title="method alloc::vec::Vec::remove"><code>Vec::remove</code></a>, the pair is removed by shifting all of the
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&K</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&mut V</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.bool.html">bool</a>,</div></h4></section></summary><divclass="docblock"><p>Scan through each key-value pair in the map and keep those where the
K: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/cmp/trait.Ord.html"title="trait core::cmp::Ord">Ord</a>,</div></h4></section></summary><divclass="docblock"><p>Sort the map’s key-value pairs by the default ordering of the keys.</p>
<p>This is a stable sort – but equivalent keys should not normally coexist in
a map at all, so <ahref="struct.IndexMap.html#method.sort_unstable_keys"title="method indexmap::map::IndexMap::sort_unstable_keys"><code>sort_unstable_keys</code></a> is preferred
because it is generally faster and doesn’t allocate auxiliary memory.</p>
<p>See <ahref="struct.IndexMap.html#method.sort_by"title="method indexmap::map::IndexMap::sort_by"><code>sort_by</code></a> for details.</p>
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&K</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&V</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&K</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&V</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/cmp/enum.Ordering.html"title="enum core::cmp::Ordering">Ordering</a>,</div></h4></section></summary><divclass="docblock"><p>Sort the map’s key-value pairs in place using the comparison
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&K</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&V</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&K</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&V</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/cmp/enum.Ordering.html"title="enum core::cmp::Ordering">Ordering</a>,</div></h4></section></summary><divclass="docblock"><p>Sort the key-value pairs of the map and return a by-value iterator of
K: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/cmp/trait.Ord.html"title="trait core::cmp::Ord">Ord</a>,</div></h4></section></summary><divclass="docblock"><p>Sort the map’s key-value pairs by the default ordering of the keys, but
<p>See <ahref="struct.IndexMap.html#method.sort_unstable_by"title="method indexmap::map::IndexMap::sort_unstable_by"><code>sort_unstable_by</code></a> for details.</p>
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&K</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&V</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&K</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&V</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/cmp/enum.Ordering.html"title="enum core::cmp::Ordering">Ordering</a>,</div></h4></section></summary><divclass="docblock"><p>Sort the map’s key-value pairs in place using the comparison function <code>cmp</code>, but
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&K</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&V</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&K</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&V</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/cmp/enum.Ordering.html"title="enum core::cmp::Ordering">Ordering</a>,</div></h4></section></summary><divclass="docblock"><p>Sort the key-value pairs of the map and return a by-value iterator of
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&K</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&V</a>) -> T,</div></h4></section></summary><divclass="docblock"><p>Sort the map’s key-value pairs in place using a sort-key extraction function.</p>
K: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/cmp/trait.Ord.html"title="trait core::cmp::Ord">Ord</a>,</div></h4></section></summary><divclass="docblock"><p>Search over a sorted map for a key.</p>
maintain the sort. See <ahref="https://doc.rust-lang.org/1.77.1/std/primitive.slice.html#method.binary_search"title="method slice::binary_search"><code>slice::binary_search</code></a> for more details.</p>
<p>Computes in <strong>O(log(n))</strong> time, which is notably less scalable than looking the key up
using <ahref="struct.IndexMap.html#method.get_index_of"title="method indexmap::map::IndexMap::get_index_of"><code>get_index_of</code></a>, but this can also position missing keys.</p>
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&'a K</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&'a V</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/cmp/enum.Ordering.html"title="enum core::cmp::Ordering">Ordering</a>,</div></h4></section></summary><divclass="docblock"><p>Search over a sorted map with a comparator function.</p>
to maintain the sort. See <ahref="https://doc.rust-lang.org/1.77.1/std/primitive.slice.html#method.binary_search_by"title="method slice::binary_search_by"><code>slice::binary_search_by</code></a> for more details.</p>
B: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/cmp/trait.Ord.html"title="trait core::cmp::Ord">Ord</a>,</div></h4></section></summary><divclass="docblock"><p>Search over a sorted map with an extraction function.</p>
to maintain the sort. See <ahref="https://doc.rust-lang.org/1.77.1/std/primitive.slice.html#method.binary_search_by_key"title="method slice::binary_search_by_key"><code>slice::binary_search_by_key</code></a> for more details.</p>
P: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&K</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&V</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.bool.html">bool</a>,</div></h4></section></summary><divclass="docblock"><p>Returns the index of the partition point of a sorted map according to the given predicate
<p>See <ahref="https://doc.rust-lang.org/1.77.1/std/primitive.slice.html#method.partition_point"title="method slice::partition_point"><code>slice::partition_point</code></a> for more details.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.reverse"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#980-982">source</a><h4class="code-header">pub fn <ahref="#method.reverse"class="fn">reverse</a>(&mut self)</h4></section></summary><divclass="docblock"><p>Reverses the order of the map’s key-value pairs in place.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_slice"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#987-989">source</a><h4class="code-header">pub fn <ahref="#method.as_slice"class="fn">as_slice</a>(&self) ->&<aclass="struct"href="struct.Slice.html"title="struct indexmap::map::Slice">Slice</a><K, V></h4></section></summary><divclass="docblock"><p>Returns a slice of all the key-value pairs in the map.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_mut_slice"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#994-996">source</a><h4class="code-header">pub fn <ahref="#method.as_mut_slice"class="fn">as_mut_slice</a>(&mut self) ->&mut <aclass="struct"href="struct.Slice.html"title="struct indexmap::map::Slice">Slice</a><K, V></h4></section></summary><divclass="docblock"><p>Returns a mutable slice of all the key-value pairs in the map.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.into_boxed_slice"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#1001-1003">source</a><h4class="code-header">pub fn <ahref="#method.into_boxed_slice"class="fn">into_boxed_slice</a>(self) -><aclass="struct"href="https://doc.rust-lang.org/1.77.1/alloc/boxed/struct.Box.html"title="struct alloc::boxed::Box">Box</a><<aclass="struct"href="struct.Slice.html"title="struct indexmap::map::Slice">Slice</a><K, V>></h4></section></summary><divclass="docblock"><p>Converts into a boxed slice of all the key-value pairs in the map.</p>
) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="struct"href="struct.IndexedEntry.html"title="struct indexmap::map::IndexedEntry">IndexedEntry</a><'_, K, V>></h4></section></summary><divclass="docblock"><p>Get an entry in the map by index for in-place manipulation.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get_range"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#1040-1044">source</a><h4class="code-header">pub fn <ahref="#method.get_range"class="fn">get_range</a><R: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/ops/range/trait.RangeBounds.html"title="trait core::ops::range::RangeBounds">RangeBounds</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>>>(&self, range: R) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&<aclass="struct"href="struct.Slice.html"title="struct indexmap::map::Slice">Slice</a><K, V>></h4></section></summary><divclass="docblock"><p>Returns a slice of key-value pairs in the given range of indices.</p>
) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&mut <aclass="struct"href="struct.Slice.html"title="struct indexmap::map::Slice">Slice</a><K, V>></h4></section></summary><divclass="docblock"><p>Returns a mutable slice of key-value pairs in the given range of indices.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.first_mut"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#1067-1069">source</a><h4class="code-header">pub fn <ahref="#method.first_mut"class="fn">first_mut</a>(&mut self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/option/enum.Option.html"title="enum core::option::Option">Option</a><(<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&K</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&mut V</a>)></h4></section></summary><divclass="docblock"><p>Get the first key-value pair, with mutable access to the value</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.last_mut"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#1081-1083">source</a><h4class="code-header">pub fn <ahref="#method.last_mut"class="fn">last_mut</a>(&mut self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/option/enum.Option.html"title="enum core::option::Option">Option</a><(<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&K</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&mut V</a>)></h4></section></summary><divclass="docblock"><p>Get the last key-value pair, with mutable access to the value</p>
<p>Like <ahref="https://doc.rust-lang.org/1.77.1/alloc/vec/struct.Vec.html#method.swap_remove"title="method alloc::vec::Vec::swap_remove"><code>Vec::swap_remove</code></a>, the pair is removed by swapping it with the
<p>Like <ahref="https://doc.rust-lang.org/1.77.1/alloc/vec/struct.Vec.html#method.remove"title="method alloc::vec::Vec::remove"><code>Vec::remove</code></a>, the pair is removed by shifting all of the
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.move_index"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#1120-1122">source</a><h4class="code-header">pub fn <ahref="#method.move_index"class="fn">move_index</a>(&mut self, from: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>, to: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>)</h4></section></summary><divclass="docblock"><p>Moves the position of a key-value pair from one index to another
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.swap_indices"class="method"><aclass="src rightside"href="../../src/indexmap/map.rs.html#1129-1131">source</a><h4class="code-header">pub fn <ahref="#method.swap_indices"class="fn">swap_indices</a>(&mut self, a: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>, b: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>)</h4></section></summary><divclass="docblock"><p>Swaps the position of two key-value pairs in the map.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.extend_one"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.1/src/core/iter/traits/collect.rs.html#376">source</a><ahref="#method.extend_one"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/core/iter/traits/collect/trait.Extend.html#method.extend_one"class="fn">extend_one</a>(&mut self, item: A)</h4></section></summary><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>extend_one</code>)</span></div></span><divclass='docblock'>Extends a collection with exactly one element.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.extend_reserve"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.1/src/core/iter/traits/collect.rs.html#384">source</a><ahref="#method.extend_reserve"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/core/iter/traits/collect/trait.Extend.html#method.extend_reserve"class="fn">extend_reserve</a>(&mut self, additional: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>)</h4></section></summary><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>extend_one</code>)</span></div></span><divclass='docblock'>Reserves capacity in a collection for the given number of additional elements. <ahref="https://doc.rust-lang.org/1.77.1/core/iter/traits/collect/trait.Extend.html#method.extend_reserve">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Extend%3C(K,+V)%3E-for-IndexMap%3CK,+V,+S%3E"class="impl"><aclass="src rightside"href="../../src/indexmap/map.rs.html#1337-1368">source</a><ahref="#impl-Extend%3C(K,+V)%3E-for-IndexMap%3CK,+V,+S%3E"class="anchor">§</a><h3class="code-header">impl<K, V, S><aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/iter/traits/collect/trait.Extend.html"title="trait core::iter::traits::collect::Extend">Extend</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.tuple.html">(K, V)</a>> for <aclass="struct"href="struct.IndexMap.html"title="struct indexmap::map::IndexMap">IndexMap</a><K, V, S><divclass="where">where
S: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/hash/trait.BuildHasher.html"title="trait core::hash::BuildHasher">BuildHasher</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.extend-1"class="method trait-impl"><aclass="src rightside"href="../../src/indexmap/map.rs.html#1351-1367">source</a><ahref="#method.extend-1"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/core/iter/traits/collect/trait.Extend.html#tymethod.extend"class="fn">extend</a><I: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/iter/traits/collect/trait.IntoIterator.html"title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.tuple.html">(K, V)</a>>>(&mut self, iterable: I)</h4></section></summary><divclass="docblock"><p>Extend the map with all key-value pairs in the iterable.</p>
<p>This is equivalent to calling <ahref="struct.IndexMap.html#method.insert"title="method indexmap::map::IndexMap::insert"><code>insert</code></a> for each of
them in order, which means that for keys that already existed
in the map, their value is updated but it keeps the existing order.</p>
<p>New keys are inserted in the order they appear in the sequence. If
equivalents of a key occur more than once, the last corresponding value
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.extend_one-1"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.1/src/core/iter/traits/collect.rs.html#376">source</a><ahref="#method.extend_one-1"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/core/iter/traits/collect/trait.Extend.html#method.extend_one"class="fn">extend_one</a>(&mut self, item: A)</h4></section></summary><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>extend_one</code>)</span></div></span><divclass='docblock'>Extends a collection with exactly one element.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.extend_reserve-1"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.1/src/core/iter/traits/collect.rs.html#384">source</a><ahref="#method.extend_reserve-1"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/core/iter/traits/collect/trait.Extend.html#method.extend_reserve"class="fn">extend_reserve</a>(&mut self, additional: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>)</h4></section></summary><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>extend_one</code>)</span></div></span><divclass='docblock'>Reserves capacity in a collection for the given number of additional elements. <ahref="https://doc.rust-lang.org/1.77.1/core/iter/traits/collect/trait.Extend.html#method.extend_reserve">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-From%3C%5B(K,+V);+N%5D%3E-for-IndexMap%3CK,+V%3E"class="impl"><aclass="src rightside"href="../../src/indexmap/map.rs.html#1319-1335">source</a><ahref="#impl-From%3C%5B(K,+V);+N%5D%3E-for-IndexMap%3CK,+V%3E"class="anchor">§</a><h3class="code-header">impl<K, V, const N: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>><aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/convert/trait.From.html"title="trait core::convert::From">From</a><[<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.tuple.html">(K, V)</a>; <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.array.html">N</a>]> for <aclass="struct"href="struct.IndexMap.html"title="struct indexmap::map::IndexMap">IndexMap</a><K, V, <aclass="struct"href="https://doc.rust-lang.org/1.77.1/std/hash/random/struct.RandomState.html"title="struct std::hash::random::RandomState">RandomState</a>><divclass="where">where
S: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/hash/trait.BuildHasher.html"title="trait core::hash::BuildHasher">BuildHasher</a> + <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/default/trait.Default.html"title="trait core::default::Default">Default</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.from_iter"class="method trait-impl"><aclass="src rightside"href="../../src/indexmap/map.rs.html#1308-1314">source</a><ahref="#method.from_iter"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/core/iter/traits/collect/trait.FromIterator.html#tymethod.from_iter"class="fn">from_iter</a><I: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/iter/traits/collect/trait.IntoIterator.html"title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.tuple.html">(K, V)</a>>>(iterable: I) -> Self</h4></section></summary><divclass="docblock"><p>Create an <code>IndexMap</code> from the sequence of key-value pairs in the
S: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/hash/trait.BuildHasher.html"title="trait core::hash::BuildHasher">BuildHasher</a>,</div></h3></section></summary><divclass="docblock"><p>Access <ahref="struct.IndexMap.html"title="struct indexmap::map::IndexMap"><code>IndexMap</code></a> values corresponding to a key.</p>
</div><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.index"class="method trait-impl"><aclass="src rightside"href="../../src/indexmap/map.rs.html#1166-1168">source</a><ahref="#method.index"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/core/ops/index/trait.Index.html#tymethod.index"class="fn">index</a>(&self, key: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&Q</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&V</a></h4></section></summary><divclass="docblock"><p>Returns a reference to the value corresponding to the supplied <code>key</code>.</p>
<p>See <ahref="struct.Keys.html#impl-Index%3Cusize%3E-for-Keys%3C'a,+K,+V%3E"title="struct indexmap::map::Keys"><code>Index<usize> for Keys</code></a> to access a map’s keys instead.</p>
</div><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.index-8"class="method trait-impl"><aclass="src rightside"href="../../src/indexmap/map.rs.html#1251-1255">source</a><ahref="#method.index-8"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/core/ops/index/trait.Index.html#tymethod.index"class="fn">index</a>(&self, index: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&V</a></h4></section></summary><divclass="docblock"><p>Returns a reference to the value at the supplied <code>index</code>.</p>
</div></details><detailsclass="toggle"open><summary><sectionid="associatedtype.Output-8"class="associatedtype trait-impl"><ahref="#associatedtype.Output-8"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.77.1/core/ops/index/trait.Index.html#associatedtype.Output"class="associatedtype">Output</a> = V</h4></section></summary><divclass='docblock'>The returned type after indexing.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-IndexMut%3C%26Q%3E-for-IndexMap%3CK,+V,+S%3E"class="impl"><aclass="src rightside"href="../../src/indexmap/map.rs.html#1200-1211">source</a><ahref="#impl-IndexMut%3C%26Q%3E-for-IndexMap%3CK,+V,+S%3E"class="anchor">§</a><h3class="code-header">impl<K, V, Q, S><aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/ops/index/trait.IndexMut.html"title="trait core::ops::index::IndexMut">IndexMut</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&Q</a>> for <aclass="struct"href="struct.IndexMap.html"title="struct indexmap::map::IndexMap">IndexMap</a><K, V, S><divclass="where">where
S: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/hash/trait.BuildHasher.html"title="trait core::hash::BuildHasher">BuildHasher</a>,</div></h3></section></summary><divclass="docblock"><p>Access <ahref="struct.IndexMap.html"title="struct indexmap::map::IndexMap"><code>IndexMap</code></a> values corresponding to a key.</p>
</div><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.index_mut-8"class="method trait-impl"><aclass="src rightside"href="../../src/indexmap/map.rs.html#1208-1210">source</a><ahref="#method.index_mut-8"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/core/ops/index/trait.IndexMut.html#tymethod.index_mut"class="fn">index_mut</a>(&mut self, key: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&Q</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&mut V</a></h4></section></summary><divclass="docblock"><p>Returns a mutable reference to the value corresponding to the supplied <code>key</code>.</p>
<p>You can <strong>not</strong> insert new values with index syntax – use <ahref="struct.IndexMap.html#method.insert"title="method indexmap::map::IndexMap::insert"><code>.insert()</code></a>.</p>
</div><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.index_mut-3"class="method trait-impl"><aclass="src rightside"href="../../src/indexmap/map.rs.html#1291-1295">source</a><ahref="#method.index_mut-3"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/core/ops/index/trait.IndexMut.html#tymethod.index_mut"class="fn">index_mut</a>(&mut self, index: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&mut V</a></h4></section></summary><divclass="docblock"><p>Returns a mutable reference to the value at the supplied <code>index</code>.</p>
Q: ?<aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a> + <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/hash/trait.Hash.html"title="trait core::hash::Hash">Hash</a> + <aclass="trait"href="../trait.Equivalent.html"title="trait indexmap::Equivalent">Equivalent</a><K>,</div></h4></section></summary><divclass='docblock'>Return item index, mutable reference to key and value <ahref="trait.MutableKeys.html#tymethod.get_full_mut2">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get_index_mut2"class="method trait-impl"><aclass="src rightside"href="../../src/indexmap/map/mutable.rs.html#71-73">source</a><ahref="#method.get_index_mut2"class="anchor">§</a><h4class="code-header">fn <ahref="trait.MutableKeys.html#tymethod.get_index_mut2"class="fn">get_index_mut2</a>(&mut self, index: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/option/enum.Option.html"title="enum core::option::Option">Option</a><(<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&mut K</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&mut V</a>)></h4></section></summary><divclass='docblock'>Return mutable reference to key and value at an index. <ahref="trait.MutableKeys.html#tymethod.get_index_mut2">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.retain2"class="method trait-impl"><aclass="src rightside"href="../../src/indexmap/map/mutable.rs.html#75-80">source</a><ahref="#method.retain2"class="anchor">§</a><h4class="code-header">fn <ahref="trait.MutableKeys.html#tymethod.retain2"class="fn">retain2</a><F>(&mut self, keep: F)<divclass="where">where
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&mut K</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&mut V</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.bool.html">bool</a>,</div></h4></section></summary><divclass='docblock'>Scan through each key-value pair in the map and keep those where the
S2: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/hash/trait.BuildHasher.html"title="trait core::hash::BuildHasher">BuildHasher</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq"class="method trait-impl"><aclass="src rightside"href="../../src/indexmap/map.rs.html#1401-1408">source</a><ahref="#method.eq"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/core/cmp/trait.PartialEq.html#tymethod.eq"class="fn">eq</a>(&self, other: &<aclass="struct"href="struct.IndexMap.html"title="struct indexmap::map::IndexMap">IndexMap</a><K, V2, S2>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.1/src/core/cmp.rs.html#242">source</a></span><ahref="#method.ne"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/core/cmp/trait.PartialEq.html#method.ne"class="fn">ne</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&Rhs</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-RawEntryApiV1%3CK,+V,+S%3E-for-IndexMap%3CK,+V,+S%3E"class="impl"><aclass="src rightside"href="../../src/indexmap/map/core/raw_entry_v1.rs.html#175-183">source</a><ahref="#impl-RawEntryApiV1%3CK,+V,+S%3E-for-IndexMap%3CK,+V,+S%3E"class="anchor">§</a><h3class="code-header">impl<K, V, S><aclass="trait"href="raw_entry_v1/trait.RawEntryApiV1.html"title="trait indexmap::map::raw_entry_v1::RawEntryApiV1">RawEntryApiV1</a><K, V, S> for <aclass="struct"href="struct.IndexMap.html"title="struct indexmap::map::IndexMap">IndexMap</a><K, V, S></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.raw_entry_v1"class="method trait-impl"><aclass="src rightside"href="../../src/indexmap/map/core/raw_entry_v1.rs.html#176-178">source</a><ahref="#method.raw_entry_v1"class="anchor">§</a><h4class="code-header">fn <ahref="raw_entry_v1/trait.RawEntryApiV1.html#tymethod.raw_entry_v1"class="fn">raw_entry_v1</a>(&self) -><aclass="struct"href="raw_entry_v1/struct.RawEntryBuilder.html"title="struct indexmap::map::raw_entry_v1::RawEntryBuilder">RawEntryBuilder</a><'_, K, V, S></h4></section></summary><divclass='docblock'>Creates a raw immutable entry builder for the <ahref="struct.IndexMap.html"title="struct indexmap::map::IndexMap"><code>IndexMap</code></a>. <ahref="raw_entry_v1/trait.RawEntryApiV1.html#tymethod.raw_entry_v1">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.raw_entry_mut_v1"class="method trait-impl"><aclass="src rightside"href="../../src/indexmap/map/core/raw_entry_v1.rs.html#180-182">source</a><ahref="#method.raw_entry_mut_v1"class="anchor">§</a><h4class="code-header">fn <ahref="raw_entry_v1/trait.RawEntryApiV1.html#tymethod.raw_entry_mut_v1"class="fn">raw_entry_mut_v1</a>(&mut self) -><aclass="struct"href="raw_entry_v1/struct.RawEntryBuilderMut.html"title="struct indexmap::map::raw_entry_v1::RawEntryBuilderMut">RawEntryBuilderMut</a><'_, K, V, S></h4></section></summary><divclass='docblock'>Creates a raw entry builder for the <ahref="struct.IndexMap.html"title="struct indexmap::map::IndexMap"><code>IndexMap</code></a>. <ahref="raw_entry_v1/trait.RawEntryApiV1.html#tymethod.raw_entry_mut_v1">Read more</a></div></details></div></details><sectionid="impl-Eq-for-IndexMap%3CK,+V,+S%3E"class="impl"><aclass="src rightside"href="../../src/indexmap/map.rs.html#1411-1417">source</a><ahref="#impl-Eq-for-IndexMap%3CK,+V,+S%3E"class="anchor">§</a><h3class="code-header">impl<K, V, S><aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/cmp/trait.Eq.html"title="trait core::cmp::Eq">Eq</a> for <aclass="struct"href="struct.IndexMap.html"title="struct indexmap::map::IndexMap">IndexMap</a><K, V, S><divclass="where">where
K: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/borrow/trait.Borrow.html"title="trait core::borrow::Borrow">Borrow</a><Q> + ?<aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.equivalent"class="method trait-impl"><aclass="src rightside"href="../../src/hashbrown/lib.rs.html#170">source</a><ahref="#method.equivalent"class="anchor">§</a><h4class="code-header">fn <ahref="../../hashbrown/trait.Equivalent.html#tymethod.equivalent"class="fn">equivalent</a>(&self, key: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&K</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>Checks if this value is equivalent to the given key. <ahref="../../hashbrown/trait.Equivalent.html#tymethod.equivalent">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-Equivalent%3CK%3E-for-Q-1"class="impl"><aclass="src rightside"href="../../src/equivalent/lib.rs.html#82-85">source</a><ahref="#impl-Equivalent%3CK%3E-for-Q-1"class="anchor">§</a><h3class="code-header">impl<Q, K><aclass="trait"href="../trait.Equivalent.html"title="trait indexmap::Equivalent">Equivalent</a><K> for Q<divclass="where">where
<code><ahref="https://doc.rust-lang.org/1.77.1/core/convert/trait.From.html"title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-ToOwned-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.1/src/alloc/borrow.rs.html#83-85">source</a><ahref="#impl-ToOwned-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.77.1/alloc/borrow/trait.ToOwned.html"title="trait alloc::borrow::ToOwned">ToOwned</a> for T<divclass="where">where
T: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Owned"class="associatedtype trait-impl"><ahref="#associatedtype.Owned"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.77.1/alloc/borrow/trait.ToOwned.html#associatedtype.Owned"class="associatedtype">Owned</a> = T</h4></section></summary><divclass='docblock'>The resulting type after obtaining ownership.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.to_owned"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.1/src/alloc/borrow.rs.html#88">source</a><ahref="#method.to_owned"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/alloc/borrow/trait.ToOwned.html#tymethod.to_owned"class="fn">to_owned</a>(&self) -> T</h4></section></summary><divclass='docblock'>Creates owned data from borrowed data, usually by cloning. <ahref="https://doc.rust-lang.org/1.77.1/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.clone_into"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.1/src/alloc/borrow.rs.html#92">source</a><ahref="#method.clone_into"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/alloc/borrow/trait.ToOwned.html#method.clone_into"class="fn">clone_into</a>(&self, target: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&mut T</a>)</h4></section></summary><divclass='docblock'>Uses borrowed data to replace owned data, usually by cloning. <ahref="https://doc.rust-lang.org/1.77.1/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-TryFrom%3CU%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.1/src/core/convert/mod.rs.html#804-806">source</a><ahref="#impl-TryFrom%3CU%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U> for T<divclass="where">where
U: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Error-1"class="associatedtype trait-impl"><ahref="#associatedtype.Error-1"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryFrom.html#associatedtype.Error"class="associatedtype">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/convert/enum.Infallible.html"title="enum core::convert::Infallible">Infallible</a></h4></section></summary><divclass='docblock'>The type returned in the event of a conversion error.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.try_from"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.1/src/core/convert/mod.rs.html#811">source</a><ahref="#method.try_from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryFrom.html#tymethod.try_from"class="fn">try_from</a>(value: U) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/result/enum.Result.html"title="enum core::result::Result">Result</a><T, <T as <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><divclass='docblock'>Performs the conversion.</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-TryInto%3CU%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.1/src/core/convert/mod.rs.html#789-791">source</a><ahref="#impl-TryInto%3CU%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><U> for T<divclass="where">where
U: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Error"class="associatedtype trait-impl"><ahref="#associatedtype.Error"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryInto.html#associatedtype.Error"class="associatedtype">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><divclass='docblock'>The type returned in the event of a conversion error.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.try_into"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.1/src/core/convert/mod.rs.html#796">source</a><ahref="#method.try_into"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryInto.html#tymethod.try_into"class="fn">try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/result/enum.Result.html"title="enum core::result::Result">Result</a><U, <U as <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><divclass='docblock'>Performs the conversion.</div></details></div></details></div><scripttype="text/json"id="notable-traits-data">{"Drain<'_,K,V>":"<h3>Notabletraitsfor<code><aclass=\"struct\"href=\"struct.Drain.html\"title=\"structindexmap::map::Drain\">Drain</a><'_,K,V></code></h3><pre><code><divclass=\"where\">impl<K,V><aclass=\"trait\"href=\"https://doc.rust-lang.org/1.77.1/core/iter/traits/iterator/trait.Iterator.html\"title=\"traitcore::iter::traits::iterator::Iterator\">Iterator</a>for<aclass=\"struct\"href=\"struct.Drain.html\"title=\"structindexmap::map::Drain\">Drain</a><'_,K,V></div><divclass=\"where\">type<ahref=\"https://doc.rust-lang.org/1.77.1/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\"class=\"associatedtype\">Item</a>=<aclass=\"primitive\"href=\"https://doc.rust-lang.org/1.77.1/std/primitive.tuple.html\">(K,V)</a>;</div>","IntoIter<K,V>":"<h3>Notabletraitsfor<code><aclass=\"struct\"href=\"struct.IntoIter.html\"title=\"structindexmap::map::IntoIter\">IntoIter</a><K,V></code></h3><pre><code><divclass=\"where\">impl<K,V><aclass=\"trait\"href=\"https://doc.rust-lang.org/1.77.1/core/iter/traits/iterator/trait.Iterator.html\"title=\"traitcore::iter::traits::iterator::Iterator\">Iterator</a>for<aclass=\"struct\"href=\"struct.IntoIter.html\"title=\"structindexmap::map::IntoIter\">IntoIter</a><K,V></div><divclass=\"where\">type<ahref=\"https://doc.rust-lang.org/1.77.1/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\"class=\"associatedtype\">Item</a>=<aclass=\"primitive\"href=\"https://doc.rust-lang.org/1.77.1/std/primitive.tuple.html\">(K,V)</a>;</div>","IntoKeys<K,V>":"<h3>Notabletraitsfor<code><aclass=\"struct\"href=\"struct.IntoKeys.html\"title=\"structindexmap::map::IntoKeys\">IntoKeys</a><K,V></code></h3><pre><code><divclass=\"where\">impl<K,V><aclass=\"trait\"href=\"https://doc.rust-lang.org/1.77.1/core/iter/traits/iterator/trait.Iterator.html\"title=\"traitcore::iter::traits::iterator::Iterator\">Iterator</a>for<aclass=\"struct\"href=\"struct.IntoKeys.html\"title