This repository has been archived on 2022-04-04. You can view files and clone it, but cannot push or open issues or pull requests.
ludum-dare-50/rustdoc/indexmap/map/struct.IndexMap.html

374 lines
166 KiB
HTML
Raw 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."><meta name="keywords" content="rust, rustlang, rust-lang, IndexMap"><title>IndexMap in indexmap::map - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a class="sidebar-logo" href="../../indexmap/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.png" alt="logo"></div>
</a><h2 class="location">Struct IndexMap</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.capacity">capacity</a><a href="#method.clear">clear</a><a href="#method.contains_key">contains_key</a><a href="#method.drain">drain</a><a href="#method.entry">entry</a><a href="#method.first">first</a><a href="#method.first_mut">first_mut</a><a href="#method.get">get</a><a href="#method.get_full">get_full</a><a href="#method.get_full_mut">get_full_mut</a><a href="#method.get_index">get_index</a><a href="#method.get_index_mut">get_index_mut</a><a href="#method.get_index_of">get_index_of</a><a href="#method.get_key_value">get_key_value</a><a href="#method.get_mut">get_mut</a><a href="#method.hasher">hasher</a><a href="#method.insert">insert</a><a href="#method.insert_full">insert_full</a><a href="#method.into_keys">into_keys</a><a href="#method.into_values">into_values</a><a href="#method.is_empty">is_empty</a><a href="#method.iter">iter</a><a href="#method.iter_mut">iter_mut</a><a href="#method.keys">keys</a><a href="#method.last">last</a><a href="#method.last_mut">last_mut</a><a href="#method.len">len</a><a href="#method.new">new</a><a href="#method.pop">pop</a><a href="#method.remove">remove</a><a href="#method.remove_entry">remove_entry</a><a href="#method.reserve">reserve</a><a href="#method.retain">retain</a><a href="#method.reverse">reverse</a><a href="#method.shift_remove">shift_remove</a><a href="#method.shift_remove_entry">shift_remove_entry</a><a href="#method.shift_remove_full">shift_remove_full</a><a href="#method.shift_remove_index">shift_remove_index</a><a href="#method.shrink_to_fit">shrink_to_fit</a><a href="#method.sort_by">sort_by</a><a href="#method.sort_keys">sort_keys</a><a href="#method.sort_unstable_by">sort_unstable_by</a><a href="#method.sort_unstable_keys">sort_unstable_keys</a><a href="#method.sorted_by">sorted_by</a><a href="#method.sorted_unstable_by">sorted_unstable_by</a><a href="#method.split_off">split_off</a><a href="#method.swap_indices">swap_indices</a><a href="#method.swap_remove">swap_remove</a><a href="#method.swap_remove_entry">swap_remove_entry</a><a href="#method.swap_remove_full">swap_remove_full</a><a href="#method.swap_remove_index">swap_remove_index</a><a href="#method.truncate">truncate</a><a href="#method.values">values</a><a href="#method.values_mut">values_mut</a><a href="#method.with_capacity">with_capacity</a><a href="#method.with_capacity_and_hasher">with_capacity_and_hasher</a><a href="#method.with_hasher">with_hasher</a></div><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Eq">Eq</a><a href="#impl-Extend%3C(%26%27a%20K%2C%20%26%27a%20V)%3E">Extend&lt;(&amp;&#39;a K, &amp;&#39;a V)&gt;</a><a href="#impl-Extend%3C(K%2C%20V)%3E">Extend&lt;(K, V)&gt;</a><a href="#impl-From%3C%5B(K%2C%20V)%3B%20N%5D%3E">From&lt;[(K, V); N]&gt;</a><a href="#impl-FromIterator%3C(K%2C%20V)%3E">FromIterator&lt;(K, V)&gt;</a><a href="#impl-Index%3C%26%27_%20Q%3E">Index&lt;&amp;&#39;_ Q&gt;</a><a href="#impl-Index%3Cusize%3E">Index&lt;usize&gt;</a><a href="#impl-IndexMut%3C%26%27_%20Q%3E">IndexMut&lt;&amp;&#39;_ Q&gt;</a><a href="#impl-IndexMut%3Cusize%3E">IndexMut&lt;usize&gt;</a><a href="#impl-IntoIterator">IntoIterator</a><a href="#impl-MutableKeys">MutableKeys</a><a href="#impl-PartialEq%3CIndexMap%3CK%2C%20V2%2C%20S2%3E%3E">PartialEq&lt;IndexMap&lt;K, V2, S2&gt;&gt;</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><h2 class="location">Other items in<br><a href="../index.html">indexmap</a>::<wbr><a href="index.html">map</a></h2><div id="sidebar-vars" data-name="IndexMap" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../indexmap/index.html"><img class="rust-logo" src="../../rust-logo.png" alt="logo"></a><nav class="sub"><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="../index.html">indexmap</a>::<wbr><a href="index.html">map</a>::<wbr><a class="struct" href="#">IndexMap</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/indexmap/map.rs.html#71-74" title="goto source code">[src]</a></span></h1><div class="docblock item-decl"><pre class="rust struct"><code>pub struct IndexMap&lt;K, V, S&nbsp;=&nbsp;<a class="struct" href="https://doc.rust-lang.org/1.59.0/std/collections/hash/map/struct.RandomState.html" title="struct std::collections::hash::map::RandomState">RandomState</a>&gt; { /* fields omitted */ }</code></pre></div><details class="rustdoc-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 <code>HashMap</code>, but also
has additional features.</p>
<h2 id="order" class="section-header"><a href="#order">Order</a></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
<code>.remove()</code> or <code>.swap_remove()</code> methods. Methods such as <code>.sort_by()</code> of
course result in a new order, depending on the sorting order.</p>
<h2 id="indices" class="section-header"><a href="#indices">Indices</a></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" class="section-header"><a href="#examples">Examples</a></h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">indexmap::IndexMap</span>;
<span class="comment">// count the frequency of each letter in a sentence.</span>
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">letters</span> <span class="op">=</span> <span class="ident">IndexMap::new</span>();
<span class="kw">for</span> <span class="ident">ch</span> <span class="kw">in</span> <span class="string">&quot;a short treatise on fungi&quot;</span>.<span class="ident">chars</span>() {
<span class="kw-2">*</span><span class="ident">letters</span>.<span class="ident">entry</span>(<span class="ident">ch</span>).<span class="ident">or_insert</span>(<span class="number">0</span>) <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
}
<span class="macro">assert_eq!</span>(<span class="ident">letters</span>[<span class="kw-2">&amp;</span><span class="string">&#39;s&#39;</span>], <span class="number">2</span>);
<span class="macro">assert_eq!</span>(<span class="ident">letters</span>[<span class="kw-2">&amp;</span><span class="string">&#39;t&#39;</span>], <span class="number">3</span>);
<span class="macro">assert_eq!</span>(<span class="ident">letters</span>[<span class="kw-2">&amp;</span><span class="string">&#39;u&#39;</span>], <span class="number">1</span>);
<span class="macro">assert_eq!</span>(<span class="ident">letters</span>.<span class="ident">get</span>(<span class="kw-2">&amp;</span><span class="string">&#39;y&#39;</span>), <span class="prelude-val">None</span>);</code></pre></div>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#144-159" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl&lt;K, V&gt; <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V&gt;</h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.new" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#147-149" title="goto source code">[src]</a></div><a href="#method.new" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.new" class="fnname">new</a>() -&gt; Self</h4></div></summary><div class="docblock"><p>Create a new map. (Does not allocate.)</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.with_capacity" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#156-158" title="goto source code">[src]</a></div><a href="#method.with_capacity" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.with_capacity" class="fnname">with_capacity</a>(n: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>) -&gt; Self</h4></div></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="rustdoc-toggle implementors-toggle" open><summary><div id="impl-1" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#161-317" title="goto source code">[src]</a></div><a href="#impl-1" class="anchor"></a><h3 class="code-header in-band">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></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.with_capacity_and_hasher" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#167-176" title="goto source code">[src]</a></div><a href="#method.with_capacity_and_hasher" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.with_capacity_and_hasher" class="fnname">with_capacity_and_hasher</a>(n: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>, hash_builder: S) -&gt; Self</h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.with_hasher" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#182-187" title="goto source code">[src]</a></div><a href="#method.with_hasher" class="anchor"></a><h4 class="code-header">pub const fn <a href="#method.with_hasher" class="fnname">with_hasher</a>(hash_builder: S) -&gt; Self</h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.capacity" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#190-192" title="goto source code">[src]</a></div><a href="#method.capacity" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.capacity" class="fnname">capacity</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a></h4></div></summary><div class="docblock"><p>Computes in <strong>O(1)</strong> time.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.hasher" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#195-197" title="goto source code">[src]</a></div><a href="#method.hasher" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.hasher" class="fnname">hasher</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>S</h4></div></summary><div class="docblock"><p>Return a reference to the maps <code>BuildHasher</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.len" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#203-205" title="goto source code">[src]</a></div><a href="#method.len" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.len" class="fnname">len</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a></h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.is_empty" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#211-213" title="goto source code">[src]</a></div><a href="#method.is_empty" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.is_empty" class="fnname">is_empty</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.bool.html">bool</a></h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.iter" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#216-220" title="goto source code">[src]</a></div><a href="#method.iter" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.iter" class="fnname">iter</a>(&amp;self) -&gt; <a class="struct" href="struct.Iter.html" title="struct indexmap::map::Iter">Iter</a>&lt;'_, K, V&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><div class="notable">Notable traits for <a class="struct" href="struct.Iter.html" title="struct indexmap::map::Iter">Iter</a>&lt;'a, K, V&gt;</div><code class="content"><span class="where fmt-newline">impl&lt;'a, K, V&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;'a </a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;'a </a>V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>;</span></code></span></div></span></span></h4></div></summary><div class="docblock"><p>Return an iterator over the key-value pairs of the map, in their order</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.iter_mut" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#223-227" title="goto source code">[src]</a></div><a href="#method.iter_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.iter_mut" class="fnname">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;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><div class="notable">Notable traits for <a class="struct" href="struct.IterMut.html" title="struct indexmap::map::IterMut">IterMut</a>&lt;'a, K, V&gt;</div><code class="content"><span class="where fmt-newline">impl&lt;'a, K, V&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;'a </a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;'a mut </a>V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>;</span></code></span></div></span></span></h4></div></summary><div class="docblock"><p>Return an iterator over the key-value pairs of the map, in their order</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.keys" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#230-234" title="goto source code">[src]</a></div><a href="#method.keys" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.keys" class="fnname">keys</a>(&amp;self) -&gt; <a class="struct" href="struct.Keys.html" title="struct indexmap::map::Keys">Keys</a>&lt;'_, K, V&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><div class="notable">Notable traits for <a class="struct" href="struct.Keys.html" title="struct indexmap::map::Keys">Keys</a>&lt;'a, K, V&gt;</div><code class="content"><span class="where fmt-newline">impl&lt;'a, K, V&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;'a </a>K;</span></code></span></div></span></span></h4></div></summary><div class="docblock"><p>Return an iterator over the keys of the map, in their order</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into_keys" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#237-241" title="goto source code">[src]</a></div><a href="#method.into_keys" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.into_keys" class="fnname">into_keys</a>(self) -&gt; <a class="struct" href="struct.IntoKeys.html" title="struct indexmap::map::IntoKeys">IntoKeys</a>&lt;K, V&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><div class="notable">Notable traits for <a class="struct" href="struct.IntoKeys.html" title="struct indexmap::map::IntoKeys">IntoKeys</a>&lt;K, V&gt;</div><code class="content"><span class="where fmt-newline">impl&lt;K, V&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = K;</span></code></span></div></span></span></h4></div></summary><div class="docblock"><p>Return an owning iterator over the keys of the map, in their order</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.values" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#244-248" title="goto source code">[src]</a></div><a href="#method.values" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.values" class="fnname">values</a>(&amp;self) -&gt; <a class="struct" href="struct.Values.html" title="struct indexmap::map::Values">Values</a>&lt;'_, K, V&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><div class="notable">Notable traits for <a class="struct" href="struct.Values.html" title="struct indexmap::map::Values">Values</a>&lt;'a, K, V&gt;</div><code class="content"><span class="where fmt-newline">impl&lt;'a, K, V&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;'a </a>V;</span></code></span></div></span></span></h4></div></summary><div class="docblock"><p>Return an iterator over the values of the map, in their order</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.values_mut" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#252-256" title="goto source code">[src]</a></div><a href="#method.values_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.values_mut" class="fnname">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;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><div class="notable">Notable traits for <a class="struct" href="struct.ValuesMut.html" title="struct indexmap::map::ValuesMut">ValuesMut</a>&lt;'a, K, V&gt;</div><code class="content"><span class="where fmt-newline">impl&lt;'a, K, V&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;'a mut </a>V;</span></code></span></div></span></span></h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.into_values" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#259-263" title="goto source code">[src]</a></div><a href="#method.into_values" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.into_values" class="fnname">into_values</a>(self) -&gt; <a class="struct" href="struct.IntoValues.html" title="struct indexmap::map::IntoValues">IntoValues</a>&lt;K, V&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><div class="notable">Notable traits for <a class="struct" href="struct.IntoValues.html" title="struct indexmap::map::IntoValues">IntoValues</a>&lt;K, V&gt;</div><code class="content"><span class="where fmt-newline">impl&lt;K, V&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = V;</span></code></span></div></span></span></h4></div></summary><div class="docblock"><p>Return an owning iterator over the values of the map, in their order</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clear" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#268-270" title="goto source code">[src]</a></div><a href="#method.clear" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.clear" class="fnname">clear</a>(&amp;mut self)</h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.truncate" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#275-277" title="goto source code">[src]</a></div><a href="#method.truncate" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.truncate" class="fnname">truncate</a>(&amp;mut self, len: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>)</h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.drain" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#292-299" title="goto source code">[src]</a></div><a href="#method.drain" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.drain" class="fnname">drain</a>&lt;R&gt;(&amp;mut self, range: R) -&gt; <a class="struct" href="struct.Drain.html" title="struct indexmap::map::Drain">Drain</a>&lt;'_, K, V&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><div class="notable">Notable traits for <a class="struct" href="struct.Drain.html" title="struct indexmap::map::Drain">Drain</a>&lt;'_, K, V&gt;</div><code class="content"><span class="where fmt-newline">impl&lt;K, V&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a>K, V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="https://doc.rust-lang.org/1.59.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.59.0/std/primitive.usize.html">usize</a>&gt;,&nbsp;</span></h4></div></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 <code>RangeBounds&lt;usize&gt;</code>,
including all of the <code>std::ops::Range*</code> types, or even a tuple pair of
<code>Bound</code> start and end values. To drain the 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="rustdoc-toggle method-toggle" open><summary><div id="method.split_off" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#308-316" title="goto source code">[src]</a></div><a href="#method.split_off" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.split_off" class="fnname">split_off</a>(&amp;mut self, at: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>) -&gt; Self <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&nbsp;</span></h4></div></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></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-2" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#319-766" title="goto source code">[src]</a></div><a href="#impl-2" class="anchor"></a><h3 class="code-header in-band">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; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.reserve" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#327-329" title="goto source code">[src]</a></div><a href="#method.reserve" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.reserve" class="fnname">reserve</a>(&amp;mut self, additional: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>)</h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.shrink_to_fit" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#334-336" title="goto source code">[src]</a></div><a href="#method.shrink_to_fit" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.shrink_to_fit" class="fnname">shrink_to_fit</a>(&amp;mut self)</h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.insert" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#357-359" title="goto source code">[src]</a></div><a href="#method.insert" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.insert" class="fnname">insert</a>(&amp;mut self, key: K, value: V) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;V&gt;</h4></div></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="#method.entry"><code>entry</code></a> if you you want to insert <em>or</em> modify
or if you need to get the index of the corresponding key-value pair.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.insert_full" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#374-377" title="goto source code">[src]</a></div><a href="#method.insert_full" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.insert_full" class="fnname">insert_full</a>(&amp;mut self, key: K, value: V) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>, <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;V&gt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a></h4></div></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="#method.entry"><code>entry</code></a> if you you want to insert <em>or</em> modify
or if you need to get the index of the corresponding key-value pair.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.entry" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#383-386" title="goto source code">[src]</a></div><a href="#method.entry" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.entry" class="fnname">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></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.contains_key" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#391-396" title="goto source code">[src]</a></div><a href="#method.contains_key" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.contains_key" class="fnname">contains_key</a>&lt;Q:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;self, key: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>Q) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="https://doc.rust-lang.org/1.59.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;,&nbsp;</span></h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.get" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#402-412" title="goto source code">[src]</a></div><a href="#method.get" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.get" class="fnname">get</a>&lt;Q:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;self, key: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>Q) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>V&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="https://doc.rust-lang.org/1.59.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;,&nbsp;</span></h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.get_key_value" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#418-428" title="goto source code">[src]</a></div><a href="#method.get_key_value" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.get_key_value" class="fnname">get_key_value</a>&lt;Q:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;self, key: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>Q) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="https://doc.rust-lang.org/1.59.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;,&nbsp;</span></h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.get_full" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#431-441" title="goto source code">[src]</a></div><a href="#method.get_full" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.get_full" class="fnname">get_full</a>&lt;Q:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;self, key: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>Q) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="https://doc.rust-lang.org/1.59.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;,&nbsp;</span></h4></div></summary><div class="docblock"><p>Return item index, key and value</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.get_index_of" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#446-456" title="goto source code">[src]</a></div><a href="#method.get_index_of" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.get_index_of" class="fnname">get_index_of</a>&lt;Q:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;self, key: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>Q) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="https://doc.rust-lang.org/1.59.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;,&nbsp;</span></h4></div></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><div id="method.get_mut" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#458-468" title="goto source code">[src]</a></div><a href="#method.get_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.get_mut" class="fnname">get_mut</a>&lt;Q:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>Q) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;mut </a>V&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="https://doc.rust-lang.org/1.59.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;,&nbsp;</span></h4></div><div id="method.get_full_mut" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#470-480" title="goto source code">[src]</a></div><a href="#method.get_full_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.get_full_mut" class="fnname">get_full_mut</a>&lt;Q:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;key: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>Q<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;mut </a>V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="https://doc.rust-lang.org/1.59.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;,&nbsp;</span></h4></div><details class="rustdoc-toggle method-toggle" open><summary><div id="method.remove" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#505-510" title="goto source code">[src]</a></div><a href="#method.remove" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.remove" class="fnname">remove</a>&lt;Q:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>Q) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;V&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="https://doc.rust-lang.org/1.59.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;,&nbsp;</span></h4></div></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 <code>.swap_remove(key)</code>, if you need to
preserve the order of the keys in the map, use <code>.shift_remove(key)</code>
instead.</p>
<p>Computes in <strong>O(1)</strong> time (average).</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.remove_entry" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#519-524" title="goto source code">[src]</a></div><a href="#method.remove_entry" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.remove_entry" class="fnname">remove_entry</a>&lt;Q:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>Q) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a>K, V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="https://doc.rust-lang.org/1.59.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;,&nbsp;</span></h4></div></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 <code>.swap_remove_entry(key)</code>, if you need to
preserve the order of the keys in the map, use <code>.shift_remove_entry(key)</code>
instead.</p>
<p>Computes in <strong>O(1)</strong> time (average).</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.swap_remove" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#536-541" title="goto source code">[src]</a></div><a href="#method.swap_remove" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.swap_remove" class="fnname">swap_remove</a>&lt;Q:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>Q) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;V&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="https://doc.rust-lang.org/1.59.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;,&nbsp;</span></h4></div></summary><div class="docblock"><p>Remove the key-value pair equivalent to <code>key</code> and return
its value.</p>
<p>Like <code>Vec::swap_remove</code>, 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="rustdoc-toggle method-toggle" open><summary><div id="method.swap_remove_entry" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#552-560" title="goto source code">[src]</a></div><a href="#method.swap_remove_entry" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.swap_remove_entry" class="fnname">swap_remove_entry</a>&lt;Q:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>Q) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a>K, V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="https://doc.rust-lang.org/1.59.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;,&nbsp;</span></h4></div></summary><div class="docblock"><p>Remove and return the key-value pair equivalent to <code>key</code>.</p>
<p>Like <code>Vec::swap_remove</code>, 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="rustdoc-toggle method-toggle" open><summary><div id="method.swap_remove_full" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#572-581" title="goto source code">[src]</a></div><a href="#method.swap_remove_full" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.swap_remove_full" class="fnname">swap_remove_full</a>&lt;Q:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>Q) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>, K, V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="https://doc.rust-lang.org/1.59.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;,&nbsp;</span></h4></div></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 <code>Vec::swap_remove</code>, 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="rustdoc-toggle method-toggle" open><summary><div id="method.shift_remove" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#593-598" title="goto source code">[src]</a></div><a href="#method.shift_remove" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.shift_remove" class="fnname">shift_remove</a>&lt;Q:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>Q) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;V&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="https://doc.rust-lang.org/1.59.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;,&nbsp;</span></h4></div></summary><div class="docblock"><p>Remove the key-value pair equivalent to <code>key</code> and return
its value.</p>
<p>Like <code>Vec::remove</code>, 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="rustdoc-toggle method-toggle" open><summary><div id="method.shift_remove_entry" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#609-617" title="goto source code">[src]</a></div><a href="#method.shift_remove_entry" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.shift_remove_entry" class="fnname">shift_remove_entry</a>&lt;Q:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>Q) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a>K, V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="https://doc.rust-lang.org/1.59.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;,&nbsp;</span></h4></div></summary><div class="docblock"><p>Remove and return the key-value pair equivalent to <code>key</code>.</p>
<p>Like <code>Vec::remove</code>, 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="rustdoc-toggle method-toggle" open><summary><div id="method.shift_remove_full" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#629-638" title="goto source code">[src]</a></div><a href="#method.shift_remove_full" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.shift_remove_full" class="fnname">shift_remove_full</a>&lt;Q:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>Q) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>, K, V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="https://doc.rust-lang.org/1.59.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;,&nbsp;</span></h4></div></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 <code>Vec::remove</code>, 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="rustdoc-toggle method-toggle" open><summary><div id="method.pop" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#645-647" title="goto source code">[src]</a></div><a href="#method.pop" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.pop" class="fnname">pop</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a>K, V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt;</h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.retain" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#656-661" title="goto source code">[src]</a></div><a href="#method.retain" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.retain" class="fnname">retain</a>&lt;F&gt;(&amp;mut self, keep: F) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.59.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.59.0/std/primitive.reference.html">&amp;</a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;mut </a>V) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.bool.html">bool</a>,&nbsp;</span></h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.sort_keys" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#673-680" title="goto source code">[src]</a></div><a href="#method.sort_keys" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.sort_keys" class="fnname">sort_keys</a>(&amp;mut self) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>Sort the maps key-value pairs by the default ordering of the keys.</p>
<p>See <a href="struct.IndexMap.html#method.sort_by"><code>sort_by</code></a> for details.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.sort_by" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#690-697" title="goto source code">[src]</a></div><a href="#method.sort_by" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.sort_by" class="fnname">sort_by</a>&lt;F&gt;(&amp;mut self, cmp: F) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.59.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.59.0/std/primitive.reference.html">&amp;</a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>V, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>V) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>,&nbsp;</span></h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.sorted_by" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#703-712" title="goto source code">[src]</a></div><a href="#method.sorted_by" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.sorted_by" class="fnname">sorted_by</a>&lt;F&gt;(self, cmp: F) -&gt; <a class="struct" href="struct.IntoIter.html" title="struct indexmap::map::IntoIter">IntoIter</a>&lt;K, V&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><div class="notable">Notable traits for <a class="struct" href="struct.IntoIter.html" title="struct indexmap::map::IntoIter">IntoIter</a>&lt;K, V&gt;</div><code class="content"><span class="where fmt-newline">impl&lt;K, V&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a>K, V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.59.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.59.0/std/primitive.reference.html">&amp;</a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>V, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>V) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>,&nbsp;</span></h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.sort_unstable_keys" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#718-725" title="goto source code">[src]</a></div><a href="#method.sort_unstable_keys" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.sort_unstable_keys" class="fnname">sort_unstable_keys</a>(&amp;mut self) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,&nbsp;</span></h4></div></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"><code>sort_unstable_by</code></a> for details.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.sort_unstable_by" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#735-742" title="goto source code">[src]</a></div><a href="#method.sort_unstable_by" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.sort_unstable_by" class="fnname">sort_unstable_by</a>&lt;F&gt;(&amp;mut self, cmp: F) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.59.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.59.0/std/primitive.reference.html">&amp;</a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>V, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>V) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>,&nbsp;</span></h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.sorted_unstable_by" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#749-758" title="goto source code">[src]</a></div><a href="#method.sorted_unstable_by" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.sorted_unstable_by" class="fnname">sorted_unstable_by</a>&lt;F&gt;(self, cmp: F) -&gt; <a class="struct" href="struct.IntoIter.html" title="struct indexmap::map::IntoIter">IntoIter</a>&lt;K, V&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><div class="notable">Notable traits for <a class="struct" href="struct.IntoIter.html" title="struct indexmap::map::IntoIter">IntoIter</a>&lt;K, V&gt;</div><code class="content"><span class="where fmt-newline">impl&lt;K, V&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a>K, V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.59.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.59.0/std/primitive.reference.html">&amp;</a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>V, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>V) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>,&nbsp;</span></h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.reverse" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#763-765" title="goto source code">[src]</a></div><a href="#method.reverse" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.reverse" class="fnname">reverse</a>(&amp;mut self)</h4></div></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></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-3" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#768-847" title="goto source code">[src]</a></div><a href="#impl-3" class="anchor"></a><h3 class="code-header in-band">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></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.get_index" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#774-776" title="goto source code">[src]</a></div><a href="#method.get_index" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.get_index" class="fnname">get_index</a>(&amp;self, index: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt;</h4></div></summary><div class="docblock"><p>Get a key-value pair by index</p>
<p>Valid indices are <em>0 &lt;= index &lt; self.len()</em></p>
<p>Computes in <strong>O(1)</strong> time.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.get_index_mut" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#783-785" title="goto source code">[src]</a></div><a href="#method.get_index_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.get_index_mut" class="fnname">get_index_mut</a>(&amp;mut self, index: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;mut </a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;mut </a>V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt;</h4></div></summary><div class="docblock"><p>Get a key-value pair by index</p>
<p>Valid indices are <em>0 &lt;= index &lt; self.len()</em></p>
<p>Computes in <strong>O(1)</strong> time.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.first" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#790-792" title="goto source code">[src]</a></div><a href="#method.first" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.first" class="fnname">first</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt;</h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.first_mut" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#797-799" title="goto source code">[src]</a></div><a href="#method.first_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.first_mut" class="fnname">first_mut</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;mut </a>V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt;</h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.last" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#804-806" title="goto source code">[src]</a></div><a href="#method.last" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.last" class="fnname">last</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt;</h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.last_mut" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#811-813" title="goto source code">[src]</a></div><a href="#method.last_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.last_mut" class="fnname">last_mut</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;mut </a>V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt;</h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.swap_remove_index" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#824-826" title="goto source code">[src]</a></div><a href="#method.swap_remove_index" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.swap_remove_index" class="fnname">swap_remove_index</a>(&amp;mut self, index: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a>K, V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt;</h4></div></summary><div class="docblock"><p>Remove the key-value pair by index</p>
<p>Valid indices are <em>0 &lt;= index &lt; self.len()</em></p>
<p>Like <code>Vec::swap_remove</code>, 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="rustdoc-toggle method-toggle" open><summary><div id="method.shift_remove_index" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#837-839" title="goto source code">[src]</a></div><a href="#method.shift_remove_index" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.shift_remove_index" class="fnname">shift_remove_index</a>(&amp;mut self, index: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a>K, V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt;</h4></div></summary><div class="docblock"><p>Remove the key-value pair by index</p>
<p>Valid indices are <em>0 &lt;= index &lt; self.len()</em></p>
<p>Like <code>Vec::remove</code>, 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="rustdoc-toggle method-toggle" open><summary><div id="method.swap_indices" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#844-846" title="goto source code">[src]</a></div><a href="#method.swap_indices" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.swap_indices" class="fnname">swap_indices</a>(&amp;mut self, a: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>, b: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>)</h4></div></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>
</div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Clone" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#81-98" title="goto source code">[src]</a></div><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;V: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#87-92" title="goto source code">[src]</a></div><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; Self</h4></div></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.59.0/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone_from" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#94-97" title="goto source code">[src]</a></div><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, other: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>Self)</h4></div></summary><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/1.59.0/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Debug" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#126-141" title="goto source code">[src]</a></div><a href="#impl-Debug" class="anchor"></a><h3 class="code-header in-band">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;V: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#131-140" title="goto source code">[src]</a></div><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.59.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.59.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.59.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Default" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1460-1468" title="goto source code">[src]</a></div><a href="#impl-Default" class="anchor"></a><h3 class="code-header in-band">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/default/trait.Default.html" title="trait core::default::Default">Default</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.default" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1465-1467" title="goto source code">[src]</a></div><a href="#method.default" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/default/trait.Default.html#tymethod.default" class="fnname">default</a>() -&gt; Self</h4></div></summary><div class="docblock"><p>Return an empty <code>IndexMap</code></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Extend%3C(%26%27a%20K%2C%20%26%27a%20V)%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1446-1458" title="goto source code">[src]</a></div><a href="#impl-Extend%3C(%26%27a%20K%2C%20%26%27a%20V)%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;'a, K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;'a </a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;'a </a>V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;V: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.extend-1" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1455-1457" title="goto source code">[src]</a></div><a href="#method.extend-1" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.Extend.html#tymethod.extend" class="fnname">extend</a>&lt;I:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.59.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.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;'a </a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;'a </a>V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt;&gt;(&amp;mut self, iterable: I)</h4></div></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="rustdoc-toggle method-toggle" open><summary><div id="method.extend_one-1" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/iter/traits/collect.rs.html#343" title="goto source code">[src]</a></div><a href="#method.extend_one-1" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.Extend.html#method.extend_one" class="fnname">extend_one</a>(&amp;mut self, item: A)</h4></div></summary><div class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>extend_one</code>)</div></div><div class='docblock'><p>Extends a collection with exactly one element.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.extend_reserve-1" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/iter/traits/collect.rs.html#351" title="goto source code">[src]</a></div><a href="#method.extend_reserve-1" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.Extend.html#method.extend_reserve" class="fnname">extend_reserve</a>(&amp;mut self, additional: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>)</h4></div></summary><div class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>extend_one</code>)</div></div><div class='docblock'><p>Reserves capacity in a collection for the given number of additional elements. <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.Extend.html#method.extend_reserve">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Extend%3C(K%2C%20V)%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1413-1444" title="goto source code">[src]</a></div><a href="#impl-Extend%3C(K%2C%20V)%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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.59.0/std/primitive.tuple.html">(</a>K, V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.extend" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1427-1443" title="goto source code">[src]</a></div><a href="#method.extend" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.Extend.html#tymethod.extend" class="fnname">extend</a>&lt;I:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.59.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.59.0/std/primitive.tuple.html">(</a>K, V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt;&gt;(&amp;mut self, iterable: I)</h4></div></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="#method.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="rustdoc-toggle method-toggle" open><summary><div id="method.extend_one" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/iter/traits/collect.rs.html#343" title="goto source code">[src]</a></div><a href="#method.extend_one" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.Extend.html#method.extend_one" class="fnname">extend_one</a>(&amp;mut self, item: A)</h4></div></summary><div class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>extend_one</code>)</div></div><div class='docblock'><p>Extends a collection with exactly one element.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.extend_reserve" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/iter/traits/collect.rs.html#351" title="goto source code">[src]</a></div><a href="#method.extend_reserve" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.Extend.html#method.extend_reserve" class="fnname">extend_reserve</a>(&amp;mut self, additional: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>)</h4></div></summary><div class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>extend_one</code>)</div></div><div class='docblock'><p>Reserves capacity in a collection for the given number of additional elements. <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.Extend.html#method.extend_reserve">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-From%3C%5B(K%2C%20V)%3B%20N%5D%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1395-1411" title="goto source code">[src]</a></div><a href="#impl-From%3C%5B(K%2C%20V)%3B%20N%5D%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;K, V, const N:&nbsp;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a>K, V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a><a class="primitive" href="https://doc.rust-lang.org/1.59.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.59.0/std/collections/hash/map/struct.RandomState.html" title="struct std::collections::hash::map::RandomState">RandomState</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1408-1410" title="goto source code">[src]</a></div><a href="#method.from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(arr: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a>K, V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.array.html">; N]</a>) -&gt; Self</h4></div></summary><div class="docblock"><h5 id="examples-3" class="section-header"><a href="#examples-3">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">indexmap::IndexMap</span>;
<span class="kw">let</span> <span class="ident">map1</span> <span class="op">=</span> <span class="ident">IndexMap::from</span>([(<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> <span class="ident">map2</span>: <span class="ident">IndexMap</span><span class="op">&lt;</span><span class="kw">_</span>, <span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> [(<span class="number">1</span>, <span class="number">2</span>), (<span class="number">3</span>, <span class="number">4</span>)].<span class="ident">into</span>();
<span class="macro">assert_eq!</span>(<span class="ident">map1</span>, <span class="ident">map2</span>);</code></pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-FromIterator%3C(K%2C%20V)%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1375-1392" title="goto source code">[src]</a></div><a href="#impl-FromIterator%3C(K%2C%20V)%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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.59.0/std/primitive.tuple.html">(</a>K, V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a> + <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/default/trait.Default.html" title="trait core::default::Default">Default</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from_iter" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1385-1391" title="goto source code">[src]</a></div><a href="#method.from_iter" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.FromIterator.html#tymethod.from_iter" class="fnname">from_iter</a>&lt;I:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.59.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.59.0/std/primitive.tuple.html">(</a>K, V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt;&gt;(iterable: I) -&gt; Self</h4></div></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="#method.extend"><code>extend</code></a> for more details.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Index%3C%26%27_%20Q%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1235-1249" title="goto source code">[src]</a></div><a href="#impl-Index%3C%26%27_%20Q%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;K, V, Q:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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.59.0/std/primitive.reference.html">&amp;'_ </a>Q&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="https://doc.rust-lang.org/1.59.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;,<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,&nbsp;</span></h3></div></summary><div class="docblock"><p>Access <code>IndexMap</code> values corresponding to a key.</p>
<h4 id="examples-4" class="section-header"><a href="#examples-4">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">indexmap::IndexMap</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">IndexMap::new</span>();
<span class="kw">for</span> <span class="ident">word</span> <span class="kw">in</span> <span class="string">&quot;Lorem ipsum dolor sit amet&quot;</span>.<span class="ident">split_whitespace</span>() {
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="ident">word</span>.<span class="ident">to_lowercase</span>(), <span class="ident">word</span>.<span class="ident">to_uppercase</span>());
}
<span class="macro">assert_eq!</span>(<span class="ident">map</span>[<span class="string">&quot;lorem&quot;</span>], <span class="string">&quot;LOREM&quot;</span>);
<span class="macro">assert_eq!</span>(<span class="ident">map</span>[<span class="string">&quot;ipsum&quot;</span>], <span class="string">&quot;IPSUM&quot;</span>);</code></pre></div>
<div class='information'><div class='tooltip should_panic'></div></div><div class="example-wrap"><pre class="rust rust-example-rendered should_panic"><code><span class="kw">use</span> <span class="ident">indexmap::IndexMap</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">IndexMap::new</span>();
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="string">&quot;foo&quot;</span>, <span class="number">1</span>);
<span class="macro">println!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">map</span>[<span class="string">&quot;bar&quot;</span>]); <span class="comment">// panics!</span></code></pre></div>
</div><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.index" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1246-1248" title="goto source code">[src]</a></div><a href="#method.index" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/ops/index/trait.Index.html#tymethod.index" class="fnname">index</a>(&amp;self, key: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>Q) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>V</h4></div></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="rustdoc-toggle" open><summary><div id="associatedtype.Output" class="type trait-impl has-srclink"><a href="#associatedtype.Output" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.59.0/core/ops/index/trait.Index.html#associatedtype.Output" class="associatedtype">Output</a> = V</h4></div></summary><div class='docblock'><p>The returned type after indexing.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Index%3Cusize%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1322-1333" title="goto source code">[src]</a></div><a href="#impl-Index%3Cusize%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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.59.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></div></summary><div class="docblock"><p>Access <code>IndexMap</code> values at indexed positions.</p>
<h4 id="examples-5" class="section-header"><a href="#examples-5">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">indexmap::IndexMap</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">IndexMap::new</span>();
<span class="kw">for</span> <span class="ident">word</span> <span class="kw">in</span> <span class="string">&quot;Lorem ipsum dolor sit amet&quot;</span>.<span class="ident">split_whitespace</span>() {
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="ident">word</span>.<span class="ident">to_lowercase</span>(), <span class="ident">word</span>.<span class="ident">to_uppercase</span>());
}
<span class="macro">assert_eq!</span>(<span class="ident">map</span>[<span class="number">0</span>], <span class="string">&quot;LOREM&quot;</span>);
<span class="macro">assert_eq!</span>(<span class="ident">map</span>[<span class="number">1</span>], <span class="string">&quot;IPSUM&quot;</span>);
<span class="ident">map</span>.<span class="ident">reverse</span>();
<span class="macro">assert_eq!</span>(<span class="ident">map</span>[<span class="number">0</span>], <span class="string">&quot;AMET&quot;</span>);
<span class="macro">assert_eq!</span>(<span class="ident">map</span>[<span class="number">1</span>], <span class="string">&quot;SIT&quot;</span>);
<span class="ident">map</span>.<span class="ident">sort_keys</span>();
<span class="macro">assert_eq!</span>(<span class="ident">map</span>[<span class="number">0</span>], <span class="string">&quot;AMET&quot;</span>);
<span class="macro">assert_eq!</span>(<span class="ident">map</span>[<span class="number">1</span>], <span class="string">&quot;DOLOR&quot;</span>);</code></pre></div>
<div class='information'><div class='tooltip should_panic'></div></div><div class="example-wrap"><pre class="rust rust-example-rendered should_panic"><code><span class="kw">use</span> <span class="ident">indexmap::IndexMap</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">IndexMap::new</span>();
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="string">&quot;foo&quot;</span>, <span class="number">1</span>);
<span class="macro">println!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">map</span>[<span class="number">10</span>]); <span class="comment">// panics!</span></code></pre></div>
</div><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.index-1" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1328-1332" title="goto source code">[src]</a></div><a href="#method.index-1" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/ops/index/trait.Index.html#tymethod.index" class="fnname">index</a>(&amp;self, index: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>V</h4></div></summary><div class="docblock"><p>Returns a reference to the value at the supplied <code>index</code>.</p>
<p><em><strong>Panics</strong></em> if <code>index</code> is out of bounds.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Output-1" class="type trait-impl has-srclink"><a href="#associatedtype.Output-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.59.0/core/ops/index/trait.Index.html#associatedtype.Output" class="associatedtype">Output</a> = V</h4></div></summary><div class='docblock'><p>The returned type after indexing.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-IndexMut%3C%26%27_%20Q%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1280-1292" title="goto source code">[src]</a></div><a href="#impl-IndexMut%3C%26%27_%20Q%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;K, V, Q:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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.59.0/std/primitive.reference.html">&amp;'_ </a>Q&gt; for <a class="struct" href="struct.IndexMap.html" title="struct indexmap::map::IndexMap">IndexMap</a>&lt;K, V, S&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="https://doc.rust-lang.org/1.59.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;,<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,&nbsp;</span></h3></div></summary><div class="docblock"><p>Access <code>IndexMap</code> 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-1" class="section-header"><a href="#examples-1">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">indexmap::IndexMap</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">IndexMap::new</span>();
<span class="kw">for</span> <span class="ident">word</span> <span class="kw">in</span> <span class="string">&quot;Lorem ipsum dolor sit amet&quot;</span>.<span class="ident">split_whitespace</span>() {
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="ident">word</span>.<span class="ident">to_lowercase</span>(), <span class="ident">word</span>.<span class="ident">to_string</span>());
}
<span class="kw">let</span> <span class="ident">lorem</span> <span class="op">=</span> <span class="kw-2">&amp;mut</span> <span class="ident">map</span>[<span class="string">&quot;lorem&quot;</span>];
<span class="macro">assert_eq!</span>(<span class="ident">lorem</span>, <span class="string">&quot;Lorem&quot;</span>);
<span class="ident">lorem</span>.<span class="ident">retain</span>(<span class="ident">char::is_lowercase</span>);
<span class="macro">assert_eq!</span>(<span class="ident">map</span>[<span class="string">&quot;lorem&quot;</span>], <span class="string">&quot;orem&quot;</span>);</code></pre></div>
<div class='information'><div class='tooltip should_panic'></div></div><div class="example-wrap"><pre class="rust rust-example-rendered should_panic"><code><span class="kw">use</span> <span class="ident">indexmap::IndexMap</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">IndexMap::new</span>();
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="string">&quot;foo&quot;</span>, <span class="number">1</span>);
<span class="ident">map</span>[<span class="string">&quot;bar&quot;</span>] <span class="op">=</span> <span class="number">1</span>; <span class="comment">// panics!</span></code></pre></div>
</div><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.index_mut" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1289-1291" title="goto source code">[src]</a></div><a href="#method.index_mut" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut" class="fnname">index_mut</a>(&amp;mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>Q) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;mut </a>V</h4></div></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="rustdoc-toggle implementors-toggle" open><summary><div id="impl-IndexMut%3Cusize%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1364-1373" title="goto source code">[src]</a></div><a href="#impl-IndexMut%3Cusize%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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.59.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></div></summary><div class="docblock"><p>Access <code>IndexMap</code> 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 <code>.insert()</code>.</p>
<h4 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">indexmap::IndexMap</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">IndexMap::new</span>();
<span class="kw">for</span> <span class="ident">word</span> <span class="kw">in</span> <span class="string">&quot;Lorem ipsum dolor sit amet&quot;</span>.<span class="ident">split_whitespace</span>() {
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="ident">word</span>.<span class="ident">to_lowercase</span>(), <span class="ident">word</span>.<span class="ident">to_string</span>());
}
<span class="kw">let</span> <span class="ident">lorem</span> <span class="op">=</span> <span class="kw-2">&amp;mut</span> <span class="ident">map</span>[<span class="number">0</span>];
<span class="macro">assert_eq!</span>(<span class="ident">lorem</span>, <span class="string">&quot;Lorem&quot;</span>);
<span class="ident">lorem</span>.<span class="ident">retain</span>(<span class="ident">char::is_lowercase</span>);
<span class="macro">assert_eq!</span>(<span class="ident">map</span>[<span class="string">&quot;lorem&quot;</span>], <span class="string">&quot;orem&quot;</span>);</code></pre></div>
<div class='information'><div class='tooltip should_panic'></div></div><div class="example-wrap"><pre class="rust rust-example-rendered should_panic"><code><span class="kw">use</span> <span class="ident">indexmap::IndexMap</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">IndexMap::new</span>();
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="string">&quot;foo&quot;</span>, <span class="number">1</span>);
<span class="ident">map</span>[<span class="number">10</span>] <span class="op">=</span> <span class="number">1</span>; <span class="comment">// panics!</span></code></pre></div>
</div><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.index_mut-1" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1368-1372" title="goto source code">[src]</a></div><a href="#method.index_mut-1" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut" class="fnname">index_mut</a>(&amp;mut self, index: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;mut </a>V</h4></div></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="rustdoc-toggle implementors-toggle" open><summary><div id="impl-IntoIterator" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1187-1193" title="goto source code">[src]</a></div><a href="#impl-IntoIterator" class="anchor"></a><h3 class="code-header in-band">impl&lt;'a, K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Item" class="type trait-impl has-srclink"><a href="#associatedtype.Item" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;'a </a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;'a </a>V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a></h4></div></summary><div class='docblock'><p>The type of the elements being iterated over.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.IntoIter" class="type trait-impl has-srclink"><a href="#associatedtype.IntoIter" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.59.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></div></summary><div class='docblock'><p>Which kind of iterator are we turning this into?</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into_iter" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1190-1192" title="goto source code">[src]</a></div><a href="#method.into_iter" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter" class="fnname">into_iter</a>(self) -&gt; Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" title="type core::iter::traits::collect::IntoIterator::IntoIter">IntoIter</a></h4></div></summary><div class='docblock'><p>Creates an iterator from a value. <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-IntoIterator-1" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1195-1201" title="goto source code">[src]</a></div><a href="#impl-IntoIterator-1" class="anchor"></a><h3 class="code-header in-band">impl&lt;'a, K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Item-1" class="type trait-impl has-srclink"><a href="#associatedtype.Item-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;'a </a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;'a mut </a>V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a></h4></div></summary><div class='docblock'><p>The type of the elements being iterated over.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.IntoIter-1" class="type trait-impl has-srclink"><a href="#associatedtype.IntoIter-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.59.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></div></summary><div class='docblock'><p>Which kind of iterator are we turning this into?</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into_iter-1" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1198-1200" title="goto source code">[src]</a></div><a href="#method.into_iter-1" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter" class="fnname">into_iter</a>(self) -&gt; Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" title="type core::iter::traits::collect::IntoIterator::IntoIter">IntoIter</a></h4></div></summary><div class='docblock'><p>Creates an iterator from a value. <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-IntoIterator-2" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1203-1211" title="goto source code">[src]</a></div><a href="#impl-IntoIterator-2" class="anchor"></a><h3 class="code-header in-band">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Item-2" class="type trait-impl has-srclink"><a href="#associatedtype.Item-2" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a>K, V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a></h4></div></summary><div class='docblock'><p>The type of the elements being iterated over.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.IntoIter-2" class="type trait-impl has-srclink"><a href="#associatedtype.IntoIter-2" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.59.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></div></summary><div class='docblock'><p>Which kind of iterator are we turning this into?</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into_iter-2" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1206-1210" title="goto source code">[src]</a></div><a href="#method.into_iter-2" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter" class="fnname">into_iter</a>(self) -&gt; Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" title="type core::iter::traits::collect::IntoIterator::IntoIter">IntoIter</a></h4></div></summary><div class='docblock'><p>Creates an iterator from a value. <a href="https://doc.rust-lang.org/1.59.0/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-MutableKeys" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/mutable_keys.rs.html#51-75" title="goto source code">[src]</a></div><a href="#impl-MutableKeys" class="anchor"></a><h3 class="code-header in-band">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; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,&nbsp;</span></h3></div></summary><div class="docblock"><p>Opt-in mutable access to keys.</p>
<p>See <a href="trait.MutableKeys.html"><code>MutableKeys</code></a> for more information.</p>
</div><div class="impl-items"><div id="associatedtype.Key" class="type trait-impl has-srclink"><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></div><div id="associatedtype.Value" class="type trait-impl has-srclink"><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></div><details class="rustdoc-toggle method-toggle" open><summary><div id="method.get_full_mut2" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/mutable_keys.rs.html#58-63" title="goto source code">[src]</a></div><a href="#method.get_full_mut2" class="anchor"></a><h4 class="code-header">fn <a href="trait.MutableKeys.html#tymethod.get_full_mut2" class="fnname">get_full_mut2</a>&lt;Q:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;key: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>Q<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;mut </a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;mut </a>V<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="https://doc.rust-lang.org/1.59.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;,&nbsp;</span></h4></div></summary><div class='docblock'><p>Return item index, mutable reference to key and value</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.retain2" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/mutable_keys.rs.html#65-70" title="goto source code">[src]</a></div><a href="#method.retain2" class="anchor"></a><h4 class="code-header">fn <a href="trait.MutableKeys.html#tymethod.retain2" class="fnname">retain2</a>&lt;F&gt;(&amp;mut self, keep: F) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.59.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.59.0/std/primitive.reference.html">&amp;mut </a>K, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;mut </a>V) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.bool.html">bool</a>,&nbsp;</span></h4></div></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>. <a href="trait.MutableKeys.html#tymethod.retain2">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.__private_marker" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/mutable_keys.rs.html#72-74" title="goto source code">[src]</a></div><a href="#method.__private_marker" class="anchor"></a><h4 class="code-header">fn <a href="trait.MutableKeys.html#tymethod.__private_marker" class="fnname">__private_marker</a>(&amp;self) -&gt; PrivateMarker</h4></div></summary><div class='docblock'><p>This method is not useful in itself it is there to “seal” the trait
for external implementation, so that we can add methods without
causing breaking changes. <a href="trait.MutableKeys.html#tymethod.__private_marker">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-PartialEq%3CIndexMap%3CK%2C%20V2%2C%20S2%3E%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1470-1485" title="goto source code">[src]</a></div><a href="#impl-PartialEq%3CIndexMap%3CK%2C%20V2%2C%20S2%3E%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;K, V1, S1, V2, S2&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;V1: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;V2&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;S1: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S2: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.eq" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1477-1484" title="goto source code">[src]</a></div><a href="#method.eq" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/cmp/trait.PartialEq.html#tymethod.eq" class="fnname">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.59.0/std/primitive.bool.html">bool</a></h4></div></summary><div class='docblock'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>. <a href="https://doc.rust-lang.org/1.59.0/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.ne" class="method trait-impl has-srclink"><div class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/cmp.rs.html#219" title="goto source code">[src]</a></div><a href="#method.ne" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.59.0/core/cmp/trait.PartialEq.html#method.ne" class="fnname">ne</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.bool.html">bool</a></h4></div></summary><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></details></div></details><div id="impl-Eq" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/indexmap/map.rs.html#1487-1493" title="goto source code">[src]</a></div><a href="#impl-Eq" class="anchor"></a><h3 class="code-header in-band">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;V: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,&nbsp;</span></h3></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;V: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,&nbsp;</span></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;V: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,&nbsp;</span></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;V: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,&nbsp;</span></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;V: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl&lt;K, V, S&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.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; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;V: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a>,&nbsp;</span></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/any.rs.html#132-136" title="goto source code">[src]</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/any.rs.html#133" title="goto source code">[src]</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.59.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.59.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/borrow.rs.html#209-214" title="goto source code">[src]</a></div><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/borrow.rs.html#211" title="goto source code">[src]</a></div><a href="#method.borrow" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;</a>T</h4></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/borrow.rs.html#218-222" title="goto source code">[src]</a></div><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/borrow.rs.html#219" title="goto source code">[src]</a></div><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;mut </a>T</h4></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.59.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#550-554" title="goto source code">[src]</a></div><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from-1" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#551" title="goto source code">[src]</a></div><a href="#method.from-1" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#538-545" title="goto source code">[src]</a></div><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#542" title="goto source code">[src]</a></div><a href="#method.into" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-ToOwned" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/alloc/borrow.rs.html#84-96" title="goto source code">[src]</a></div><a href="#impl-ToOwned" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.0/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Owned" class="type trait-impl has-srclink"><a href="#associatedtype.Owned" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.59.0/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></div></summary><div class='docblock'><p>The resulting type after obtaining ownership.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.to_owned" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/alloc/borrow.rs.html#89" title="goto source code">[src]</a></div><a href="#method.to_owned" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; T</h4></div></summary><div class='docblock'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/1.59.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone_into" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/alloc/borrow.rs.html#93" title="goto source code">[src]</a></div><a href="#method.clone_into" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.reference.html">&amp;mut </a>T)</h4></div></summary><div class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</div></div><div class='docblock'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/1.59.0/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#588-597" title="goto source code">[src]</a></div><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#594" title="goto source code">[src]</a></div><a href="#method.try_from" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.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.59.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.59.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#574-583" title="goto source code">[src]</a></div><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.59.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.59.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.59.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.59.0/src/core/convert/mod.rs.html#580" title="goto source code">[src]</a></div><a href="#method.try_into" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.59.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.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.59.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.59.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="indexmap" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.59.0 (9d1b2106e 2022-02-23)" ></div>
</body></html>