rtic/2/api/indexmap/map/struct.IndexMap.html
2024-12-06 13:35:18 +00:00

675 lines
No EOL
239 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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 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><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">2.7.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Index<wbr>Map</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.append" title="append">append</a></li><li><a href="#method.as_mut_slice" title="as_mut_slice">as_mut_slice</a></li><li><a href="#method.as_slice" title="as_slice">as_slice</a></li><li><a href="#method.binary_search_by" title="binary_search_by">binary_search_by</a></li><li><a href="#method.binary_search_by_key" title="binary_search_by_key">binary_search_by_key</a></li><li><a href="#method.binary_search_keys" title="binary_search_keys">binary_search_keys</a></li><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_key" title="contains_key">contains_key</a></li><li><a href="#method.drain" title="drain">drain</a></li><li><a href="#method.entry" title="entry">entry</a></li><li><a href="#method.first" title="first">first</a></li><li><a href="#method.first_entry" title="first_entry">first_entry</a></li><li><a href="#method.first_mut" title="first_mut">first_mut</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_full_mut" title="get_full_mut">get_full_mut</a></li><li><a href="#method.get_index" title="get_index">get_index</a></li><li><a href="#method.get_index_entry" title="get_index_entry">get_index_entry</a></li><li><a href="#method.get_index_mut" title="get_index_mut">get_index_mut</a></li><li><a href="#method.get_index_of" title="get_index_of">get_index_of</a></li><li><a href="#method.get_key_value" title="get_key_value">get_key_value</a></li><li><a href="#method.get_mut" title="get_mut">get_mut</a></li><li><a href="#method.get_range" title="get_range">get_range</a></li><li><a href="#method.get_range_mut" title="get_range_mut">get_range_mut</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_before" title="insert_before">insert_before</a></li><li><a href="#method.insert_full" title="insert_full">insert_full</a></li><li><a href="#method.insert_sorted" title="insert_sorted">insert_sorted</a></li><li><a href="#method.into_boxed_slice" title="into_boxed_slice">into_boxed_slice</a></li><li><a href="#method.into_keys" title="into_keys">into_keys</a></li><li><a href="#method.into_values" title="into_values">into_values</a></li><li><a href="#method.is_empty" title="is_empty">is_empty</a></li><li><a href="#method.iter" title="iter">iter</a></li><li><a href="#method.iter_mut" title="iter_mut">iter_mut</a></li><li><a href="#method.keys" title="keys">keys</a></li><li><a href="#method.last" title="last">last</a></li><li><a href="#method.last_entry" title="last_entry">last_entry</a></li><li><a href="#method.last_mut" title="last_mut">last_mut</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.partition_point" title="partition_point">partition_point</a></li><li><a href="#method.pop" title="pop">pop</a></li><li><a href="#method.remove" title="remove">remove</a></li><li><a href="#method.remove_entry" title="remove_entry">remove_entry</a></li><li><a href="#method.reserve" title="reserve">reserve</a></li><li><a href="#method.reserve_exact" title="reserve_exact">reserve_exact</a></li><li><a href="#method.retain" title="retain">retain</a></li><li><a href="#method.reverse" title="reverse">reverse</a></li><li><a href="#method.shift_insert" title="shift_insert">shift_insert</a></li><li><a href="#method.shift_remove" title="shift_remove">shift_remove</a></li><li><a href="#method.shift_remove_entry" title="shift_remove_entry">shift_remove_entry</a></li><li><a href="#method.shift_remove_full" title="shift_remove_full">shift_remove_full</a></li><li><a href="#method.shift_remove_index" title="shift_remove_index">shift_remove_index</a></li><li><a href="#method.shrink_to" title="shrink_to">shrink_to</a></li><li><a href="#method.shrink_to_fit" title="shrink_to_fit">shrink_to_fit</a></li><li><a href="#method.sort_by" title="sort_by">sort_by</a></li><li><a href="#method.sort_by_cached_key" title="sort_by_cached_key">sort_by_cached_key</a></li><li><a href="#method.sort_keys" title="sort_keys">sort_keys</a></li><li><a href="#method.sort_unstable_by" title="sort_unstable_by">sort_unstable_by</a></li><li><a href="#method.sort_unstable_keys" title="sort_unstable_keys">sort_unstable_keys</a></li><li><a href="#method.sorted_by" title="sorted_by">sorted_by</a></li><li><a href="#method.sorted_unstable_by" title="sorted_unstable_by">sorted_unstable_by</a></li><li><a href="#method.splice" title="splice">splice</a></li><li><a href="#method.split_off" title="split_off">split_off</a></li><li><a href="#method.swap_indices" title="swap_indices">swap_indices</a></li><li><a href="#method.swap_remove" title="swap_remove">swap_remove</a></li><li><a href="#method.swap_remove_entry" title="swap_remove_entry">swap_remove_entry</a></li><li><a href="#method.swap_remove_full" title="swap_remove_full">swap_remove_full</a></li><li><a href="#method.swap_remove_index" title="swap_remove_index">swap_remove_index</a></li><li><a href="#method.truncate" title="truncate">truncate</a></li><li><a href="#method.try_reserve" title="try_reserve">try_reserve</a></li><li><a href="#method.try_reserve_exact" title="try_reserve_exact">try_reserve_exact</a></li><li><a href="#method.values" title="values">values</a></li><li><a href="#method.values_mut" title="values_mut">values_mut</a></li><li><a href="#method.with_capacity" title="with_capacity">with_capacity</a></li><li><a href="#method.with_capacity_and_hasher" title="with_capacity_and_hasher">with_capacity_and_hasher</a></li><li><a href="#method.with_hasher" title="with_hasher">with_hasher</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Clone-for-IndexMap%3CK,+V,+S%3E" title="Clone">Clone</a></li><li><a href="#impl-Debug-for-IndexMap%3CK,+V,+S%3E" title="Debug">Debug</a></li><li><a href="#impl-Default-for-IndexMap%3CK,+V,+S%3E" title="Default">Default</a></li><li><a href="#impl-Eq-for-IndexMap%3CK,+V,+S%3E" title="Eq">Eq</a></li><li><a href="#impl-Extend%3C(%26K,+%26V)%3E-for-IndexMap%3CK,+V,+S%3E" title="Extend&#60;(&#38;&#39;a K, &#38;&#39;a V)&#62;">Extend&#60;(&#38;&#39;a K, &#38;&#39;a V)&#62;</a></li><li><a href="#impl-Extend%3C(K,+V)%3E-for-IndexMap%3CK,+V,+S%3E" title="Extend&#60;(K, V)&#62;">Extend&#60;(K, V)&#62;</a></li><li><a href="#impl-From%3C%5B(K,+V);+N%5D%3E-for-IndexMap%3CK,+V%3E" title="From&#60;[(K, V); N]&#62;">From&#60;[(K, V); N]&#62;</a></li><li><a href="#impl-FromIterator%3C(K,+V)%3E-for-IndexMap%3CK,+V,+S%3E" title="FromIterator&#60;(K, V)&#62;">FromIterator&#60;(K, V)&#62;</a></li><li><a href="#impl-Index%3C%26Q%3E-for-IndexMap%3CK,+V,+S%3E" title="Index&#60;&#38;Q&#62;">Index&#60;&#38;Q&#62;</a></li><li><a href="#impl-Index%3C(Bound%3Cusize%3E,+Bound%3Cusize%3E)%3E-for-IndexMap%3CK,+V,+S%3E" title="Index&#60;(Bound&#60;usize&#62;, Bound&#60;usize&#62;)&#62;">Index&#60;(Bound&#60;usize&#62;, Bound&#60;usize&#62;)&#62;</a></li><li><a href="#impl-Index%3CRange%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" title="Index&#60;Range&#60;usize&#62;&#62;">Index&#60;Range&#60;usize&#62;&#62;</a></li><li><a href="#impl-Index%3CRangeFrom%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" title="Index&#60;RangeFrom&#60;usize&#62;&#62;">Index&#60;RangeFrom&#60;usize&#62;&#62;</a></li><li><a href="#impl-Index%3CRangeFull%3E-for-IndexMap%3CK,+V,+S%3E" title="Index&#60;RangeFull&#62;">Index&#60;RangeFull&#62;</a></li><li><a href="#impl-Index%3CRangeInclusive%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" title="Index&#60;RangeInclusive&#60;usize&#62;&#62;">Index&#60;RangeInclusive&#60;usize&#62;&#62;</a></li><li><a href="#impl-Index%3CRangeTo%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" title="Index&#60;RangeTo&#60;usize&#62;&#62;">Index&#60;RangeTo&#60;usize&#62;&#62;</a></li><li><a href="#impl-Index%3CRangeToInclusive%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" title="Index&#60;RangeToInclusive&#60;usize&#62;&#62;">Index&#60;RangeToInclusive&#60;usize&#62;&#62;</a></li><li><a href="#impl-Index%3Cusize%3E-for-IndexMap%3CK,+V,+S%3E" title="Index&#60;usize&#62;">Index&#60;usize&#62;</a></li><li><a href="#impl-IndexMut%3C%26Q%3E-for-IndexMap%3CK,+V,+S%3E" title="IndexMut&#60;&#38;Q&#62;">IndexMut&#60;&#38;Q&#62;</a></li><li><a href="#impl-IndexMut%3C(Bound%3Cusize%3E,+Bound%3Cusize%3E)%3E-for-IndexMap%3CK,+V,+S%3E" title="IndexMut&#60;(Bound&#60;usize&#62;, Bound&#60;usize&#62;)&#62;">IndexMut&#60;(Bound&#60;usize&#62;, Bound&#60;usize&#62;)&#62;</a></li><li><a href="#impl-IndexMut%3CRange%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" title="IndexMut&#60;Range&#60;usize&#62;&#62;">IndexMut&#60;Range&#60;usize&#62;&#62;</a></li><li><a href="#impl-IndexMut%3CRangeFrom%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" title="IndexMut&#60;RangeFrom&#60;usize&#62;&#62;">IndexMut&#60;RangeFrom&#60;usize&#62;&#62;</a></li><li><a href="#impl-IndexMut%3CRangeFull%3E-for-IndexMap%3CK,+V,+S%3E" title="IndexMut&#60;RangeFull&#62;">IndexMut&#60;RangeFull&#62;</a></li><li><a href="#impl-IndexMut%3CRangeInclusive%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" title="IndexMut&#60;RangeInclusive&#60;usize&#62;&#62;">IndexMut&#60;RangeInclusive&#60;usize&#62;&#62;</a></li><li><a href="#impl-IndexMut%3CRangeTo%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" title="IndexMut&#60;RangeTo&#60;usize&#62;&#62;">IndexMut&#60;RangeTo&#60;usize&#62;&#62;</a></li><li><a href="#impl-IndexMut%3CRangeToInclusive%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" title="IndexMut&#60;RangeToInclusive&#60;usize&#62;&#62;">IndexMut&#60;RangeToInclusive&#60;usize&#62;&#62;</a></li><li><a href="#impl-IndexMut%3Cusize%3E-for-IndexMap%3CK,+V,+S%3E" title="IndexMut&#60;usize&#62;">IndexMut&#60;usize&#62;</a></li><li><a href="#impl-IntoIterator-for-%26IndexMap%3CK,+V,+S%3E" title="IntoIterator">IntoIterator</a></li><li><a href="#impl-IntoIterator-for-%26mut+IndexMap%3CK,+V,+S%3E" title="IntoIterator">IntoIterator</a></li><li><a href="#impl-IntoIterator-for-IndexMap%3CK,+V,+S%3E" title="IntoIterator">IntoIterator</a></li><li><a href="#impl-MutableKeys-for-IndexMap%3CK,+V,+S%3E" title="MutableKeys">MutableKeys</a></li><li><a href="#impl-PartialEq%3CIndexMap%3CK,+V2,+S2%3E%3E-for-IndexMap%3CK,+V1,+S1%3E" title="PartialEq&#60;IndexMap&#60;K, V2, S2&#62;&#62;">PartialEq&#60;IndexMap&#60;K, V2, S2&#62;&#62;</a></li><li><a href="#impl-RawEntryApiV1%3CK,+V,+S%3E-for-IndexMap%3CK,+V,+S%3E" title="RawEntryApiV1&#60;K, V, S&#62;">RawEntryApiV1&#60;K, V, S&#62;</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-IndexMap%3CK,+V,+S%3E" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-IndexMap%3CK,+V,+S%3E" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-IndexMap%3CK,+V,+S%3E" title="Send">Send</a></li><li><a href="#impl-Sync-for-IndexMap%3CK,+V,+S%3E" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-IndexMap%3CK,+V,+S%3E" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-IndexMap%3CK,+V,+S%3E" title="UnwindSafe">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow&#60;T&#62;">Borrow&#60;T&#62;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut&#60;T&#62;">BorrowMut&#60;T&#62;</a></li><li><a href="#impl-CloneToUninit-for-T" title="CloneToUninit">CloneToUninit</a></li><li><a href="#impl-Equivalent%3CK%3E-for-Q" title="Equivalent&#60;K&#62;">Equivalent&#60;K&#62;</a></li><li><a href="#impl-Equivalent%3CK%3E-for-Q-1" title="Equivalent&#60;K&#62;">Equivalent&#60;K&#62;</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From&#60;T&#62;">From&#60;T&#62;</a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into&#60;U&#62;">Into&#60;U&#62;</a></li><li><a href="#impl-ToOwned-for-T" title="ToOwned">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom&#60;U&#62;">TryFrom&#60;U&#62;</a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto&#60;U&#62;">TryInto&#60;U&#62;</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In indexmap::<wbr>map</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">indexmap</a>::<wbr><a href="index.html">map</a></span><h1>Struct <span class="struct">IndexMap</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/indexmap/map.rs.html#87-90">source</a> </span></div><pre class="rust item-decl"><code>pub struct IndexMap&lt;K, V, S = <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>&gt; { <span class="comment">/* private fields */</span> }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A hash table where the iteration order of the key-value pairs is independent
of the hash values of the keys.</p>
<p>The interface is closely compatible with the standard
<a href="https://doc.rust-lang.org/1.83.0/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap"><code>HashMap</code></a>,
but also has additional features.</p>
<h2 id="order"><a class="doc-anchor" href="#order">§</a>Order</h2>
<p>The key-value pairs have a consistent order that is determined by
the sequence of insertion and removal calls on the map. The order does
not depend on the keys or the hash function at all.</p>
<p>All iterators traverse the map in <em>the order</em>.</p>
<p>The insertion order is preserved, with <strong>notable exceptions</strong> like the
<a href="struct.IndexMap.html#method.remove" title="method indexmap::map::IndexMap::remove"><code>.remove()</code></a> or <a href="struct.IndexMap.html#method.swap_remove" title="method indexmap::map::IndexMap::swap_remove"><code>.swap_remove()</code></a> methods.
Methods such as <a href="struct.IndexMap.html#method.sort_by" title="method indexmap::map::IndexMap::sort_by"><code>.sort_by()</code></a> 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 key-value pairs 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 key, and the method <code>.get_index</code> looks up the key-value pair 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::IndexMap;
<span class="comment">// count the frequency of each letter in a sentence.
</span><span class="kw">let </span><span class="kw-2">mut </span>letters = IndexMap::new();
<span class="kw">for </span>ch <span class="kw">in </span><span class="string">"a short treatise on fungi"</span>.chars() {
<span class="kw-2">*</span>letters.entry(ch).or_insert(<span class="number">0</span>) += <span class="number">1</span>;
}
<span class="macro">assert_eq!</span>(letters[<span class="kw-2">&amp;</span><span class="string">'s'</span>], <span class="number">2</span>);
<span class="macro">assert_eq!</span>(letters[<span class="kw-2">&amp;</span><span class="string">'t'</span>], <span class="number">3</span>);
<span class="macro">assert_eq!</span>(letters[<span class="kw-2">&amp;</span><span class="string">'u'</span>], <span class="number">1</span>);
<span class="macro">assert_eq!</span>(letters.get(<span class="kw-2">&amp;</span><span class="string">'y'</span>), <span class="prelude-val">None</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-IndexMap%3CK,+V%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#163-178">source</a><a href="#impl-IndexMap%3CK,+V%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V&gt; <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V&gt;</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/map.rs.html#166-168">source</a><h4 class="code-header">pub fn <a href="#method.new" class="fn">new</a>() -&gt; Self</h4></section></summary><div class="docblock"><p>Create a new map. (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/map.rs.html#175-177">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>) -&gt; Self</h4></section></summary><div class="docblock"><p>Create a new map with capacity for <code>n</code> key-value pairs. (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-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#180-377">source</a><a href="#impl-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</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/map.rs.html#186-195">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) -&gt; Self</h4></section></summary><div class="docblock"><p>Create a new map with capacity for <code>n</code> key-value pairs. (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/map.rs.html#201-206">source</a><h4 class="code-header">pub const fn <a href="#method.with_hasher" class="fn">with_hasher</a>(hash_builder: S) -&gt; Self</h4></section></summary><div class="docblock"><p>Create a new map 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/map.rs.html#214-216">source</a><h4 class="code-header">pub fn <a href="#method.capacity" class="fn">capacity</a>(&amp;self) -&gt; <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 the map can hold without reallocating.</p>
<p>This number is a lower bound; the map might be able to hold more,
but is guaranteed to be able to hold at least this many.</p>
<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/map.rs.html#219-221">source</a><h4 class="code-header">pub fn <a href="#method.hasher" class="fn">hasher</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;S</a></h4></section></summary><div class="docblock"><p>Return a reference to the maps <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/map.rs.html#227-229">source</a><h4 class="code-header">pub fn <a href="#method.len" class="fn">len</a>(&amp;self) -&gt; <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 key-value pairs in the map.</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/map.rs.html#235-237">source</a><h4 class="code-header">pub fn <a href="#method.is_empty" class="fn">is_empty</a>(&amp;self) -&gt; <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 map 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/map.rs.html#240-242">source</a><h4 class="code-header">pub fn <a href="#method.iter" class="fn">iter</a>(&amp;self) -&gt; <a class="struct" href="struct.Iter.html" title="struct indexmap::map::Iter">Iter</a>&lt;'_, K, V&gt; <a href="#" class="tooltip" data-notable-ty="Iter&lt;&#39;_, K, V&gt;"></a></h4></section></summary><div class="docblock"><p>Return an iterator over the key-value pairs of the map, in their order</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.iter_mut" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#245-247">source</a><h4 class="code-header">pub fn <a href="#method.iter_mut" class="fn">iter_mut</a>(&amp;mut self) -&gt; <a class="struct" href="struct.IterMut.html" title="struct indexmap::map::IterMut">IterMut</a>&lt;'_, K, V&gt; <a href="#" class="tooltip" data-notable-ty="IterMut&lt;&#39;_, K, V&gt;"></a></h4></section></summary><div class="docblock"><p>Return an iterator over the key-value pairs of the map, in their order</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.keys" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#250-252">source</a><h4 class="code-header">pub fn <a href="#method.keys" class="fn">keys</a>(&amp;self) -&gt; <a class="struct" href="struct.Keys.html" title="struct indexmap::map::Keys">Keys</a>&lt;'_, K, V&gt; <a href="#" class="tooltip" data-notable-ty="Keys&lt;&#39;_, K, V&gt;"></a></h4></section></summary><div class="docblock"><p>Return an iterator over the keys of the map, in their order</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.into_keys" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#255-257">source</a><h4 class="code-header">pub fn <a href="#method.into_keys" class="fn">into_keys</a>(self) -&gt; <a class="struct" href="struct.IntoKeys.html" title="struct indexmap::map::IntoKeys">IntoKeys</a>&lt;K, V&gt; <a href="#" class="tooltip" data-notable-ty="IntoKeys&lt;K, V&gt;"></a></h4></section></summary><div class="docblock"><p>Return an owning iterator over the keys of the map, in their order</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.values" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#260-262">source</a><h4 class="code-header">pub fn <a href="#method.values" class="fn">values</a>(&amp;self) -&gt; <a class="struct" href="struct.Values.html" title="struct indexmap::map::Values">Values</a>&lt;'_, K, V&gt; <a href="#" class="tooltip" data-notable-ty="Values&lt;&#39;_, K, V&gt;"></a></h4></section></summary><div class="docblock"><p>Return an iterator over the values of the map, in their order</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.values_mut" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#266-268">source</a><h4 class="code-header">pub fn <a href="#method.values_mut" class="fn">values_mut</a>(&amp;mut self) -&gt; <a class="struct" href="struct.ValuesMut.html" title="struct indexmap::map::ValuesMut">ValuesMut</a>&lt;'_, K, V&gt; <a href="#" class="tooltip" data-notable-ty="ValuesMut&lt;&#39;_, K, V&gt;"></a></h4></section></summary><div class="docblock"><p>Return an iterator over mutable references to the values of the map,
in their order</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.into_values" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#271-273">source</a><h4 class="code-header">pub fn <a href="#method.into_values" class="fn">into_values</a>(self) -&gt; <a class="struct" href="struct.IntoValues.html" title="struct indexmap::map::IntoValues">IntoValues</a>&lt;K, V&gt; <a href="#" class="tooltip" data-notable-ty="IntoValues&lt;K, V&gt;"></a></h4></section></summary><div class="docblock"><p>Return an owning iterator over the values of the map, 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/map.rs.html#278-280">source</a><h4 class="code-header">pub fn <a href="#method.clear" class="fn">clear</a>(&amp;mut self)</h4></section></summary><div class="docblock"><p>Remove all key-value pairs in the map, 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/map.rs.html#285-287">source</a><h4 class="code-header">pub fn <a href="#method.truncate" class="fn">truncate</a>(&amp;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 map, keeping the first <code>len</code> elements and dropping the rest.</p>
<p>If <code>len</code> is greater than the maps 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/map.rs.html#302-307">source</a><h4 class="code-header">pub fn <a href="#method.drain" class="fn">drain</a>&lt;R&gt;(&amp;mut self, range: R) -&gt; <a class="struct" href="struct.Drain.html" title="struct indexmap::map::Drain">Drain</a>&lt;'_, K, V&gt; <a href="#" class="tooltip" data-notable-ty="Drain&lt;&#39;_, K, V&gt;"></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>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;,</div></h4></section></summary><div class="docblock"><p>Clears the <code>IndexMap</code> in the given index range, returning those
key-value pairs as a drain iterator.</p>
<p>The range may be any type that implements <a href="https://doc.rust-lang.org/1.83.0/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds"><code>RangeBounds&lt;usize&gt;</code></a>,
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 map entirely, use <code>RangeFull</code>
like <code>map.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 map.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.split_off" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#316-324">source</a><h4 class="code-header">pub fn <a href="#method.split_off" class="fn">split_off</a>(&amp;mut self, at: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>) -&gt; 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 map containing the elements in the range
<code>[at, len)</code>. After the call, the original map will be left containing
the elements <code>[0, at)</code> with its previous capacity unchanged.</p>
<p><em><strong>Panics</strong></em> if <code>at &gt; len</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.reserve" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#329-331">source</a><h4 class="code-header">pub fn <a href="#method.reserve" class="fn">reserve</a>(&amp;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 key-value pairs.</p>
<p>Computes in <strong>O(n)</strong> time.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.reserve_exact" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#341-343">source</a><h4 class="code-header">pub fn <a href="#method.reserve_exact" class="fn">reserve_exact</a>(&amp;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 key-value pairs, without over-allocating.</p>
<p>Unlike <code>reserve</code>, this does not deliberately over-allocate the entry capacity to avoid
frequent re-allocations. However, the underlying data structures may still have internal
capacity requirements, and the allocator itself may give more space than requested, so this
cannot be relied upon to be precisely minimal.</p>
<p>Computes in <strong>O(n)</strong> time.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.try_reserve" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#348-350">source</a><h4 class="code-header">pub fn <a href="#method.try_reserve" class="fn">try_reserve</a>(&amp;mut self, additional: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.unit.html">()</a>, <a class="struct" href="../struct.TryReserveError.html" title="struct indexmap::TryReserveError">TryReserveError</a>&gt;</h4></section></summary><div class="docblock"><p>Try to reserve capacity for <code>additional</code> more key-value pairs.</p>
<p>Computes in <strong>O(n)</strong> time.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.try_reserve_exact" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#360-362">source</a><h4 class="code-header">pub fn <a href="#method.try_reserve_exact" class="fn">try_reserve_exact</a>(
&amp;mut self,
additional: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.unit.html">()</a>, <a class="struct" href="../struct.TryReserveError.html" title="struct indexmap::TryReserveError">TryReserveError</a>&gt;</h4></section></summary><div class="docblock"><p>Try to reserve capacity for <code>additional</code> more key-value pairs, without over-allocating.</p>
<p>Unlike <code>try_reserve</code>, this does not deliberately over-allocate the entry capacity to avoid
frequent re-allocations. However, the underlying data structures may still have internal
capacity requirements, and the allocator itself may give more space than requested, so this
cannot be relied upon to be precisely minimal.</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/map.rs.html#367-369">source</a><h4 class="code-header">pub fn <a href="#method.shrink_to_fit" class="fn">shrink_to_fit</a>(&amp;mut self)</h4></section></summary><div class="docblock"><p>Shrink the capacity of the map 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/map.rs.html#374-376">source</a><h4 class="code-header">pub fn <a href="#method.shrink_to" class="fn">shrink_to</a>(&amp;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 map with a lower limit.</p>
<p>Computes in <strong>O(n)</strong> time.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IndexMap%3CK,+V,+S%3E-1" class="impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#379-666">source</a><a href="#impl-IndexMap%3CK,+V,+S%3E-1" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;<div class="where">where
K: <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.insert" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#398-400">source</a><h4 class="code-header">pub fn <a href="#method.insert" class="fn">insert</a>(&amp;mut self, key: K, value: V) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;V&gt;</h4></section></summary><div class="docblock"><p>Insert a key-value pair in the map.</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 <a href="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 <a href="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
the corresponding key-value pair.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.insert_full" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#414-417">source</a><h4 class="code-header">pub fn <a href="#method.insert_full" class="fn">insert_full</a>(&amp;mut self, key: K, value: V) -&gt; (<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>&lt;V&gt;)</h4></section></summary><div class="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 <a href="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>
</div></details><details class="toggle method-toggle" open><summary><section id="method.insert_sorted" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#438-446">source</a><h4 class="code-header">pub fn <a href="#method.insert_sorted" class="fn">insert_sorted</a>(&amp;mut self, key: K, value: V) -&gt; (<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>&lt;V&gt;)<div class="where">where
K: <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>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
<a href="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 <a href="struct.IndexMap.html#method.insert_before" title="method indexmap::map::IndexMap::insert_before"><code>insert_before</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 <a href="https://doc.rust-lang.org/1.83.0/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 <a href="struct.IndexMap.html#method.insert" title="method indexmap::map::IndexMap::insert"><code>insert</code></a>
or <a href="struct.IndexMap.html#method.extend" title="method indexmap::map::IndexMap::extend"><code>extend</code></a> and only call <a href="struct.IndexMap.html#method.sort_keys" title="method indexmap::map::IndexMap::sort_keys"><code>sort_keys</code></a>
or <a href="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><details class="toggle method-toggle" open><summary><section id="method.insert_before" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#496-515">source</a><h4 class="code-header">pub fn <a href="#method.insert_before" class="fn">insert_before</a>(
&amp;mut self,
index: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>,
key: K,
value: V,
) -&gt; (<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>&lt;V&gt;)</h4></section></summary><div class="docblock"><p>Insert a key-value pair in the map before the entry at the given index, or at the end.</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>. The returned index
will either be the given index or one less, depending on how the entry moved.
(See <a href="struct.IndexMap.html#method.shift_insert" title="method indexmap::map::IndexMap::shift_insert"><code>shift_insert</code></a> for different behavior here.)</p>
<p>If no equivalent key existed in the map: the new key-value pair is
inserted exactly 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.
Valid indices are <code>0..=map.len()</code> (inclusive).</p>
<p>Computes in <strong>O(n)</strong> time (average).</p>
<p>See also <a href="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 <a href="struct.VacantEntry.html#method.shift_insert" title="method indexmap::map::VacantEntry::shift_insert"><code>VacantEntry::shift_insert</code></a>.</p>
<h5 id="examples-1"><a class="doc-anchor" href="#examples-1">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>indexmap::IndexMap;
<span class="kw">let </span><span class="kw-2">mut </span>map: IndexMap&lt;char, ()&gt; = (<span class="string">'a'</span>..=<span class="string">'z'</span>).map(|c| (c, ())).collect();
<span class="comment">// The new key '*' goes exactly at the given index.
</span><span class="macro">assert_eq!</span>(map.get_index_of(<span class="kw-2">&amp;</span><span class="string">'*'</span>), <span class="prelude-val">None</span>);
<span class="macro">assert_eq!</span>(map.insert_before(<span class="number">10</span>, <span class="string">'*'</span>, ()), (<span class="number">10</span>, <span class="prelude-val">None</span>));
<span class="macro">assert_eq!</span>(map.get_index_of(<span class="kw-2">&amp;</span><span class="string">'*'</span>), <span class="prelude-val">Some</span>(<span class="number">10</span>));
<span class="comment">// Moving the key 'a' up will shift others down, so this moves *before* 10 to index 9.
</span><span class="macro">assert_eq!</span>(map.insert_before(<span class="number">10</span>, <span class="string">'a'</span>, ()), (<span class="number">9</span>, <span class="prelude-val">Some</span>(())));
<span class="macro">assert_eq!</span>(map.get_index_of(<span class="kw-2">&amp;</span><span class="string">'a'</span>), <span class="prelude-val">Some</span>(<span class="number">9</span>));
<span class="macro">assert_eq!</span>(map.get_index_of(<span class="kw-2">&amp;</span><span class="string">'*'</span>), <span class="prelude-val">Some</span>(<span class="number">10</span>));
<span class="comment">// Moving the key 'z' down will shift others up, so this moves to exactly 10.
</span><span class="macro">assert_eq!</span>(map.insert_before(<span class="number">10</span>, <span class="string">'z'</span>, ()), (<span class="number">10</span>, <span class="prelude-val">Some</span>(())));
<span class="macro">assert_eq!</span>(map.get_index_of(<span class="kw-2">&amp;</span><span class="string">'z'</span>), <span class="prelude-val">Some</span>(<span class="number">10</span>));
<span class="macro">assert_eq!</span>(map.get_index_of(<span class="kw-2">&amp;</span><span class="string">'*'</span>), <span class="prelude-val">Some</span>(<span class="number">11</span>));
<span class="comment">// Moving or inserting before the endpoint is also valid.
</span><span class="macro">assert_eq!</span>(map.len(), <span class="number">27</span>);
<span class="macro">assert_eq!</span>(map.insert_before(map.len(), <span class="string">'*'</span>, ()), (<span class="number">26</span>, <span class="prelude-val">Some</span>(())));
<span class="macro">assert_eq!</span>(map.get_index_of(<span class="kw-2">&amp;</span><span class="string">'*'</span>), <span class="prelude-val">Some</span>(<span class="number">26</span>));
<span class="macro">assert_eq!</span>(map.insert_before(map.len(), <span class="string">'+'</span>, ()), (<span class="number">27</span>, <span class="prelude-val">None</span>));
<span class="macro">assert_eq!</span>(map.get_index_of(<span class="kw-2">&amp;</span><span class="string">'+'</span>), <span class="prelude-val">Some</span>(<span class="number">27</span>));
<span class="macro">assert_eq!</span>(map.len(), <span class="number">28</span>);</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.shift_insert" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#574-589">source</a><h4 class="code-header">pub fn <a href="#method.shift_insert" class="fn">shift_insert</a>(&amp;mut self, index: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>, key: K, value: V) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;V&gt;</h4></section></summary><div class="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 given index in the map, its corresponding value is updated
with <code>value</code>, and the older value is returned inside <code>Some(_)</code>.
Note that existing entries <strong>cannot</strong> be moved to <code>index == map.len()</code>!
(See <a href="struct.IndexMap.html#method.insert_before" title="method indexmap::map::IndexMap::insert_before"><code>insert_before</code></a> for different behavior here.)</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.
Valid indices are <code>0..map.len()</code> (exclusive) when moving an existing entry, or
<code>0..=map.len()</code> (inclusive) when inserting a new key.</p>
<p>Computes in <strong>O(n)</strong> time (average).</p>
<p>See also <a href="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 <a href="struct.VacantEntry.html#method.shift_insert" title="method indexmap::map::VacantEntry::shift_insert"><code>VacantEntry::shift_insert</code></a>.</p>
<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::IndexMap;
<span class="kw">let </span><span class="kw-2">mut </span>map: IndexMap&lt;char, ()&gt; = (<span class="string">'a'</span>..=<span class="string">'z'</span>).map(|c| (c, ())).collect();
<span class="comment">// The new key '*' goes exactly at the given index.
</span><span class="macro">assert_eq!</span>(map.get_index_of(<span class="kw-2">&amp;</span><span class="string">'*'</span>), <span class="prelude-val">None</span>);
<span class="macro">assert_eq!</span>(map.shift_insert(<span class="number">10</span>, <span class="string">'*'</span>, ()), <span class="prelude-val">None</span>);
<span class="macro">assert_eq!</span>(map.get_index_of(<span class="kw-2">&amp;</span><span class="string">'*'</span>), <span class="prelude-val">Some</span>(<span class="number">10</span>));
<span class="comment">// Moving the key 'a' up to 10 will shift others down, including the '*' that was at 10.
</span><span class="macro">assert_eq!</span>(map.shift_insert(<span class="number">10</span>, <span class="string">'a'</span>, ()), <span class="prelude-val">Some</span>(()));
<span class="macro">assert_eq!</span>(map.get_index_of(<span class="kw-2">&amp;</span><span class="string">'a'</span>), <span class="prelude-val">Some</span>(<span class="number">10</span>));
<span class="macro">assert_eq!</span>(map.get_index_of(<span class="kw-2">&amp;</span><span class="string">'*'</span>), <span class="prelude-val">Some</span>(<span class="number">9</span>));
<span class="comment">// Moving the key 'z' down to 9 will shift others up, including the '*' that was at 9.
</span><span class="macro">assert_eq!</span>(map.shift_insert(<span class="number">9</span>, <span class="string">'z'</span>, ()), <span class="prelude-val">Some</span>(()));
<span class="macro">assert_eq!</span>(map.get_index_of(<span class="kw-2">&amp;</span><span class="string">'z'</span>), <span class="prelude-val">Some</span>(<span class="number">9</span>));
<span class="macro">assert_eq!</span>(map.get_index_of(<span class="kw-2">&amp;</span><span class="string">'*'</span>), <span class="prelude-val">Some</span>(<span class="number">10</span>));
<span class="comment">// Existing keys can move to len-1 at most, but new keys can insert at the endpoint.
</span><span class="macro">assert_eq!</span>(map.len(), <span class="number">27</span>);
<span class="macro">assert_eq!</span>(map.shift_insert(map.len() - <span class="number">1</span>, <span class="string">'*'</span>, ()), <span class="prelude-val">Some</span>(()));
<span class="macro">assert_eq!</span>(map.get_index_of(<span class="kw-2">&amp;</span><span class="string">'*'</span>), <span class="prelude-val">Some</span>(<span class="number">26</span>));
<span class="macro">assert_eq!</span>(map.shift_insert(map.len(), <span class="string">'+'</span>, ()), <span class="prelude-val">None</span>);
<span class="macro">assert_eq!</span>(map.get_index_of(<span class="kw-2">&amp;</span><span class="string">'+'</span>), <span class="prelude-val">Some</span>(<span class="number">27</span>));
<span class="macro">assert_eq!</span>(map.len(), <span class="number">28</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::IndexMap;
<span class="kw">let </span><span class="kw-2">mut </span>map: IndexMap&lt;char, ()&gt; = (<span class="string">'a'</span>..=<span class="string">'z'</span>).map(|c| (c, ())).collect();
<span class="comment">// This is an invalid index for moving an existing key!
</span>map.shift_insert(map.len(), <span class="string">'a'</span>, ());</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.entry" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#595-598">source</a><h4 class="code-header">pub fn <a href="#method.entry" class="fn">entry</a>(&amp;mut self, key: K) -&gt; <a class="enum" href="enum.Entry.html" title="enum indexmap::map::Entry">Entry</a>&lt;'_, K, V&gt;</h4></section></summary><div class="docblock"><p>Get the given keys corresponding entry in the map for insertion and/or
in-place manipulation.</p>
<p>Computes in <strong>O(1)</strong> time (amortized average).</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.splice" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#630-636">source</a><h4 class="code-header">pub fn <a href="#method.splice" class="fn">splice</a>&lt;R, I&gt;(
&amp;mut self,
range: R,
replace_with: I,
) -&gt; <a class="struct" href="struct.Splice.html" title="struct indexmap::map::Splice">Splice</a>&lt;'_, I::<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>, K, V, S&gt; <a href="#" class="tooltip" data-notable-ty="Splice&lt;&#39;_, I::IntoIter, K, V, S&gt;"></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>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;,
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>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.tuple.html">(K, V)</a>&gt;,</div></h4></section></summary><div class="docblock"><p>Creates a splicing iterator that replaces the specified range in the map
with the given <code>replace_with</code> key-value iterator and yields the removed
items. <code>replace_with</code> does not need to be the same length as <code>range</code>.</p>
<p>The <code>range</code> is removed even if the iterator is not consumed until the
end. It is unspecified how many elements are removed from the map if the
<code>Splice</code> value is leaked.</p>
<p>The input iterator <code>replace_with</code> is only consumed when the <code>Splice</code>
value is dropped. If a key from the iterator matches an existing entry
in the map (outside of <code>range</code>), then the value will be updated in that
position. Otherwise, the new key-value pair will be inserted in the
replaced <code>range</code>.</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 map.</p>
<h5 id="examples-3"><a class="doc-anchor" href="#examples-3">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>indexmap::IndexMap;
<span class="kw">let </span><span class="kw-2">mut </span>map = IndexMap::from([(<span class="number">0</span>, <span class="string">'_'</span>), (<span class="number">1</span>, <span class="string">'a'</span>), (<span class="number">2</span>, <span class="string">'b'</span>), (<span class="number">3</span>, <span class="string">'c'</span>), (<span class="number">4</span>, <span class="string">'d'</span>)]);
<span class="kw">let </span>new = [(<span class="number">5</span>, <span class="string">'E'</span>), (<span class="number">4</span>, <span class="string">'D'</span>), (<span class="number">3</span>, <span class="string">'C'</span>), (<span class="number">2</span>, <span class="string">'B'</span>), (<span class="number">1</span>, <span class="string">'A'</span>)];
<span class="kw">let </span>removed: Vec&lt;<span class="kw">_</span>&gt; = map.splice(<span class="number">2</span>..<span class="number">4</span>, new).collect();
<span class="comment">// 1 and 4 got new values, while 5, 3, and 2 were newly inserted.
</span><span class="macro">assert!</span>(map.into_iter().eq([(<span class="number">0</span>, <span class="string">'_'</span>), (<span class="number">1</span>, <span class="string">'A'</span>), (<span class="number">5</span>, <span class="string">'E'</span>), (<span class="number">3</span>, <span class="string">'C'</span>), (<span class="number">2</span>, <span class="string">'B'</span>), (<span class="number">4</span>, <span class="string">'D'</span>)]));
<span class="macro">assert_eq!</span>(removed, <span class="kw-2">&amp;</span>[(<span class="number">2</span>, <span class="string">'b'</span>), (<span class="number">3</span>, <span class="string">'c'</span>)]);</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.append" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#663-665">source</a><h4 class="code-header">pub fn <a href="#method.append" class="fn">append</a>&lt;S2&gt;(&amp;mut self, other: &amp;mut <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S2&gt;)</h4></section></summary><div class="docblock"><p>Moves all key-value pairs from <code>other</code> into <code>self</code>, leaving <code>other</code> empty.</p>
<p>This is equivalent to calling <a href="struct.IndexMap.html#method.insert" title="method indexmap::map::IndexMap::insert"><code>insert</code></a> for each
key-value pair from <code>other</code> in order, which means that for keys that
already exist in <code>self</code>, their value is updated in the current position.</p>
<h5 id="examples-4"><a class="doc-anchor" href="#examples-4">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>indexmap::IndexMap;
<span class="comment">// Note: Key (3) is present in both maps.
</span><span class="kw">let </span><span class="kw-2">mut </span>a = IndexMap::from([(<span class="number">3</span>, <span class="string">"c"</span>), (<span class="number">2</span>, <span class="string">"b"</span>), (<span class="number">1</span>, <span class="string">"a"</span>)]);
<span class="kw">let </span><span class="kw-2">mut </span>b = IndexMap::from([(<span class="number">3</span>, <span class="string">"d"</span>), (<span class="number">4</span>, <span class="string">"e"</span>), (<span class="number">5</span>, <span class="string">"f"</span>)]);
<span class="kw">let </span>old_capacity = b.capacity();
a.append(<span class="kw-2">&amp;mut </span>b);
<span class="macro">assert_eq!</span>(a.len(), <span class="number">5</span>);
<span class="macro">assert_eq!</span>(b.len(), <span class="number">0</span>);
<span class="macro">assert_eq!</span>(b.capacity(), old_capacity);
<span class="macro">assert!</span>(a.keys().eq(<span class="kw-2">&amp;</span>[<span class="number">3</span>, <span class="number">2</span>, <span class="number">1</span>, <span class="number">4</span>, <span class="number">5</span>]));
<span class="macro">assert_eq!</span>(a[<span class="kw-2">&amp;</span><span class="number">3</span>], <span class="string">"d"</span>); <span class="comment">// "c" was overwritten.</span></code></pre></div>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IndexMap%3CK,+V,+S%3E-2" class="impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#668-930">source</a><a href="#impl-IndexMap%3CK,+V,+S%3E-2" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;<div class="where">where
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.contains_key" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#681-686">source</a><h4 class="code-header">pub fn <a href="#method.contains_key" class="fn">contains_key</a>&lt;Q&gt;(&amp;self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Q</a>) -&gt; <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/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</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="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a>&lt;K&gt;,</div></h4></section></summary><div class="docblock"><p>Return <code>true</code> if an equivalent to <code>key</code> exists in the map.</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/map.rs.html#692-702">source</a><h4 class="code-header">pub fn <a href="#method.get" class="fn">get</a>&lt;Q&gt;(&amp;self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Q</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;V</a>&gt;<div class="where">where
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> + <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>&lt;K&gt;,</div></h4></section></summary><div class="docblock"><p>Return a reference to the value stored for <code>key</code>, 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_key_value" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#708-718">source</a><h4 class="code-header">pub fn <a href="#method.get_key_value" class="fn">get_key_value</a>&lt;Q&gt;(&amp;self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Q</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;V</a>)&gt;<div class="where">where
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> + <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>&lt;K&gt;,</div></h4></section></summary><div class="docblock"><p>Return references to the key-value pair stored for <code>key</code>,
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/map.rs.html#721-731">source</a><h4 class="code-header">pub fn <a href="#method.get_full" class="fn">get_full</a>&lt;Q&gt;(&amp;self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Q</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<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">&amp;K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;V</a>)&gt;<div class="where">where
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> + <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>&lt;K&gt;,</div></h4></section></summary><div class="docblock"><p>Return item index, key 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/map.rs.html#736-748">source</a><h4 class="code-header">pub fn <a href="#method.get_index_of" class="fn">get_index_of</a>&lt;Q&gt;(&amp;self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Q</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;<div class="where">where
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> + <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>&lt;K&gt;,</div></h4></section></summary><div class="docblock"><p>Return item index, if it exists in the map</p>
<p>Computes in <strong>O(1)</strong> time (average).</p>
</div></details><section id="method.get_mut" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#750-760">source</a><h4 class="code-header">pub fn <a href="#method.get_mut" class="fn">get_mut</a>&lt;Q&gt;(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Q</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;mut V</a>&gt;<div class="where">where
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> + <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>&lt;K&gt;,</div></h4></section><section id="method.get_full_mut" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#762-772">source</a><h4 class="code-header">pub fn <a href="#method.get_full_mut" class="fn">get_full_mut</a>&lt;Q&gt;(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Q</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<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">&amp;K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;mut V</a>)&gt;<div class="where">where
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> + <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>&lt;K&gt;,</div></h4></section><details class="toggle method-toggle" open><summary><section id="method.remove" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#783-788">source</a><h4 class="code-header">pub fn <a href="#method.remove" class="fn">remove</a>&lt;Q&gt;(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Q</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;V&gt;<div class="where">where
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> + <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>&lt;K&gt;,</div></h4></section><span class="item-info"><div class="stab deprecated"><span class="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><div class="docblock"><p>Remove the key-value pair equivalent to <code>key</code> and return
its value.</p>
<p><strong>NOTE:</strong> This is equivalent to <a href="struct.IndexMap.html#method.swap_remove" title="method indexmap::map::IndexMap::swap_remove"><code>.swap_remove(key)</code></a>, replacing this
entrys 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
<a href="struct.IndexMap.html#method.shift_remove" title="method indexmap::map::IndexMap::shift_remove"><code>.shift_remove(key)</code></a> instead.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.remove_entry" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#798-803">source</a><h4 class="code-header">pub fn <a href="#method.remove_entry" class="fn">remove_entry</a>&lt;Q&gt;(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Q</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.tuple.html">(K, V)</a>&gt;<div class="where">where
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> + <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>&lt;K&gt;,</div></h4></section><span class="item-info"><div class="stab deprecated"><span class="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><div class="docblock"><p>Remove and return the key-value pair equivalent to <code>key</code>.</p>
<p><strong>NOTE:</strong> This is equivalent to <a href="struct.IndexMap.html#method.swap_remove_entry" title="method indexmap::map::IndexMap::swap_remove_entry"><code>.swap_remove_entry(key)</code></a>,
replacing this entrys 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 <a href="struct.IndexMap.html#method.shift_remove_entry" title="method indexmap::map::IndexMap::shift_remove_entry"><code>.shift_remove_entry(key)</code></a> instead.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.swap_remove" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#815-820">source</a><h4 class="code-header">pub fn <a href="#method.swap_remove" class="fn">swap_remove</a>&lt;Q&gt;(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Q</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;V&gt;<div class="where">where
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> + <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>&lt;K&gt;,</div></h4></section></summary><div class="docblock"><p>Remove the key-value pair equivalent to <code>key</code> and return
its value.</p>
<p>Like <a href="https://doc.rust-lang.org/1.83.0/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
last element of the map 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>key</code> is not in map.</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_entry" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#831-839">source</a><h4 class="code-header">pub fn <a href="#method.swap_remove_entry" class="fn">swap_remove_entry</a>&lt;Q&gt;(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Q</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.tuple.html">(K, V)</a>&gt;<div class="where">where
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> + <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>&lt;K&gt;,</div></h4></section></summary><div class="docblock"><p>Remove and return the key-value pair equivalent to <code>key</code>.</p>
<p>Like <a href="https://doc.rust-lang.org/1.83.0/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
last element of the map 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>key</code> is not in map.</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_full" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#851-866">source</a><h4 class="code-header">pub fn <a href="#method.swap_remove_full" class="fn">swap_remove_full</a>&lt;Q&gt;(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Q</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>, K, V)&gt;<div class="where">where
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> + <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>&lt;K&gt;,</div></h4></section></summary><div class="docblock"><p>Remove the key-value pair equivalent to <code>key</code> and return it and
the index it had.</p>
<p>Like <a href="https://doc.rust-lang.org/1.83.0/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
last element of the map 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>key</code> is not in map.</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/map.rs.html#878-883">source</a><h4 class="code-header">pub fn <a href="#method.shift_remove" class="fn">shift_remove</a>&lt;Q&gt;(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Q</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;V&gt;<div class="where">where
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> + <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>&lt;K&gt;,</div></h4></section></summary><div class="docblock"><p>Remove the key-value pair equivalent to <code>key</code> and return
its value.</p>
<p>Like <a href="https://doc.rust-lang.org/1.83.0/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
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>key</code> is not in map.</p>
<p>Computes in <strong>O(n)</strong> time (average).</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.shift_remove_entry" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#894-902">source</a><h4 class="code-header">pub fn <a href="#method.shift_remove_entry" class="fn">shift_remove_entry</a>&lt;Q&gt;(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Q</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.tuple.html">(K, V)</a>&gt;<div class="where">where
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> + <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>&lt;K&gt;,</div></h4></section></summary><div class="docblock"><p>Remove and return the key-value pair equivalent to <code>key</code>.</p>
<p>Like <a href="https://doc.rust-lang.org/1.83.0/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
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>key</code> is not in map.</p>
<p>Computes in <strong>O(n)</strong> time (average).</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/map.rs.html#914-929">source</a><h4 class="code-header">pub fn <a href="#method.shift_remove_full" class="fn">shift_remove_full</a>&lt;Q&gt;(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Q</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>, K, V)&gt;<div class="where">where
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> + <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>&lt;K&gt;,</div></h4></section></summary><div class="docblock"><p>Remove the key-value pair equivalent to <code>key</code> and return it and
the index it had.</p>
<p>Like <a href="https://doc.rust-lang.org/1.83.0/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
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>key</code> is not in map.</p>
<p>Computes in <strong>O(n)</strong> time (average).</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IndexMap%3CK,+V,+S%3E-3" class="impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#932-1293">source</a><a href="#impl-IndexMap%3CK,+V,+S%3E-3" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.pop" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#939-941">source</a><h4 class="code-header">pub fn <a href="#method.pop" class="fn">pop</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.tuple.html">(K, V)</a>&gt;</h4></section></summary><div class="docblock"><p>Remove the last key-value pair</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/map.rs.html#950-955">source</a><h4 class="code-header">pub fn <a href="#method.retain" class="fn">retain</a>&lt;F&gt;(&amp;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">&amp;K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;mut V</a>) -&gt; <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 key-value pair in the map 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_keys" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#964-971">source</a><h4 class="code-header">pub fn <a href="#method.sort_keys" class="fn">sort_keys</a>(&amp;mut self)<div class="where">where
K: <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 maps 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 <a href="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 doesnt allocate auxiliary memory.</p>
<p>See <a href="struct.IndexMap.html#method.sort_by" title="method indexmap::map::IndexMap::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/map.rs.html#981-988">source</a><h4 class="code-header">pub fn <a href="#method.sort_by" class="fn">sort_by</a>&lt;F&gt;(&amp;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">&amp;K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;V</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;V</a>) -&gt; <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 maps key-value pairs in place using the comparison
function <code>cmp</code>.</p>
<p>The comparison function receives two key and value pairs to compare (you
can sort by keys or values or their combination as needed).</p>
<p>Computes in <strong>O(n log n + c)</strong> time and <strong>O(n)</strong> space where <em>n</em> is
the length of the map and <em>c</em> the capacity. 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/map.rs.html#994-1001">source</a><h4 class="code-header">pub fn <a href="#method.sorted_by" class="fn">sorted_by</a>&lt;F&gt;(self, cmp: F) -&gt; <a class="struct" href="struct.IntoIter.html" title="struct indexmap::map::IntoIter">IntoIter</a>&lt;K, V&gt; <a href="#" class="tooltip" data-notable-ty="IntoIter&lt;K, V&gt;"></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">&amp;K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;V</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;V</a>) -&gt; <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 key-value pairs of the map and return a by-value iterator of
the key-value pairs with the result.</p>
<p>The sort is stable.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.sort_unstable_keys" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#1007-1014">source</a><h4 class="code-header">pub fn <a href="#method.sort_unstable_keys" class="fn">sort_unstable_keys</a>(&amp;mut self)<div class="where">where
K: <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 maps key-value pairs by the default ordering of the keys, but
may not preserve the order of equal elements.</p>
<p>See <a href="struct.IndexMap.html#method.sort_unstable_by" title="method indexmap::map::IndexMap::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/map.rs.html#1024-1031">source</a><h4 class="code-header">pub fn <a href="#method.sort_unstable_by" class="fn">sort_unstable_by</a>&lt;F&gt;(&amp;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">&amp;K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;V</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;V</a>) -&gt; <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 maps key-value pairs in place using the comparison function <code>cmp</code>, but
may not preserve the order of equal elements.</p>
<p>The comparison function receives two key and value pairs to compare (you
can sort by keys or values or their combination as needed).</p>
<p>Computes in <strong>O(n log n + c)</strong> time where <em>n</em> is
the length of the map and <em>c</em> is the capacity. 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/map.rs.html#1038-1045">source</a><h4 class="code-header">pub fn <a href="#method.sorted_unstable_by" class="fn">sorted_unstable_by</a>&lt;F&gt;(self, cmp: F) -&gt; <a class="struct" href="struct.IntoIter.html" title="struct indexmap::map::IntoIter">IntoIter</a>&lt;K, V&gt; <a href="#" class="tooltip" data-notable-ty="IntoIter&lt;K, V&gt;"></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">&amp;K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;V</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;V</a>) -&gt; <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 key-value pairs of the map and return a by-value iterator of
the key-value pairs with the result.</p>
<p>The sort is unstable.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.sort_by_cached_key" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#1055-1063">source</a><h4 class="code-header">pub fn <a href="#method.sort_by_cached_key" class="fn">sort_by_cached_key</a>&lt;T, F&gt;(&amp;mut self, sort_key: F)<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>,
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">&amp;K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;V</a>) -&gt; T,</div></h4></section></summary><div class="docblock"><p>Sort the maps key-value pairs in place using a sort-key extraction function.</p>
<p>During sorting, the function is called at most once per entry, by using temporary storage
to remember the results of its evaluation. The order of calls to the function is
unspecified and may change between versions of <code>indexmap</code> or the standard library.</p>
<p>Computes in <strong>O(m n + n log n + c)</strong> time () and <strong>O(n)</strong> space, where the function is
<strong>O(m)</strong>, <em>n</em> is the length of the map, and <em>c</em> the capacity. The sort is stable.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.binary_search_keys" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#1072-1077">source</a><h4 class="code-header">pub fn <a href="#method.binary_search_keys" class="fn">binary_search_keys</a>(&amp;self, x: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;K</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<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.usize.html">usize</a>&gt;<div class="where">where
K: <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>Search over a sorted map for a key.</p>
<p>Returns the position where that key is present, or the position where it can be inserted to
maintain the sort. See <a href="https://doc.rust-lang.org/1.83.0/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 <a href="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>
</div></details><details class="toggle method-toggle" open><summary><section id="method.binary_search_by" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#1086-1091">source</a><h4 class="code-header">pub fn <a href="#method.binary_search_by" class="fn">binary_search_by</a>&lt;'a, F&gt;(&amp;'a self, f: F) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<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.usize.html">usize</a>&gt;<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">&amp;'a K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;'a V</a>) -&gt; <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>Search over a sorted map with a comparator function.</p>
<p>Returns the position where that value is present, or the position where it can be inserted
to maintain the sort. See <a href="https://doc.rust-lang.org/1.83.0/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>
<p>Computes in <strong>O(log(n))</strong> time.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.binary_search_by_key" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#1100-1106">source</a><h4 class="code-header">pub fn <a href="#method.binary_search_by_key" class="fn">binary_search_by_key</a>&lt;'a, B, F&gt;(
&amp;'a self,
b: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;B</a>,
f: F,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<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.usize.html">usize</a>&gt;<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">&amp;'a K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;'a V</a>) -&gt; B,
B: <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>Search over a sorted map with an extraction function.</p>
<p>Returns the position where that value is present, or the position where it can be inserted
to maintain the sort. See <a href="https://doc.rust-lang.org/1.83.0/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>Computes in <strong>O(log(n))</strong> time.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.partition_point" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#1115-1120">source</a><h4 class="code-header">pub fn <a href="#method.partition_point" class="fn">partition_point</a>&lt;P&gt;(&amp;self, pred: P) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a><div class="where">where
P: <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">&amp;K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;V</a>) -&gt; <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>Returns the index of the partition point of a sorted map according to the given predicate
(the index of the first element of the second partition).</p>
<p>See <a href="https://doc.rust-lang.org/1.83.0/std/primitive.slice.html#method.partition_point" title="method slice::partition_point"><code>slice::partition_point</code></a> for more details.</p>
<p>Computes in <strong>O(log(n))</strong> time.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.reverse" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#1125-1127">source</a><h4 class="code-header">pub fn <a href="#method.reverse" class="fn">reverse</a>(&amp;mut self)</h4></section></summary><div class="docblock"><p>Reverses the order of the maps key-value pairs in place.</p>
<p>Computes in <strong>O(n)</strong> time and <strong>O(1)</strong> space.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.as_slice" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#1132-1134">source</a><h4 class="code-header">pub fn <a href="#method.as_slice" class="fn">as_slice</a>(&amp;self) -&gt; &amp;<a class="struct" href="struct.Slice.html" title="struct indexmap::map::Slice">Slice</a>&lt;K, V&gt;</h4></section></summary><div class="docblock"><p>Returns a slice of all the key-value pairs in the map.</p>
<p>Computes in <strong>O(1)</strong> time.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.as_mut_slice" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#1139-1141">source</a><h4 class="code-header">pub fn <a href="#method.as_mut_slice" class="fn">as_mut_slice</a>(&amp;mut self) -&gt; &amp;mut <a class="struct" href="struct.Slice.html" title="struct indexmap::map::Slice">Slice</a>&lt;K, V&gt;</h4></section></summary><div class="docblock"><p>Returns a mutable slice of all the key-value pairs in the map.</p>
<p>Computes in <strong>O(1)</strong> time.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.into_boxed_slice" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#1146-1148">source</a><h4 class="code-header">pub fn <a href="#method.into_boxed_slice" class="fn">into_boxed_slice</a>(self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.83.0/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="struct" href="struct.Slice.html" title="struct indexmap::map::Slice">Slice</a>&lt;K, V&gt;&gt;</h4></section></summary><div class="docblock"><p>Converts into a boxed slice of all the key-value pairs in the map.</p>
<p>Note that this will drop the inner hash table and any excess capacity.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_index" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#1155-1157">source</a><h4 class="code-header">pub fn <a href="#method.get_index" class="fn">get_index</a>(&amp;self, index: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;V</a>)&gt;</h4></section></summary><div class="docblock"><p>Get a key-value pair by index</p>
<p>Valid indices are <code>0 &lt;= index &lt; self.len()</code>.</p>
<p>Computes in <strong>O(1)</strong> time.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_index_mut" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#1164-1166">source</a><h4 class="code-header">pub fn <a href="#method.get_index_mut" class="fn">get_index_mut</a>(&amp;mut self, index: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;mut V</a>)&gt;</h4></section></summary><div class="docblock"><p>Get a key-value pair by index</p>
<p>Valid indices are <code>0 &lt;= index &lt; self.len()</code>.</p>
<p>Computes in <strong>O(1)</strong> time.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_index_entry" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#1173-1178">source</a><h4 class="code-header">pub fn <a href="#method.get_index_entry" class="fn">get_index_entry</a>(
&amp;mut self,
index: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.IndexedEntry.html" title="struct indexmap::map::IndexedEntry">IndexedEntry</a>&lt;'_, K, V&gt;&gt;</h4></section></summary><div class="docblock"><p>Get an entry in the map by index for in-place manipulation.</p>
<p>Valid indices are <code>0 &lt;= index &lt; self.len()</code>.</p>
<p>Computes in <strong>O(1)</strong> time.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_range" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#1185-1189">source</a><h4 class="code-header">pub fn <a href="#method.get_range" class="fn">get_range</a>&lt;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>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;&gt;(&amp;self, range: R) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="struct.Slice.html" title="struct indexmap::map::Slice">Slice</a>&lt;K, V&gt;&gt;</h4></section></summary><div class="docblock"><p>Returns a slice of key-value pairs in the given range of indices.</p>
<p>Valid indices are <code>0 &lt;= index &lt; self.len()</code>.</p>
<p>Computes in <strong>O(1)</strong> time.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_range_mut" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#1196-1200">source</a><h4 class="code-header">pub fn <a href="#method.get_range_mut" class="fn">get_range_mut</a>&lt;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>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;&gt;(
&amp;mut self,
range: R,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;mut <a class="struct" href="struct.Slice.html" title="struct indexmap::map::Slice">Slice</a>&lt;K, V&gt;&gt;</h4></section></summary><div class="docblock"><p>Returns a mutable slice of key-value pairs in the given range of indices.</p>
<p>Valid indices are <code>0 &lt;= index &lt; self.len()</code>.</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/map.rs.html#1206-1208">source</a><h4 class="code-header">pub fn <a href="#method.first" class="fn">first</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;V</a>)&gt;</h4></section></summary><div class="docblock"><p>Get the first key-value pair</p>
<p>Computes in <strong>O(1)</strong> time.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.first_mut" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#1213-1215">source</a><h4 class="code-header">pub fn <a href="#method.first_mut" class="fn">first_mut</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;mut V</a>)&gt;</h4></section></summary><div class="docblock"><p>Get the first key-value pair, with mutable access to the value</p>
<p>Computes in <strong>O(1)</strong> time.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.first_entry" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#1220-1222">source</a><h4 class="code-header">pub fn <a href="#method.first_entry" class="fn">first_entry</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.IndexedEntry.html" title="struct indexmap::map::IndexedEntry">IndexedEntry</a>&lt;'_, K, V&gt;&gt;</h4></section></summary><div class="docblock"><p>Get the first entry in the map for in-place manipulation.</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/map.rs.html#1228-1230">source</a><h4 class="code-header">pub fn <a href="#method.last" class="fn">last</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;V</a>)&gt;</h4></section></summary><div class="docblock"><p>Get the last key-value pair</p>
<p>Computes in <strong>O(1)</strong> time.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.last_mut" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#1235-1237">source</a><h4 class="code-header">pub fn <a href="#method.last_mut" class="fn">last_mut</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;mut V</a>)&gt;</h4></section></summary><div class="docblock"><p>Get the last key-value pair, with mutable access to the value</p>
<p>Computes in <strong>O(1)</strong> time.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.last_entry" class="method"><a class="src rightside" href="../../src/indexmap/map.rs.html#1242-1244">source</a><h4 class="code-header">pub fn <a href="#method.last_entry" class="fn">last_entry</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.IndexedEntry.html" title="struct indexmap::map::IndexedEntry">IndexedEntry</a>&lt;'_, K, V&gt;&gt;</h4></section></summary><div class="docblock"><p>Get the last entry in the map for in-place manipulation.</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/map.rs.html#1255-1257">source</a><h4 class="code-header">pub fn <a href="#method.swap_remove_index" class="fn">swap_remove_index</a>(&amp;mut self, index: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.tuple.html">(K, V)</a>&gt;</h4></section></summary><div class="docblock"><p>Remove the key-value pair by index</p>
<p>Valid indices are <code>0 &lt;= index &lt; self.len()</code>.</p>
<p>Like <a href="https://doc.rust-lang.org/1.83.0/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
last element of the map 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/map.rs.html#1268-1270">source</a><h4 class="code-header">pub fn <a href="#method.shift_remove_index" class="fn">shift_remove_index</a>(&amp;mut self, index: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.tuple.html">(K, V)</a>&gt;</h4></section></summary><div class="docblock"><p>Remove the key-value pair by index</p>
<p>Valid indices are <code>0 &lt;= index &lt; self.len()</code>.</p>
<p>Like <a href="https://doc.rust-lang.org/1.83.0/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
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/map.rs.html#1281-1283">source</a><h4 class="code-header">pub fn <a href="#method.move_index" class="fn">move_index</a>(&amp;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 key-value pair from one index to another
by shifting all other pairs in-between.</p>
<ul>
<li>If <code>from &lt; to</code>, the other pairs will shift down while the targeted pair moves up.</li>
<li>If <code>from &gt; to</code>, the other pairs will shift up while the targeted pair 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/map.rs.html#1290-1292">source</a><h4 class="code-header">pub fn <a href="#method.swap_indices" class="fn">swap_indices</a>(&amp;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 key-value pairs in the map.</p>
<p><em><strong>Panics</strong></em> if <code>a</code> or <code>b</code> are out of bounds.</p>
<p>Computes in <strong>O(1)</strong> time (average).</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-Clone-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#97-114">source</a><a href="#impl-Clone-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;<div class="where">where
K: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
V: <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/map.rs.html#103-108">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>(&amp;self) -&gt; 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/map.rs.html#110-113">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>(&amp;mut self, other: &amp;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-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#142-159">source</a><a href="#impl-Debug-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;<div class="where">where
K: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,
V: <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/map.rs.html#148-150">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>(&amp;self, f: &amp;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>&lt;'_&gt;) -&gt; <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-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#1545-1553">source</a><a href="#impl-Default-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;<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/map.rs.html#1550-1552">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>() -&gt; Self</h4></section></summary><div class="docblock"><p>Return an empty <a href="struct.IndexMap.html" title="struct indexmap::map::IndexMap"><code>IndexMap</code></a></p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Extend%3C(%26K,+%26V)%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#1531-1543">source</a><a href="#impl-Extend%3C(%26K,+%26V)%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, K, V, S&gt; <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>&lt;(<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;'a K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;'a V</a>)&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;<div class="where">where
K: <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>,
V: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</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/map.rs.html#1540-1542">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>&lt;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>&lt;Item = (<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;'a K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;'a V</a>)&gt;&gt;(&amp;mut self, iterable: I)</h4></section></summary><div class="docblock"><p>Extend the map with all key-value pairs in the iterable.</p>
<p>See the first extend method for more details.</p>
</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>(&amp;mut self, item: A)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>extend_one</code>)</span></div></span><div class='docblock'>Extends a collection with exactly one element.</div></details><details class="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>(&amp;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%3C(K,+V)%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#1498-1529">source</a><a href="#impl-Extend%3C(K,+V)%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.tuple.html">(K, V)</a>&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;<div class="where">where
K: <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/map.rs.html#1512-1528">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>&lt;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>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.tuple.html">(K, V)</a>&gt;&gt;(&amp;mut self, iterable: I)</h4></section></summary><div class="docblock"><p>Extend the map with all key-value pairs in the iterable.</p>
<p>This is equivalent to calling <a href="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
prevails.</p>
</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>(&amp;mut self, item: A)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>extend_one</code>)</span></div></span><div class='docblock'>Extends a collection with exactly one element.</div></details><details class="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>(&amp;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%5B(K,+V);+N%5D%3E-for-IndexMap%3CK,+V%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#1480-1496">source</a><a href="#impl-From%3C%5B(K,+V);+N%5D%3E-for-IndexMap%3CK,+V%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, const N: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt; <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.tuple.html">(K, V)</a>; <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.array.html">N</a>]&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, <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>&gt;<div class="where">where
K: <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>,</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/map.rs.html#1493-1495">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.tuple.html">(K, V)</a>; <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.array.html">N</a>]) -&gt; Self</h4></section></summary><div class="docblock"><h5 id="examples-9"><a class="doc-anchor" href="#examples-9">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>indexmap::IndexMap;
<span class="kw">let </span>map1 = IndexMap::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>map2: IndexMap&lt;<span class="kw">_</span>, <span class="kw">_</span>&gt; = [(<span class="number">1</span>, <span class="number">2</span>), (<span class="number">3</span>, <span class="number">4</span>)].into();
<span class="macro">assert_eq!</span>(map1, map2);</code></pre></div>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-FromIterator%3C(K,+V)%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#1459-1476">source</a><a href="#impl-FromIterator%3C(K,+V)%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.tuple.html">(K, V)</a>&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;<div class="where">where
K: <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/map.rs.html#1469-1475">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>&lt;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>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.tuple.html">(K, V)</a>&gt;&gt;(iterable: I) -&gt; Self</h4></section></summary><div class="docblock"><p>Create an <code>IndexMap</code> from the sequence of key-value pairs in the
iterable.</p>
<p><code>from_iter</code> uses the same logic as <code>extend</code>. See
<a href="struct.IndexMap.html#method.extend" title="method indexmap::map::IndexMap::extend"><code>extend</code></a> for more details.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Index%3C%26Q%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#1317-1330">source</a><a href="#impl-Index%3C%26Q%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, Q, S&gt; <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>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Q</a>&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;<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>&lt;K&gt; + ?<a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</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="docblock"><p>Access <a href="struct.IndexMap.html" title="struct indexmap::map::IndexMap"><code>IndexMap</code></a> values corresponding to a key.</p>
<h4 id="examples-5"><a class="doc-anchor" href="#examples-5">§</a>Examples</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>indexmap::IndexMap;
<span class="kw">let </span><span class="kw-2">mut </span>map = IndexMap::new();
<span class="kw">for </span>word <span class="kw">in </span><span class="string">"Lorem ipsum dolor sit amet"</span>.split_whitespace() {
map.insert(word.to_lowercase(), word.to_uppercase());
}
<span class="macro">assert_eq!</span>(map[<span class="string">"lorem"</span>], <span class="string">"LOREM"</span>);
<span class="macro">assert_eq!</span>(map[<span class="string">"ipsum"</span>], <span class="string">"IPSUM"</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::IndexMap;
<span class="kw">let </span><span class="kw-2">mut </span>map = IndexMap::new();
map.insert(<span class="string">"foo"</span>, <span class="number">1</span>);
<span class="macro">println!</span>(<span class="string">"{:?}"</span>, map[<span class="string">"bar"</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-7" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#1327-1329">source</a><a href="#method.index-7" 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>(&amp;self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Q</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;V</a></h4></section></summary><div class="docblock"><p>Returns a reference to the value corresponding to the supplied <code>key</code>.</p>
<p><em><strong>Panics</strong></em> if <code>key</code> is not present in the map.</p>
</div></details><details class="toggle" open><summary><section id="associatedtype.Output-7" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#1322">source</a><a href="#associatedtype.Output-7" 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> = V</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-Index%3C(Bound%3Cusize%3E,+Bound%3Cusize%3E)%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#impl-Index%3C(Bound%3Cusize%3E,+Bound%3Cusize%3E)%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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>&lt;(<a class="enum" href="https://doc.rust-lang.org/1.83.0/core/ops/range/enum.Bound.html" title="enum core::ops::range::Bound">Bound</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;, <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/ops/range/enum.Bound.html" title="enum core::ops::range::Bound">Bound</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;)&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output-6" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#associatedtype.Output-6" 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> = <a class="struct" href="struct.Slice.html" title="struct indexmap::map::Slice">Slice</a>&lt;K, V&gt;</h4></section></summary><div class='docblock'>The returned type after indexing.</div></details><details class="toggle method-toggle" open><summary><section id="method.index-6" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#method.index-6" 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>(&amp;self, range: (<a class="enum" href="https://doc.rust-lang.org/1.83.0/core/ops/range/enum.Bound.html" title="enum core::ops::range::Bound">Bound</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;, <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/ops/range/enum.Bound.html" title="enum core::ops::range::Bound">Bound</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;)) -&gt; &amp;Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#associatedtype.Output" title="type core::ops::index::Index::Output">Output</a></h4></section></summary><div class='docblock'>Performs the indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#tymethod.index">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Index%3CRange%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#impl-Index%3CRange%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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>&lt;<a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.Range.html" title="struct core::ops::range::Range">Range</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">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> = <a class="struct" href="struct.Slice.html" title="struct indexmap::map::Slice">Slice</a>&lt;K, V&gt;</h4></section></summary><div class='docblock'>The returned type after indexing.</div></details><details class="toggle method-toggle" open><summary><section id="method.index" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">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>(&amp;self, range: <a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.Range.html" title="struct core::ops::range::Range">Range</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;) -&gt; &amp;Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#associatedtype.Output" title="type core::ops::index::Index::Output">Output</a></h4></section></summary><div class='docblock'>Performs the indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#tymethod.index">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Index%3CRangeFrom%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#impl-Index%3CRangeFrom%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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>&lt;<a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.RangeFrom.html" title="struct core::ops::range::RangeFrom">RangeFrom</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">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/index/trait.Index.html#associatedtype.Output" class="associatedtype">Output</a> = <a class="struct" href="struct.Slice.html" title="struct indexmap::map::Slice">Slice</a>&lt;K, V&gt;</h4></section></summary><div class='docblock'>The returned type after indexing.</div></details><details class="toggle method-toggle" open><summary><section id="method.index-1" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#method.index-1" 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>(&amp;self, range: <a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.RangeFrom.html" title="struct core::ops::range::RangeFrom">RangeFrom</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;) -&gt; &amp;Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#associatedtype.Output" title="type core::ops::index::Index::Output">Output</a></h4></section></summary><div class='docblock'>Performs the indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#tymethod.index">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Index%3CRangeFull%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#impl-Index%3CRangeFull%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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>&lt;<a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.RangeFull.html" title="struct core::ops::range::RangeFull">RangeFull</a>&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output-2" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">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/index/trait.Index.html#associatedtype.Output" class="associatedtype">Output</a> = <a class="struct" href="struct.Slice.html" title="struct indexmap::map::Slice">Slice</a>&lt;K, V&gt;</h4></section></summary><div class='docblock'>The returned type after indexing.</div></details><details class="toggle method-toggle" open><summary><section id="method.index-2" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#method.index-2" 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>(&amp;self, range: <a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.RangeFull.html" title="struct core::ops::range::RangeFull">RangeFull</a>) -&gt; &amp;Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#associatedtype.Output" title="type core::ops::index::Index::Output">Output</a></h4></section></summary><div class='docblock'>Performs the indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#tymethod.index">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Index%3CRangeInclusive%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#impl-Index%3CRangeInclusive%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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>&lt;<a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.RangeInclusive.html" title="struct core::ops::range::RangeInclusive">RangeInclusive</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output-3" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">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/index/trait.Index.html#associatedtype.Output" class="associatedtype">Output</a> = <a class="struct" href="struct.Slice.html" title="struct indexmap::map::Slice">Slice</a>&lt;K, V&gt;</h4></section></summary><div class='docblock'>The returned type after indexing.</div></details><details class="toggle method-toggle" open><summary><section id="method.index-3" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#method.index-3" 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>(&amp;self, range: <a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.RangeInclusive.html" title="struct core::ops::range::RangeInclusive">RangeInclusive</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;) -&gt; &amp;Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#associatedtype.Output" title="type core::ops::index::Index::Output">Output</a></h4></section></summary><div class='docblock'>Performs the indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#tymethod.index">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Index%3CRangeTo%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#impl-Index%3CRangeTo%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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>&lt;<a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.RangeTo.html" title="struct core::ops::range::RangeTo">RangeTo</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output-4" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">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/index/trait.Index.html#associatedtype.Output" class="associatedtype">Output</a> = <a class="struct" href="struct.Slice.html" title="struct indexmap::map::Slice">Slice</a>&lt;K, V&gt;</h4></section></summary><div class='docblock'>The returned type after indexing.</div></details><details class="toggle method-toggle" open><summary><section id="method.index-4" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#method.index-4" 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>(&amp;self, range: <a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.RangeTo.html" title="struct core::ops::range::RangeTo">RangeTo</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;) -&gt; &amp;Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#associatedtype.Output" title="type core::ops::index::Index::Output">Output</a></h4></section></summary><div class='docblock'>Performs the indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#tymethod.index">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Index%3CRangeToInclusive%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#impl-Index%3CRangeToInclusive%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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>&lt;<a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.RangeToInclusive.html" title="struct core::ops::range::RangeToInclusive">RangeToInclusive</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output-5" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#associatedtype.Output-5" 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> = <a class="struct" href="struct.Slice.html" title="struct indexmap::map::Slice">Slice</a>&lt;K, V&gt;</h4></section></summary><div class='docblock'>The returned type after indexing.</div></details><details class="toggle method-toggle" open><summary><section id="method.index-5" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#method.index-5" 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>(&amp;self, range: <a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.RangeToInclusive.html" title="struct core::ops::range::RangeToInclusive">RangeToInclusive</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;) -&gt; &amp;Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#associatedtype.Output" title="type core::ops::index::Index::Output">Output</a></h4></section></summary><div class='docblock'>Performs the indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#tymethod.index">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Index%3Cusize%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#1406-1417">source</a><a href="#impl-Index%3Cusize%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</h3></section></summary><div class="docblock"><p>Access <a href="struct.IndexMap.html" title="struct indexmap::map::IndexMap"><code>IndexMap</code></a> values at indexed positions.</p>
<p>See <a href="struct.Keys.html#impl-Index%3Cusize%3E-for-Keys%3C&#x27;a,+K,+V%3E" title="struct indexmap::map::Keys"><code>Index&lt;usize&gt; for Keys</code></a> to access a maps keys instead.</p>
<h4 id="examples-7"><a class="doc-anchor" href="#examples-7">§</a>Examples</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>indexmap::IndexMap;
<span class="kw">let </span><span class="kw-2">mut </span>map = IndexMap::new();
<span class="kw">for </span>word <span class="kw">in </span><span class="string">"Lorem ipsum dolor sit amet"</span>.split_whitespace() {
map.insert(word.to_lowercase(), word.to_uppercase());
}
<span class="macro">assert_eq!</span>(map[<span class="number">0</span>], <span class="string">"LOREM"</span>);
<span class="macro">assert_eq!</span>(map[<span class="number">1</span>], <span class="string">"IPSUM"</span>);
map.reverse();
<span class="macro">assert_eq!</span>(map[<span class="number">0</span>], <span class="string">"AMET"</span>);
<span class="macro">assert_eq!</span>(map[<span class="number">1</span>], <span class="string">"SIT"</span>);
map.sort_keys();
<span class="macro">assert_eq!</span>(map[<span class="number">0</span>], <span class="string">"AMET"</span>);
<span class="macro">assert_eq!</span>(map[<span class="number">1</span>], <span class="string">"DOLOR"</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::IndexMap;
<span class="kw">let </span><span class="kw-2">mut </span>map = IndexMap::new();
map.insert(<span class="string">"foo"</span>, <span class="number">1</span>);
<span class="macro">println!</span>(<span class="string">"{:?}"</span>, map[<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-8" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#1412-1416">source</a><a href="#method.index-8" 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>(&amp;self, index: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;V</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-8" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#1407">source</a><a href="#associatedtype.Output-8" 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> = V</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-IndexMut%3C%26Q%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#1361-1372">source</a><a href="#impl-IndexMut%3C%26Q%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, Q, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html" title="trait core::ops::index::IndexMut">IndexMut</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Q</a>&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;<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>&lt;K&gt; + ?<a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</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="docblock"><p>Access <a href="struct.IndexMap.html" title="struct indexmap::map::IndexMap"><code>IndexMap</code></a> values corresponding to a key.</p>
<p>Mutable indexing allows changing / updating values of key-value
pairs that are already present.</p>
<p>You can <strong>not</strong> insert new pairs with index syntax, use <code>.insert()</code>.</p>
<h4 id="examples-6"><a class="doc-anchor" href="#examples-6">§</a>Examples</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>indexmap::IndexMap;
<span class="kw">let </span><span class="kw-2">mut </span>map = IndexMap::new();
<span class="kw">for </span>word <span class="kw">in </span><span class="string">"Lorem ipsum dolor sit amet"</span>.split_whitespace() {
map.insert(word.to_lowercase(), word.to_string());
}
<span class="kw">let </span>lorem = <span class="kw-2">&amp;mut </span>map[<span class="string">"lorem"</span>];
<span class="macro">assert_eq!</span>(lorem, <span class="string">"Lorem"</span>);
lorem.retain(char::is_lowercase);
<span class="macro">assert_eq!</span>(map[<span class="string">"lorem"</span>], <span class="string">"orem"</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::IndexMap;
<span class="kw">let </span><span class="kw-2">mut </span>map = IndexMap::new();
map.insert(<span class="string">"foo"</span>, <span class="number">1</span>);
map[<span class="string">"bar"</span>] = <span class="number">1</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_mut-7" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#1369-1371">source</a><a href="#method.index_mut-7" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut" class="fn">index_mut</a>(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Q</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;mut V</a></h4></section></summary><div class="docblock"><p>Returns a mutable reference to the value corresponding to the supplied <code>key</code>.</p>
<p><em><strong>Panics</strong></em> if <code>key</code> is not present in the map.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IndexMut%3C(Bound%3Cusize%3E,+Bound%3Cusize%3E)%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#impl-IndexMut%3C(Bound%3Cusize%3E,+Bound%3Cusize%3E)%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html" title="trait core::ops::index::IndexMut">IndexMut</a>&lt;(<a class="enum" href="https://doc.rust-lang.org/1.83.0/core/ops/range/enum.Bound.html" title="enum core::ops::range::Bound">Bound</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;, <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/ops/range/enum.Bound.html" title="enum core::ops::range::Bound">Bound</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;)&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.index_mut-6" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#method.index_mut-6" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut" class="fn">index_mut</a>(
&amp;mut self,
range: (<a class="enum" href="https://doc.rust-lang.org/1.83.0/core/ops/range/enum.Bound.html" title="enum core::ops::range::Bound">Bound</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;, <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/ops/range/enum.Bound.html" title="enum core::ops::range::Bound">Bound</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;),
) -&gt; &amp;mut Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#associatedtype.Output" title="type core::ops::index::Index::Output">Output</a></h4></section></summary><div class='docblock'>Performs the mutable indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IndexMut%3CRange%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#impl-IndexMut%3CRange%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html" title="trait core::ops::index::IndexMut">IndexMut</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.Range.html" title="struct core::ops::range::Range">Range</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.index_mut" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#method.index_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut" class="fn">index_mut</a>(&amp;mut self, range: <a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.Range.html" title="struct core::ops::range::Range">Range</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;) -&gt; &amp;mut Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#associatedtype.Output" title="type core::ops::index::Index::Output">Output</a></h4></section></summary><div class='docblock'>Performs the mutable indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IndexMut%3CRangeFrom%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#impl-IndexMut%3CRangeFrom%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html" title="trait core::ops::index::IndexMut">IndexMut</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.RangeFrom.html" title="struct core::ops::range::RangeFrom">RangeFrom</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.index_mut-1" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#method.index_mut-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut" class="fn">index_mut</a>(&amp;mut self, range: <a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.RangeFrom.html" title="struct core::ops::range::RangeFrom">RangeFrom</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;) -&gt; &amp;mut Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#associatedtype.Output" title="type core::ops::index::Index::Output">Output</a></h4></section></summary><div class='docblock'>Performs the mutable indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IndexMut%3CRangeFull%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#impl-IndexMut%3CRangeFull%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html" title="trait core::ops::index::IndexMut">IndexMut</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.RangeFull.html" title="struct core::ops::range::RangeFull">RangeFull</a>&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.index_mut-2" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#method.index_mut-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut" class="fn">index_mut</a>(&amp;mut self, range: <a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.RangeFull.html" title="struct core::ops::range::RangeFull">RangeFull</a>) -&gt; &amp;mut Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#associatedtype.Output" title="type core::ops::index::Index::Output">Output</a></h4></section></summary><div class='docblock'>Performs the mutable indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IndexMut%3CRangeInclusive%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#impl-IndexMut%3CRangeInclusive%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html" title="trait core::ops::index::IndexMut">IndexMut</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.RangeInclusive.html" title="struct core::ops::range::RangeInclusive">RangeInclusive</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.index_mut-3" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#method.index_mut-3" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut" class="fn">index_mut</a>(&amp;mut self, range: <a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.RangeInclusive.html" title="struct core::ops::range::RangeInclusive">RangeInclusive</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;) -&gt; &amp;mut Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#associatedtype.Output" title="type core::ops::index::Index::Output">Output</a></h4></section></summary><div class='docblock'>Performs the mutable indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IndexMut%3CRangeTo%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#impl-IndexMut%3CRangeTo%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html" title="trait core::ops::index::IndexMut">IndexMut</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.RangeTo.html" title="struct core::ops::range::RangeTo">RangeTo</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.index_mut-4" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#method.index_mut-4" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut" class="fn">index_mut</a>(&amp;mut self, range: <a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.RangeTo.html" title="struct core::ops::range::RangeTo">RangeTo</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;) -&gt; &amp;mut Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#associatedtype.Output" title="type core::ops::index::Index::Output">Output</a></h4></section></summary><div class='docblock'>Performs the mutable indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IndexMut%3CRangeToInclusive%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#impl-IndexMut%3CRangeToInclusive%3Cusize%3E%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html" title="trait core::ops::index::IndexMut">IndexMut</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.RangeToInclusive.html" title="struct core::ops::range::RangeToInclusive">RangeToInclusive</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.index_mut-5" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/slice.rs.html#416-424">source</a><a href="#method.index_mut-5" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut" class="fn">index_mut</a>(&amp;mut self, range: <a class="struct" href="https://doc.rust-lang.org/1.83.0/core/ops/range/struct.RangeToInclusive.html" title="struct core::ops::range::RangeToInclusive">RangeToInclusive</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt;) -&gt; &amp;mut Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.Index.html#associatedtype.Output" title="type core::ops::index::Index::Output">Output</a></h4></section></summary><div class='docblock'>Performs the mutable indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IndexMut%3Cusize%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#1448-1457">source</a><a href="#impl-IndexMut%3Cusize%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html" title="trait core::ops::index::IndexMut">IndexMut</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</h3></section></summary><div class="docblock"><p>Access <a href="struct.IndexMap.html" title="struct indexmap::map::IndexMap"><code>IndexMap</code></a> values at indexed positions.</p>
<p>Mutable indexing allows changing / updating indexed values
that are already present.</p>
<p>You can <strong>not</strong> insert new values with index syntax use <a href="struct.IndexMap.html#method.insert" title="method indexmap::map::IndexMap::insert"><code>.insert()</code></a>.</p>
<h4 id="examples-8"><a class="doc-anchor" href="#examples-8">§</a>Examples</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>indexmap::IndexMap;
<span class="kw">let </span><span class="kw-2">mut </span>map = IndexMap::new();
<span class="kw">for </span>word <span class="kw">in </span><span class="string">"Lorem ipsum dolor sit amet"</span>.split_whitespace() {
map.insert(word.to_lowercase(), word.to_string());
}
<span class="kw">let </span>lorem = <span class="kw-2">&amp;mut </span>map[<span class="number">0</span>];
<span class="macro">assert_eq!</span>(lorem, <span class="string">"Lorem"</span>);
lorem.retain(char::is_lowercase);
<span class="macro">assert_eq!</span>(map[<span class="string">"lorem"</span>], <span class="string">"orem"</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::IndexMap;
<span class="kw">let </span><span class="kw-2">mut </span>map = IndexMap::new();
map.insert(<span class="string">"foo"</span>, <span class="number">1</span>);
map[<span class="number">10</span>] = <span class="number">1</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_mut-8" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#1452-1456">source</a><a href="#method.index_mut-8" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.83.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut" class="fn">index_mut</a>(&amp;mut self, index: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;mut V</a></h4></section></summary><div class="docblock"><p>Returns a mutable 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></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IntoIterator-for-%26IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map/iter.rs.html#11-18">source</a><a href="#impl-IntoIterator-for-%26IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, K, V, S&gt; <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 &amp;'a <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</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/map/iter.rs.html#12">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">&amp;'a K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;'a V</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/map/iter.rs.html#13">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::map::Iter">Iter</a>&lt;'a, K, V&gt;</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/map/iter.rs.html#15-17">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) -&gt; 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-%26mut+IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map/iter.rs.html#20-27">source</a><a href="#impl-IntoIterator-for-%26mut+IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, K, V, S&gt; <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 &amp;'a mut <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Item-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/map/iter.rs.html#21">source</a><a href="#associatedtype.Item-1" 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">&amp;'a K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;'a mut V</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-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/map/iter.rs.html#22">source</a><a href="#associatedtype.IntoIter-1" 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.IterMut.html" title="struct indexmap::map::IterMut">IterMut</a>&lt;'a, K, V&gt;</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-1" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/iter.rs.html#24-26">source</a><a href="#method.into_iter-1" 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) -&gt; 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-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map/iter.rs.html#29-36">source</a><a href="#impl-IntoIterator-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Item-2" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/map/iter.rs.html#30">source</a><a href="#associatedtype.Item-2" 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.tuple.html">(K, V)</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-2" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/map/iter.rs.html#31">source</a><a href="#associatedtype.IntoIter-2" 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.IntoIter.html" title="struct indexmap::map::IntoIter">IntoIter</a>&lt;K, V&gt;</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-2" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/iter.rs.html#33-35">source</a><a href="#method.into_iter-2" 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) -&gt; 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-MutableKeys-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map/mutable.rs.html#58-91">source</a><a href="#impl-MutableKeys-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <a class="trait" href="trait.MutableKeys.html" title="trait indexmap::map::MutableKeys">MutableKeys</a> for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;<div class="where">where
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="docblock"><p>Opt-in mutable access to <a href="struct.IndexMap.html" title="struct indexmap::map::IndexMap"><code>IndexMap</code></a> keys.</p>
<p>See <a href="trait.MutableKeys.html" title="trait indexmap::map::MutableKeys"><code>MutableKeys</code></a> for more information.</p>
</div><div class="impl-items"><section id="associatedtype.Key" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/map/mutable.rs.html#62">source</a><a href="#associatedtype.Key" class="anchor">§</a><h4 class="code-header">type <a href="trait.MutableKeys.html#associatedtype.Key" class="associatedtype">Key</a> = K</h4></section><section id="associatedtype.Value" class="associatedtype trait-impl"><a class="src rightside" href="../../src/indexmap/map/mutable.rs.html#63">source</a><a href="#associatedtype.Value" class="anchor">§</a><h4 class="code-header">type <a href="trait.MutableKeys.html#associatedtype.Value" class="associatedtype">Value</a> = V</h4></section><details class="toggle method-toggle" open><summary><section id="method.get_full_mut2" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/mutable.rs.html#65-75">source</a><a href="#method.get_full_mut2" class="anchor">§</a><h4 class="code-header">fn <a href="trait.MutableKeys.html#tymethod.get_full_mut2" class="fn">get_full_mut2</a>&lt;Q&gt;(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Q</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<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">&amp;mut K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;mut V</a>)&gt;<div class="where">where
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> + <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>&lt;K&gt;,</div></h4></section></summary><div class='docblock'>Return item index, mutable reference to key and value <a href="trait.MutableKeys.html#tymethod.get_full_mut2">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.get_index_mut2" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/mutable.rs.html#77-79">source</a><a href="#method.get_index_mut2" class="anchor">§</a><h4 class="code-header">fn <a href="trait.MutableKeys.html#tymethod.get_index_mut2" class="fn">get_index_mut2</a>(&amp;mut self, index: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;mut K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;mut V</a>)&gt;</h4></section></summary><div class='docblock'>Return mutable reference to key and value at an index. <a href="trait.MutableKeys.html#tymethod.get_index_mut2">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.iter_mut2" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/mutable.rs.html#81-83">source</a><a href="#method.iter_mut2" class="anchor">§</a><h4 class="code-header">fn <a href="trait.MutableKeys.html#tymethod.iter_mut2" class="fn">iter_mut2</a>(&amp;mut self) -&gt; <a class="struct" href="struct.IterMut2.html" title="struct indexmap::map::IterMut2">IterMut2</a>&lt;'_, Self::<a class="associatedtype" href="trait.MutableKeys.html#associatedtype.Key" title="type indexmap::map::MutableKeys::Key">Key</a>, Self::<a class="associatedtype" href="trait.MutableKeys.html#associatedtype.Value" title="type indexmap::map::MutableKeys::Value">Value</a>&gt; <a href="#" class="tooltip" data-notable-ty="IterMut2&lt;&#39;_, Self::Key, Self::Value&gt;"></a></h4></section></summary><div class='docblock'>Return an iterator over the key-value pairs of the map, in their order</div></details><details class="toggle method-toggle" open><summary><section id="method.retain2" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/mutable.rs.html#85-90">source</a><a href="#method.retain2" class="anchor">§</a><h4 class="code-header">fn <a href="trait.MutableKeys.html#tymethod.retain2" class="fn">retain2</a>&lt;F&gt;(&amp;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">&amp;mut K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;mut V</a>) -&gt; <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'>Scan through each key-value pair in the map and keep those where the
closure <code>keep</code> returns <code>true</code>. <a href="trait.MutableKeys.html#tymethod.retain2">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CIndexMap%3CK,+V2,+S2%3E%3E-for-IndexMap%3CK,+V1,+S1%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#1555-1570">source</a><a href="#impl-PartialEq%3CIndexMap%3CK,+V2,+S2%3E%3E-for-IndexMap%3CK,+V1,+S1%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V1, S1, V2, S2&gt; <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V2, S2&gt;&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V1, S1&gt;<div class="where">where
K: <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>,
V1: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;V2&gt;,
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/map.rs.html#1562-1569">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>(&amp;self, other: &amp;<a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V2, S2&gt;) -&gt; <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>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <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-RawEntryApiV1%3CK,+V,+S%3E-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map/core/raw_entry_v1.rs.html#175-183">source</a><a href="#impl-RawEntryApiV1%3CK,+V,+S%3E-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <a class="trait" href="raw_entry_v1/trait.RawEntryApiV1.html" title="trait indexmap::map::raw_entry_v1::RawEntryApiV1">RawEntryApiV1</a>&lt;K, V, S&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.raw_entry_v1" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/core/raw_entry_v1.rs.html#176-178">source</a><a href="#method.raw_entry_v1" class="anchor">§</a><h4 class="code-header">fn <a href="raw_entry_v1/trait.RawEntryApiV1.html#tymethod.raw_entry_v1" class="fn">raw_entry_v1</a>(&amp;self) -&gt; <a class="struct" href="raw_entry_v1/struct.RawEntryBuilder.html" title="struct indexmap::map::raw_entry_v1::RawEntryBuilder">RawEntryBuilder</a>&lt;'_, K, V, S&gt;</h4></section></summary><div class='docblock'>Creates a raw immutable entry builder for the <a href="struct.IndexMap.html" title="struct indexmap::map::IndexMap"><code>IndexMap</code></a>. <a href="raw_entry_v1/trait.RawEntryApiV1.html#tymethod.raw_entry_v1">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.raw_entry_mut_v1" class="method trait-impl"><a class="src rightside" href="../../src/indexmap/map/core/raw_entry_v1.rs.html#180-182">source</a><a href="#method.raw_entry_mut_v1" class="anchor">§</a><h4 class="code-header">fn <a href="raw_entry_v1/trait.RawEntryApiV1.html#tymethod.raw_entry_mut_v1" class="fn">raw_entry_mut_v1</a>(&amp;mut self) -&gt; <a class="struct" href="raw_entry_v1/struct.RawEntryBuilderMut.html" title="struct indexmap::map::raw_entry_v1::RawEntryBuilderMut">RawEntryBuilderMut</a>&lt;'_, K, V, S&gt;</h4></section></summary><div class='docblock'>Creates a raw entry builder for the <a href="struct.IndexMap.html" title="struct indexmap::map::IndexMap"><code>IndexMap</code></a>. <a href="raw_entry_v1/trait.RawEntryApiV1.html#tymethod.raw_entry_mut_v1">Read more</a></div></details></div></details><section id="impl-Eq-for-IndexMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../../src/indexmap/map.rs.html#1572-1578">source</a><a href="#impl-Eq-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;<div class="where">where
K: <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>,
V: <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></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-IndexMap%3CK,+V,+S%3E" class="impl"><a href="#impl-Freeze-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;<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-IndexMap%3CK,+V,+S%3E" class="impl"><a href="#impl-RefUnwindSafe-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;<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>,
K: <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>,
V: <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-IndexMap%3CK,+V,+S%3E" class="impl"><a href="#impl-Send-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;<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>,
K: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,
V: <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-IndexMap%3CK,+V,+S%3E" class="impl"><a href="#impl-Sync-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;<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>,
K: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,
V: <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-IndexMap%3CK,+V,+S%3E" class="impl"><a href="#impl-Unpin-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;<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>,
K: <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,
V: <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-IndexMap%3CK,+V,+S%3E" class="impl"><a href="#impl-UnwindSafe-for-IndexMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;K, V, S&gt; <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.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt;<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>,
K: <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>,
V: <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&lt;T&gt; <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>(&amp;self) -&gt; <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&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; 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>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;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&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; 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>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;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&lt;T&gt; <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>(&amp;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/hashbrown/lib.rs.html#159-162">source</a><a href="#impl-Equivalent%3CK%3E-for-Q" class="anchor">§</a><h3 class="code-header">impl&lt;Q, K&gt; <a class="trait" href="../../hashbrown/trait.Equivalent.html" title="trait hashbrown::Equivalent">Equivalent</a>&lt;K&gt; 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>&lt;Q&gt; + ?<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/hashbrown/lib.rs.html#164">source</a><a href="#method.equivalent" class="anchor">§</a><h4 class="code-header">fn <a href="../../hashbrown/trait.Equivalent.html#tymethod.equivalent" class="fn">equivalent</a>(&amp;self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;K</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Checks if this value is equivalent to the given key. <a href="../../hashbrown/trait.Equivalent.html#tymethod.equivalent">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Equivalent%3CK%3E-for-Q-1" class="impl"><a class="src rightside" href="../../src/equivalent/lib.rs.html#82-85">source</a><a href="#impl-Equivalent%3CK%3E-for-Q-1" class="anchor">§</a><h3 class="code-header">impl&lt;Q, K&gt; <a class="trait" href="../trait.Equivalent.html" title="trait indexmap::Equivalent">Equivalent</a>&lt;K&gt; 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>&lt;Q&gt; + ?<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-1" class="method trait-impl"><a class="src rightside" href="../../src/equivalent/lib.rs.html#88">source</a><a href="#method.equivalent-1" class="anchor">§</a><h4 class="code-header">fn <a href="../trait.Equivalent.html#tymethod.equivalent" class="fn">equivalent</a>(&amp;self, key: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;K</a>) -&gt; <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&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; 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) -&gt; 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&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; 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>&lt;T&gt;,</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) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code><a href="https://doc.rust-lang.org/1.83.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; 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&lt;T&gt; <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>(&amp;self) -&gt; 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>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.reference.html">&amp;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&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; 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>&lt;T&gt;,</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) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;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>&lt;U&gt;&gt;::<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>&gt;</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&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.83.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; 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>&lt;T&gt;,</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> = &lt;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>&lt;T&gt;&gt;::<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) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.83.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;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>&lt;T&gt;&gt;::<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>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div><script type="text/json" id="notable-traits-data">{"Drain<'_, K, V>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Drain.html\" title=\"struct indexmap::map::Drain\">Drain</a>&lt;'_, K, V&gt;</code></h3><pre><code><div class=\"where\">impl&lt;K, V&gt; <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::map::Drain\">Drain</a>&lt;'_, K, V&gt;</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.tuple.html\">(K, V)</a>;</div>","IntoIter<K, V>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.IntoIter.html\" title=\"struct indexmap::map::IntoIter\">IntoIter</a>&lt;K, V&gt;</code></h3><pre><code><div class=\"where\">impl&lt;K, V&gt; <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.IntoIter.html\" title=\"struct indexmap::map::IntoIter\">IntoIter</a>&lt;K, V&gt;</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.tuple.html\">(K, V)</a>;</div>","IntoKeys<K, V>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.IntoKeys.html\" title=\"struct indexmap::map::IntoKeys\">IntoKeys</a>&lt;K, V&gt;</code></h3><pre><code><div class=\"where\">impl&lt;K, V&gt; <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.IntoKeys.html\" title=\"struct indexmap::map::IntoKeys\">IntoKeys</a>&lt;K, V&gt;</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> = K;</div>","IntoValues<K, V>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.IntoValues.html\" title=\"struct indexmap::map::IntoValues\">IntoValues</a>&lt;K, V&gt;</code></h3><pre><code><div class=\"where\">impl&lt;K, V&gt; <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.IntoValues.html\" title=\"struct indexmap::map::IntoValues\">IntoValues</a>&lt;K, V&gt;</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> = V;</div>","Iter<'_, K, V>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Iter.html\" title=\"struct indexmap::map::Iter\">Iter</a>&lt;'a, K, V&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, K, V&gt; <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.Iter.html\" title=\"struct indexmap::map::Iter\">Iter</a>&lt;'a, K, V&gt;</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\">&amp;'a K</a>, <a class=\"primitive\" href=\"https://doc.rust-lang.org/1.83.0/std/primitive.reference.html\">&amp;'a V</a>);</div>","IterMut2<'_, Self::Key, Self::Value>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.IterMut2.html\" title=\"struct indexmap::map::IterMut2\">IterMut2</a>&lt;'a, K, V&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, K, V&gt; <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.IterMut2.html\" title=\"struct indexmap::map::IterMut2\">IterMut2</a>&lt;'a, K, V&gt;</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\">&amp;'a mut K</a>, <a class=\"primitive\" href=\"https://doc.rust-lang.org/1.83.0/std/primitive.reference.html\">&amp;'a mut V</a>);</div>","IterMut<'_, K, V>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.IterMut.html\" title=\"struct indexmap::map::IterMut\">IterMut</a>&lt;'a, K, V&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, K, V&gt; <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.IterMut.html\" title=\"struct indexmap::map::IterMut\">IterMut</a>&lt;'a, K, V&gt;</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\">&amp;'a K</a>, <a class=\"primitive\" href=\"https://doc.rust-lang.org/1.83.0/std/primitive.reference.html\">&amp;'a mut V</a>);</div>","Keys<'_, K, V>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Keys.html\" title=\"struct indexmap::map::Keys\">Keys</a>&lt;'a, K, V&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, K, V&gt; <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.Keys.html\" title=\"struct indexmap::map::Keys\">Keys</a>&lt;'a, K, V&gt;</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\">&amp;'a K</a>;</div>","Splice<'_, I::IntoIter, K, V, S>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Splice.html\" title=\"struct indexmap::map::Splice\">Splice</a>&lt;'_, I, K, V, S&gt;</code></h3><pre><code><div class=\"where\">impl&lt;I, K, V, S&gt; <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.Splice.html\" title=\"struct indexmap::map::Splice\">Splice</a>&lt;'_, I, K, V, S&gt;<div class=\"where\">where\n I: <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>&lt;Item = <a class=\"primitive\" href=\"https://doc.rust-lang.org/1.83.0/std/primitive.tuple.html\">(K, V)</a>&gt;,\n K: <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>,\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.tuple.html\">(K, V)</a>;</div>","Values<'_, K, V>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Values.html\" title=\"struct indexmap::map::Values\">Values</a>&lt;'a, K, V&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, K, V&gt; <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.Values.html\" title=\"struct indexmap::map::Values\">Values</a>&lt;'a, K, V&gt;</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\">&amp;'a V</a>;</div>","ValuesMut<'_, K, V>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.ValuesMut.html\" title=\"struct indexmap::map::ValuesMut\">ValuesMut</a>&lt;'a, K, V&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, K, V&gt; <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.ValuesMut.html\" title=\"struct indexmap::map::ValuesMut\">ValuesMut</a>&lt;'a, K, V&gt;</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\">&amp;'a mut V</a>;</div>"}</script></section></div></main></body></html>