Sophie

Sophie

distrib > Mageia > 6 > armv7hl > media > core-updates > by-pkgid > 4e2dbb669434a7691662cb2f0ad38972 > files > 153

rust-doc-1.28.0-1.mga6.armv7hl.rpm

<!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="API documentation for the Rust `BTreeMap` struct in crate `alloc`."><meta name="keywords" content="rust, rustlang, rust-lang, BTreeMap"><title>alloc::btree_map::BTreeMap - Rust</title><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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../alloc/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a><p class='location'>Struct BTreeMap</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.new">new</a><a href="#method.clear">clear</a><a href="#method.get">get</a><a href="#method.get_key_value">get_key_value</a><a href="#method.contains_key">contains_key</a><a href="#method.get_mut">get_mut</a><a href="#method.insert">insert</a><a href="#method.remove">remove</a><a href="#method.append">append</a><a href="#method.range">range</a><a href="#method.range_mut">range_mut</a><a href="#method.entry">entry</a><a href="#method.split_off">split_off</a><a href="#method.iter">iter</a><a href="#method.iter_mut">iter_mut</a><a href="#method.keys">keys</a><a href="#method.values">values</a><a href="#method.values_mut">values_mut</a><a href="#method.len">len</a><a href="#method.is_empty">is_empty</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Drop">Drop</a><a href="#impl-Clone">Clone</a><a href="#impl-IntoIterator">IntoIterator</a><a href="#impl-FromIterator%3C(K%2C%20V)%3E">FromIterator&lt;(K, V)&gt;</a><a href="#impl-Extend%3C(K%2C%20V)%3E">Extend&lt;(K, V)&gt;</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-Hash">Hash</a><a href="#impl-Default">Default</a><a href="#impl-PartialEq">PartialEq</a><a href="#impl-Eq">Eq</a><a href="#impl-PartialOrd">PartialOrd</a><a href="#impl-Ord">Ord</a><a href="#impl-Debug">Debug</a><a href="#impl-Index%3C%26%27a%20Q%3E">Index&lt;&amp;&#39;a Q&gt;</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div></div><p class='location'><a href='../index.html'>alloc</a>::<wbr><a href='index.html'>btree_map</a></p><script>window.sidebarCurrent = {name: 'BTreeMap', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>alloc</a>::<wbr><a href='index.html'>btree_map</a>::<wbr><a class="struct" href=''>BTreeMap</a></span><span class='out-of-band'><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><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/alloc/btree/map.rs.html#135-138' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct BTreeMap&lt;K, V&gt; { /* fields omitted */ }</pre></div><div class='docblock'><p>A map based on a B-Tree.</p>
<p>B-Trees represent a fundamental compromise between cache-efficiency and actually minimizing
the amount of work performed in a search. In theory, a binary search tree (BST) is the optimal
choice for a sorted map, as a perfectly balanced BST performs the theoretical minimum amount of
comparisons necessary to find an element (log<sub>2</sub>n). However, in practice the way this
is done is <em>very</em> inefficient for modern computer architectures. In particular, every element
is stored in its own individually heap-allocated node. This means that every single insertion
triggers a heap-allocation, and every single comparison should be a cache-miss. Since these
are both notably expensive things to do in practice, we are forced to at very least reconsider
the BST strategy.</p>
<p>A B-Tree instead makes each node contain B-1 to 2B-1 elements in a contiguous array. By doing
this, we reduce the number of allocations by a factor of B, and improve cache efficiency in
searches. However, this does mean that searches will have to do <em>more</em> comparisons on average.
The precise number of comparisons depends on the node search strategy used. For optimal cache
efficiency, one could search the nodes linearly. For optimal comparisons, one could search
the node using binary search. As a compromise, one could also perform a linear search
that initially only checks every i<sup>th</sup> element for some choice of i.</p>
<p>Currently, our implementation simply performs naive linear search. This provides excellent
performance on <em>small</em> nodes of elements which are cheap to compare. However in the future we
would like to further explore choosing the optimal search strategy based on the choice of B,
and possibly other factors. Using linear search, searching for a random element is expected
to take O(B log<sub>B</sub>n) comparisons, which is generally worse than a BST. In practice,
however, performance is excellent.</p>
<p>It is a logic error for a key to be modified in such a way that the key's ordering relative to
any other key, as determined by the <a href="../../std/cmp/trait.Ord.html"><code>Ord</code></a> trait, changes while it is in the map. This is
normally only possible through <a href="../../std/cell/struct.Cell.html"><code>Cell</code></a>, <a href="../../std/cell/struct.RefCell.html"><code>RefCell</code></a>, global state, I/O, or unsafe code.</p>
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="comment">// type inference lets us omit an explicit type signature (which</span>
<span class="comment">// would be `BTreeMap&lt;&amp;str, &amp;str&gt;` in this example).</span>
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">movie_reviews</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();

<span class="comment">// review some movies.</span>
<span class="ident">movie_reviews</span>.<span class="ident">insert</span>(<span class="string">&quot;Office Space&quot;</span>,       <span class="string">&quot;Deals with real issues in the workplace.&quot;</span>);
<span class="ident">movie_reviews</span>.<span class="ident">insert</span>(<span class="string">&quot;Pulp Fiction&quot;</span>,       <span class="string">&quot;Masterpiece.&quot;</span>);
<span class="ident">movie_reviews</span>.<span class="ident">insert</span>(<span class="string">&quot;The Godfather&quot;</span>,      <span class="string">&quot;Very enjoyable.&quot;</span>);
<span class="ident">movie_reviews</span>.<span class="ident">insert</span>(<span class="string">&quot;The Blues Brothers&quot;</span>, <span class="string">&quot;Eye lyked it alot.&quot;</span>);

<span class="comment">// check for a specific one.</span>
<span class="kw">if</span> <span class="op">!</span><span class="ident">movie_reviews</span>.<span class="ident">contains_key</span>(<span class="string">&quot;Les Misérables&quot;</span>) {
    <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;We&#39;ve got {} reviews, but Les Misérables ain&#39;t one.&quot;</span>,
             <span class="ident">movie_reviews</span>.<span class="ident">len</span>());
}

<span class="comment">// oops, this review has a lot of spelling mistakes, let&#39;s delete it.</span>
<span class="ident">movie_reviews</span>.<span class="ident">remove</span>(<span class="string">&quot;The Blues Brothers&quot;</span>);

<span class="comment">// look up the values associated with some keys.</span>
<span class="kw">let</span> <span class="ident">to_find</span> <span class="op">=</span> [<span class="string">&quot;Up!&quot;</span>, <span class="string">&quot;Office Space&quot;</span>];
<span class="kw">for</span> <span class="ident">book</span> <span class="kw">in</span> <span class="kw-2">&amp;</span><span class="ident">to_find</span> {
    <span class="kw">match</span> <span class="ident">movie_reviews</span>.<span class="ident">get</span>(<span class="ident">book</span>) {
       <span class="prelude-val">Some</span>(<span class="ident">review</span>) <span class="op">=&gt;</span> <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{}: {}&quot;</span>, <span class="ident">book</span>, <span class="ident">review</span>),
       <span class="prelude-val">None</span> <span class="op">=&gt;</span> <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{} is unreviewed.&quot;</span>, <span class="ident">book</span>)
    }
}

<span class="comment">// iterate over everything.</span>
<span class="kw">for</span> (<span class="ident">movie</span>, <span class="ident">review</span>) <span class="kw">in</span> <span class="kw-2">&amp;</span><span class="ident">movie_reviews</span> {
    <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{}: \&quot;{}\&quot;&quot;</span>, <span class="ident">movie</span>, <span class="ident">review</span>);
}</pre>
<p><code>BTreeMap</code> also implements an <a href="#method.entry"><code>Entry API</code></a>, which allows
for more complex methods of getting, setting, updating and removing keys and
their values:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="comment">// type inference lets us omit an explicit type signature (which</span>
<span class="comment">// would be `BTreeMap&lt;&amp;str, u8&gt;` in this example).</span>
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">player_stats</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();

<span class="kw">fn</span> <span class="ident">random_stat_buff</span>() <span class="op">-&gt;</span> <span class="ident">u8</span> {
    <span class="comment">// could actually return some random value here - let&#39;s just return</span>
    <span class="comment">// some fixed value for now</span>
    <span class="number">42</span>
}

<span class="comment">// insert a key only if it doesn&#39;t already exist</span>
<span class="ident">player_stats</span>.<span class="ident">entry</span>(<span class="string">&quot;health&quot;</span>).<span class="ident">or_insert</span>(<span class="number">100</span>);

<span class="comment">// insert a key using a function that provides a new value only if it</span>
<span class="comment">// doesn&#39;t already exist</span>
<span class="ident">player_stats</span>.<span class="ident">entry</span>(<span class="string">&quot;defence&quot;</span>).<span class="ident">or_insert_with</span>(<span class="ident">random_stat_buff</span>);

<span class="comment">// update a key, guarding against the key possibly not being set</span>
<span class="kw">let</span> <span class="ident">stat</span> <span class="op">=</span> <span class="ident">player_stats</span>.<span class="ident">entry</span>(<span class="string">&quot;attack&quot;</span>).<span class="ident">or_insert</span>(<span class="number">100</span>);
<span class="kw-2">*</span><span class="ident">stat</span> <span class="op">+=</span> <span class="ident">random_stat_buff</span>();</pre>
</div>
                    <h2 id='methods' class='small-section-header'>
                      Methods<a href='#methods' class='anchor'></a>
                    </h2>
                <h3 id='impl' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;K:&nbsp;<a class="trait" href="../../core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>, V&gt; <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code><a href='#impl' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#509-1167' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.new' class="method"><span id='new.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.new' class='fnname'>new</a>() -&gt; <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#525-530' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Makes a new empty BTreeMap with a reasonable choice for B.</p>
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();

<span class="comment">// entries can now be inserted into the empty map</span>
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="number">1</span>, <span class="string">&quot;a&quot;</span>);</pre>
</div><h4 id='method.clear' class="method"><span id='clear.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.clear' class='fnname'>clear</a>(&amp;mut self)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#547-549' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Clears the map, removing all values.</p>
<h1 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">1</span>, <span class="string">&quot;a&quot;</span>);
<span class="ident">a</span>.<span class="ident">clear</span>();
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">is_empty</span>());</pre>
</div><h4 id='method.get' class="method"><span id='get.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get' class='fnname'>get</a>&lt;Q:&nbsp;?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;self, key: &amp;Q) -&gt; <a class="enum" href="../../core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;V&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="../../alloc/borrow/trait.Borrow.html" title="trait alloc::borrow::Borrow">Borrow</a>&lt;Q&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="../../core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#569-577' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a reference to the value corresponding to the key.</p>
<p>The key may be any borrowed form of the map's key type, but the ordering
on the borrowed form <em>must</em> match the ordering on the key type.</p>
<h1 id="examples-3" class="section-header"><a href="#examples-3">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="number">1</span>, <span class="string">&quot;a&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">map</span>.<span class="ident">get</span>(<span class="kw-2">&amp;</span><span class="number">1</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="string">&quot;a&quot;</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">map</span>.<span class="ident">get</span>(<span class="kw-2">&amp;</span><span class="number">2</span>), <span class="prelude-val">None</span>);</pre>
</div><h4 id='method.get_key_value' class="method"><span id='get_key_value.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_key_value' class='fnname'>get_key_value</a>&lt;Q:&nbsp;?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;self, k: &amp;Q) -&gt; <a class="enum" href="../../core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(&amp;K, &amp;V)&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="../../alloc/borrow/trait.Borrow.html" title="trait alloc::borrow::Borrow">Borrow</a>&lt;Q&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="../../core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#596-604' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API.  (<code>map_get_key_value </code><a href="https://github.com/rust-lang/rust/issues/49347">#49347</a>)</div></div><div class='docblock'><p>Returns the key-value pair corresponding to the supplied key.</p>
<p>The supplied key may be any borrowed form of the map's key type, but the ordering
on the borrowed form <em>must</em> match the ordering on the key type.</p>
<h1 id="examples-4" class="section-header"><a href="#examples-4">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">map_get_key_value</span>)]</span>
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="number">1</span>, <span class="string">&quot;a&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">map</span>.<span class="ident">get_key_value</span>(<span class="kw-2">&amp;</span><span class="number">1</span>), <span class="prelude-val">Some</span>((<span class="kw-2">&amp;</span><span class="number">1</span>, <span class="kw-2">&amp;</span><span class="string">&quot;a&quot;</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">map</span>.<span class="ident">get_key_value</span>(<span class="kw-2">&amp;</span><span class="number">2</span>), <span class="prelude-val">None</span>);</pre>
</div><h4 id='method.contains_key' class="method"><span id='contains_key.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.contains_key' class='fnname'>contains_key</a>&lt;Q:&nbsp;?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;self, key: &amp;Q) -&gt; bool <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="../../alloc/borrow/trait.Borrow.html" title="trait alloc::borrow::Borrow">Borrow</a>&lt;Q&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="../../core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#624-629' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns <code>true</code> if the map contains a value for the specified key.</p>
<p>The key may be any borrowed form of the map's key type, but the ordering
on the borrowed form <em>must</em> match the ordering on the key type.</p>
<h1 id="examples-5" class="section-header"><a href="#examples-5">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="number">1</span>, <span class="string">&quot;a&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">map</span>.<span class="ident">contains_key</span>(<span class="kw-2">&amp;</span><span class="number">1</span>), <span class="bool-val">true</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">map</span>.<span class="ident">contains_key</span>(<span class="kw-2">&amp;</span><span class="number">2</span>), <span class="bool-val">false</span>);</pre>
</div><h4 id='method.get_mut' class="method"><span id='get_mut.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_mut' class='fnname'>get_mut</a>&lt;Q:&nbsp;?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;mut self, key: &amp;Q) -&gt; <a class="enum" href="../../core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;mut V&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="../../alloc/borrow/trait.Borrow.html" title="trait alloc::borrow::Borrow">Borrow</a>&lt;Q&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="../../core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#652-660' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a mutable reference to the value corresponding to the key.</p>
<p>The key may be any borrowed form of the map's key type, but the ordering
on the borrowed form <em>must</em> match the ordering on the key type.</p>
<h1 id="examples-6" class="section-header"><a href="#examples-6">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="number">1</span>, <span class="string">&quot;a&quot;</span>);
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">x</span>) <span class="op">=</span> <span class="ident">map</span>.<span class="ident">get_mut</span>(<span class="kw-2">&amp;</span><span class="number">1</span>) {
    <span class="kw-2">*</span><span class="ident">x</span> <span class="op">=</span> <span class="string">&quot;b&quot;</span>;
}
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">map</span>[<span class="kw-2">&amp;</span><span class="number">1</span>], <span class="string">&quot;b&quot;</span>);</pre>
</div><h4 id='method.insert' class="method"><span id='insert.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.insert' class='fnname'>insert</a>(&amp;mut self, key: K, value: V) -&gt; <a class="enum" href="../../core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;V&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#689-697' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Inserts a key-value pair into the map.</p>
<p>If the map did not have this key present, <code>None</code> is returned.</p>
<p>If the map did have this key present, the value is updated, and the old
value is returned. The key is not updated, though; this matters for
types that can be <code>==</code> without being identical. See the <a href="index.html#insert-and-complex-keys">module-level
documentation</a> for more.</p>
<h1 id="examples-7" class="section-header"><a href="#examples-7">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">map</span>.<span class="ident">insert</span>(<span class="number">37</span>, <span class="string">&quot;a&quot;</span>), <span class="prelude-val">None</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">map</span>.<span class="ident">is_empty</span>(), <span class="bool-val">false</span>);

<span class="ident">map</span>.<span class="ident">insert</span>(<span class="number">37</span>, <span class="string">&quot;b&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">map</span>.<span class="ident">insert</span>(<span class="number">37</span>, <span class="string">&quot;c&quot;</span>), <span class="prelude-val">Some</span>(<span class="string">&quot;b&quot;</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">map</span>[<span class="kw-2">&amp;</span><span class="number">37</span>], <span class="string">&quot;c&quot;</span>);</pre>
</div><h4 id='method.remove' class="method"><span id='remove.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.remove' class='fnname'>remove</a>&lt;Q:&nbsp;?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt;(&amp;mut self, key: &amp;Q) -&gt; <a class="enum" href="../../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;K: <a class="trait" href="../../alloc/borrow/trait.Borrow.html" title="trait alloc::borrow::Borrow">Borrow</a>&lt;Q&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="../../core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#718-733' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Removes a key from the map, returning the value at the key if the key
was previously in the map.</p>
<p>The key may be any borrowed form of the map's key type, but the ordering
on the borrowed form <em>must</em> match the ordering on the key type.</p>
<h1 id="examples-8" class="section-header"><a href="#examples-8">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="number">1</span>, <span class="string">&quot;a&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">map</span>.<span class="ident">remove</span>(<span class="kw-2">&amp;</span><span class="number">1</span>), <span class="prelude-val">Some</span>(<span class="string">&quot;a&quot;</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">map</span>.<span class="ident">remove</span>(<span class="kw-2">&amp;</span><span class="number">1</span>), <span class="prelude-val">None</span>);</pre>
</div><h4 id='method.append' class="method"><span id='append.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.append' class='fnname'>append</a>(&amp;mut self, other: &amp;mut Self)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.11.0'>1.11.0</div><a class='srclink' href='../../src/alloc/btree/map.rs.html#764-787' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Moves all elements from <code>other</code> into <code>Self</code>, leaving <code>other</code> empty.</p>
<h1 id="examples-9" class="section-header"><a href="#examples-9">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">1</span>, <span class="string">&quot;a&quot;</span>);
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">2</span>, <span class="string">&quot;b&quot;</span>);
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">3</span>, <span class="string">&quot;c&quot;</span>);

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
<span class="ident">b</span>.<span class="ident">insert</span>(<span class="number">3</span>, <span class="string">&quot;d&quot;</span>);
<span class="ident">b</span>.<span class="ident">insert</span>(<span class="number">4</span>, <span class="string">&quot;e&quot;</span>);
<span class="ident">b</span>.<span class="ident">insert</span>(<span class="number">5</span>, <span class="string">&quot;f&quot;</span>);

<span class="ident">a</span>.<span class="ident">append</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">b</span>);

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">len</span>(), <span class="number">5</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">b</span>.<span class="ident">len</span>(), <span class="number">0</span>);

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>[<span class="kw-2">&amp;</span><span class="number">1</span>], <span class="string">&quot;a&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>[<span class="kw-2">&amp;</span><span class="number">2</span>], <span class="string">&quot;b&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>[<span class="kw-2">&amp;</span><span class="number">3</span>], <span class="string">&quot;d&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>[<span class="kw-2">&amp;</span><span class="number">4</span>], <span class="string">&quot;e&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>[<span class="kw-2">&amp;</span><span class="number">5</span>], <span class="string">&quot;f&quot;</span>);</pre>
</div><h4 id='method.range' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../alloc/btree_map/struct.Range.html" title="struct alloc::btree_map::Range">Range</a>&lt;'a, K, V&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../alloc/btree_map/struct.Range.html" title="struct alloc::btree_map::Range">Range</a>&lt;'a, K, V&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, K, V&gt; <a class="trait" href="../../core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="../../alloc/btree_map/struct.Range.html" title="struct alloc::btree_map::Range">Range</a>&lt;'a, K, V&gt;</span><span class="where fmt-newline">    type <a href='../../core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = (&amp;'a K, &amp;'a V);</span></code></div></div><span id='range.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.range' class='fnname'>range</a>&lt;T:&nbsp;?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, R&gt;(&amp;self, range: R) -&gt; <a class="struct" href="../../alloc/btree_map/struct.Range.html" title="struct alloc::btree_map::Range">Range</a>&lt;K, V&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="../../alloc/borrow/trait.Borrow.html" title="trait alloc::borrow::Borrow">Borrow</a>&lt;T&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a>&lt;T&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.17.0'>1.17.0</div><a class='srclink' href='../../src/alloc/btree/map.rs.html#819-827' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Constructs a double-ended iterator over a sub-range of elements in the map.
The simplest way is to use the range syntax <code>min..max</code>, thus <code>range(min..max)</code> will
yield elements from min (inclusive) to max (exclusive).
The range may also be entered as <code>(Bound&lt;T&gt;, Bound&lt;T&gt;)</code>, so for example
<code>range((Excluded(4), Included(10)))</code> will yield a left-exclusive, right-inclusive
range from 4 to 10.</p>
<h1 id="panics" class="section-header"><a href="#panics">Panics</a></h1>
<p>Panics if range <code>start &gt; end</code>.
Panics if range <code>start == end</code> and both bounds are <code>Excluded</code>.</p>
<h1 id="examples-10" class="section-header"><a href="#examples-10">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">ops</span>::<span class="ident">Bound</span>::<span class="ident">Included</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="number">3</span>, <span class="string">&quot;a&quot;</span>);
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="number">5</span>, <span class="string">&quot;b&quot;</span>);
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="number">8</span>, <span class="string">&quot;c&quot;</span>);
<span class="kw">for</span> (<span class="kw-2">&amp;</span><span class="ident">key</span>, <span class="kw-2">&amp;</span><span class="ident">value</span>) <span class="kw">in</span> <span class="ident">map</span>.<span class="ident">range</span>((<span class="ident">Included</span>(<span class="kw-2">&amp;</span><span class="number">4</span>), <span class="ident">Included</span>(<span class="kw-2">&amp;</span><span class="number">8</span>))) {
    <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{}: {}&quot;</span>, <span class="ident">key</span>, <span class="ident">value</span>);
}
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">Some</span>((<span class="kw-2">&amp;</span><span class="number">5</span>, <span class="kw-2">&amp;</span><span class="string">&quot;b&quot;</span>)), <span class="ident">map</span>.<span class="ident">range</span>(<span class="number">4</span>..).<span class="ident">next</span>());</pre>
</div><h4 id='method.range_mut' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../alloc/btree_map/struct.RangeMut.html" title="struct alloc::btree_map::RangeMut">RangeMut</a>&lt;'a, K, V&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../alloc/btree_map/struct.RangeMut.html" title="struct alloc::btree_map::RangeMut">RangeMut</a>&lt;'a, K, V&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, K, V&gt; <a class="trait" href="../../core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="../../alloc/btree_map/struct.RangeMut.html" title="struct alloc::btree_map::RangeMut">RangeMut</a>&lt;'a, K, V&gt;</span><span class="where fmt-newline">    type <a href='../../core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = (&amp;'a K, &amp;'a mut V);</span></code></div></div><span id='range_mut.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.range_mut' class='fnname'>range_mut</a>&lt;T:&nbsp;?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, R&gt;(&amp;mut self, range: R) -&gt; <a class="struct" href="../../alloc/btree_map/struct.RangeMut.html" title="struct alloc::btree_map::RangeMut">RangeMut</a>&lt;K, V&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="../../alloc/borrow/trait.Borrow.html" title="trait alloc::borrow::Borrow">Borrow</a>&lt;T&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="../../core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a>&lt;T&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.17.0'>1.17.0</div><a class='srclink' href='../../src/alloc/btree/map.rs.html#859-871' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Constructs a mutable double-ended iterator over a sub-range of elements in the map.
The simplest way is to use the range syntax <code>min..max</code>, thus <code>range(min..max)</code> will
yield elements from min (inclusive) to max (exclusive).
The range may also be entered as <code>(Bound&lt;T&gt;, Bound&lt;T&gt;)</code>, so for example
<code>range((Excluded(4), Included(10)))</code> will yield a left-exclusive, right-inclusive
range from 4 to 10.</p>
<h1 id="panics-1" class="section-header"><a href="#panics-1">Panics</a></h1>
<p>Panics if range <code>start &gt; end</code>.
Panics if range <code>start == end</code> and both bounds are <code>Excluded</code>.</p>
<h1 id="examples-11" class="section-header"><a href="#examples-11">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span>: <span class="ident">BTreeMap</span><span class="op">&lt;</span><span class="kw-2">&amp;</span><span class="ident">str</span>, <span class="ident">i32</span><span class="op">&gt;</span> <span class="op">=</span> [<span class="string">&quot;Alice&quot;</span>, <span class="string">&quot;Bob&quot;</span>, <span class="string">&quot;Carol&quot;</span>, <span class="string">&quot;Cheryl&quot;</span>].<span class="ident">iter</span>()
                                                                      .<span class="ident">map</span>(<span class="op">|</span><span class="kw-2">&amp;</span><span class="ident">s</span><span class="op">|</span> (<span class="ident">s</span>, <span class="number">0</span>))
                                                                      .<span class="ident">collect</span>();
<span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">balance</span>) <span class="kw">in</span> <span class="ident">map</span>.<span class="ident">range_mut</span>(<span class="string">&quot;B&quot;</span>..<span class="string">&quot;Cheryl&quot;</span>) {
    <span class="kw-2">*</span><span class="ident">balance</span> <span class="op">+=</span> <span class="number">100</span>;
}
<span class="kw">for</span> (<span class="ident">name</span>, <span class="ident">balance</span>) <span class="kw">in</span> <span class="kw-2">&amp;</span><span class="ident">map</span> {
    <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{} =&gt; {}&quot;</span>, <span class="ident">name</span>, <span class="ident">balance</span>);
}</pre>
</div><h4 id='method.entry' class="method"><span id='entry.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.entry' class='fnname'>entry</a>(&amp;mut self, key: K) -&gt; <a class="enum" href="../../alloc/btree_map/enum.Entry.html" title="enum alloc::btree_map::Entry">Entry</a>&lt;K, V&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#892-912' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Gets the given key's corresponding entry in the map for in-place manipulation.</p>
<h1 id="examples-12" class="section-header"><a href="#examples-12">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">count</span>: <span class="ident">BTreeMap</span><span class="op">&lt;</span><span class="kw-2">&amp;</span><span class="ident">str</span>, <span class="ident">usize</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();

<span class="comment">// count the number of occurrences of letters in the vec</span>
<span class="kw">for</span> <span class="ident">x</span> <span class="kw">in</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="string">&quot;a&quot;</span>,<span class="string">&quot;b&quot;</span>,<span class="string">&quot;a&quot;</span>,<span class="string">&quot;c&quot;</span>,<span class="string">&quot;a&quot;</span>,<span class="string">&quot;b&quot;</span>] {
    <span class="kw-2">*</span><span class="ident">count</span>.<span class="ident">entry</span>(<span class="ident">x</span>).<span class="ident">or_insert</span>(<span class="number">0</span>) <span class="op">+=</span> <span class="number">1</span>;
}

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">count</span>[<span class="string">&quot;a&quot;</span>], <span class="number">3</span>);</pre>
</div><h4 id='method.split_off' class="method"><span id='split_off.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.split_off' class='fnname'>split_off</a>&lt;Q:&nbsp;?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="../../core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>&gt;(&amp;mut self, key: &amp;Q) -&gt; Self <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="../../alloc/borrow/trait.Borrow.html" title="trait alloc::borrow::Borrow">Borrow</a>&lt;Q&gt;,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.11.0'>1.11.0</div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1015-1070' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Splits the collection into two at the given key. Returns everything after the given key,
including the key.</p>
<h1 id="examples-13" class="section-header"><a href="#examples-13">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">1</span>, <span class="string">&quot;a&quot;</span>);
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">2</span>, <span class="string">&quot;b&quot;</span>);
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">3</span>, <span class="string">&quot;c&quot;</span>);
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">17</span>, <span class="string">&quot;d&quot;</span>);
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">41</span>, <span class="string">&quot;e&quot;</span>);

<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">split_off</span>(<span class="kw-2">&amp;</span><span class="number">3</span>);

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">len</span>(), <span class="number">2</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">b</span>.<span class="ident">len</span>(), <span class="number">3</span>);

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>[<span class="kw-2">&amp;</span><span class="number">1</span>], <span class="string">&quot;a&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>[<span class="kw-2">&amp;</span><span class="number">2</span>], <span class="string">&quot;b&quot;</span>);

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">b</span>[<span class="kw-2">&amp;</span><span class="number">3</span>], <span class="string">&quot;c&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">b</span>[<span class="kw-2">&amp;</span><span class="number">17</span>], <span class="string">&quot;d&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">b</span>[<span class="kw-2">&amp;</span><span class="number">41</span>], <span class="string">&quot;e&quot;</span>);</pre>
</div></div><h3 id='impl-1' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;K, V&gt; <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code><a href='#impl-1' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1914-2087' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.iter' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../alloc/btree_map/struct.Iter.html" title="struct alloc::btree_map::Iter">Iter</a>&lt;'a, K, V&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../alloc/btree_map/struct.Iter.html" title="struct alloc::btree_map::Iter">Iter</a>&lt;'a, K, V&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, K:&nbsp;'a, V:&nbsp;'a&gt; <a class="trait" href="../../core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="../../alloc/btree_map/struct.Iter.html" title="struct alloc::btree_map::Iter">Iter</a>&lt;'a, K, V&gt;</span><span class="where fmt-newline">    type <a href='../../core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = (&amp;'a K, &amp;'a V);</span></code></div></div><span id='iter.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.iter' class='fnname'>iter</a>(&amp;self) -&gt; <a class="struct" href="../../alloc/btree_map/struct.Iter.html" title="struct alloc::btree_map::Iter">Iter</a>&lt;K, V&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1937-1945' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Gets an iterator over the entries of the map, sorted by key.</p>
<h1 id="examples-14" class="section-header"><a href="#examples-14">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="number">3</span>, <span class="string">&quot;c&quot;</span>);
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="number">2</span>, <span class="string">&quot;b&quot;</span>);
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="number">1</span>, <span class="string">&quot;a&quot;</span>);

<span class="kw">for</span> (<span class="ident">key</span>, <span class="ident">value</span>) <span class="kw">in</span> <span class="ident">map</span>.<span class="ident">iter</span>() {
    <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{}: {}&quot;</span>, <span class="ident">key</span>, <span class="ident">value</span>);
}

<span class="kw">let</span> (<span class="ident">first_key</span>, <span class="ident">first_value</span>) <span class="op">=</span> <span class="ident">map</span>.<span class="ident">iter</span>().<span class="ident">next</span>().<span class="ident">unwrap</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>((<span class="kw-2">*</span><span class="ident">first_key</span>, <span class="kw-2">*</span><span class="ident">first_value</span>), (<span class="number">1</span>, <span class="string">&quot;a&quot;</span>));</pre>
</div><h4 id='method.iter_mut' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../alloc/btree_map/struct.IterMut.html" title="struct alloc::btree_map::IterMut">IterMut</a>&lt;'a, K, V&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../alloc/btree_map/struct.IterMut.html" title="struct alloc::btree_map::IterMut">IterMut</a>&lt;'a, K, V&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, K:&nbsp;'a, V:&nbsp;'a&gt; <a class="trait" href="../../core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="../../alloc/btree_map/struct.IterMut.html" title="struct alloc::btree_map::IterMut">IterMut</a>&lt;'a, K, V&gt;</span><span class="where fmt-newline">    type <a href='../../core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = (&amp;'a K, &amp;'a mut V);</span></code></div></div><span id='iter_mut.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.iter_mut' class='fnname'>iter_mut</a>(&amp;mut self) -&gt; <a class="struct" href="../../alloc/btree_map/struct.IterMut.html" title="struct alloc::btree_map::IterMut">IterMut</a>&lt;K, V&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1969-1980' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Gets a mutable iterator over the entries of the map, sorted by key.</p>
<h1 id="examples-15" class="section-header"><a href="#examples-15">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="string">&quot;a&quot;</span>, <span class="number">1</span>);
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="string">&quot;b&quot;</span>, <span class="number">2</span>);
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="string">&quot;c&quot;</span>, <span class="number">3</span>);

<span class="comment">// add 10 to the value if the key isn&#39;t &quot;a&quot;</span>
<span class="kw">for</span> (<span class="ident">key</span>, <span class="ident">value</span>) <span class="kw">in</span> <span class="ident">map</span>.<span class="ident">iter_mut</span>() {
    <span class="kw">if</span> <span class="ident">key</span> <span class="op">!=</span> <span class="kw-2">&amp;</span><span class="string">&quot;a&quot;</span> {
        <span class="kw-2">*</span><span class="ident">value</span> <span class="op">+=</span> <span class="number">10</span>;
    }
}</pre>
</div><h4 id='method.keys' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../alloc/btree_map/struct.Keys.html" title="struct alloc::btree_map::Keys">Keys</a>&lt;'a, K, V&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../alloc/btree_map/struct.Keys.html" title="struct alloc::btree_map::Keys">Keys</a>&lt;'a, K, V&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, K, V&gt; <a class="trait" href="../../core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="../../alloc/btree_map/struct.Keys.html" title="struct alloc::btree_map::Keys">Keys</a>&lt;'a, K, V&gt;</span><span class="where fmt-newline">    type <a href='../../core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &amp;'a K;</span></code></div></div><span id='keys.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.keys' class='fnname'>keys</a>&lt;'a&gt;(&amp;'a self) -&gt; <a class="struct" href="../../alloc/btree_map/struct.Keys.html" title="struct alloc::btree_map::Keys">Keys</a>&lt;'a, K, V&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1999-2001' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Gets an iterator over the keys of the map, in sorted order.</p>
<h1 id="examples-16" class="section-header"><a href="#examples-16">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">2</span>, <span class="string">&quot;b&quot;</span>);
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">1</span>, <span class="string">&quot;a&quot;</span>);

<span class="kw">let</span> <span class="ident">keys</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">keys</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">keys</span>, [<span class="number">1</span>, <span class="number">2</span>]);</pre>
</div><h4 id='method.values' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../alloc/btree_map/struct.Values.html" title="struct alloc::btree_map::Values">Values</a>&lt;'a, K, V&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../alloc/btree_map/struct.Values.html" title="struct alloc::btree_map::Values">Values</a>&lt;'a, K, V&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, K, V&gt; <a class="trait" href="../../core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="../../alloc/btree_map/struct.Values.html" title="struct alloc::btree_map::Values">Values</a>&lt;'a, K, V&gt;</span><span class="where fmt-newline">    type <a href='../../core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &amp;'a V;</span></code></div></div><span id='values.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.values' class='fnname'>values</a>&lt;'a&gt;(&amp;'a self) -&gt; <a class="struct" href="../../alloc/btree_map/struct.Values.html" title="struct alloc::btree_map::Values">Values</a>&lt;'a, K, V&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#2020-2022' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Gets an iterator over the values of the map, in order by key.</p>
<h1 id="examples-17" class="section-header"><a href="#examples-17">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">1</span>, <span class="string">&quot;hello&quot;</span>);
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">2</span>, <span class="string">&quot;goodbye&quot;</span>);

<span class="kw">let</span> <span class="ident">values</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="kw-2">&amp;</span><span class="ident">str</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">values</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">values</span>, [<span class="string">&quot;hello&quot;</span>, <span class="string">&quot;goodbye&quot;</span>]);</pre>
</div><h4 id='method.values_mut' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../alloc/btree_map/struct.ValuesMut.html" title="struct alloc::btree_map::ValuesMut">ValuesMut</a>&lt;'a, K, V&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../alloc/btree_map/struct.ValuesMut.html" title="struct alloc::btree_map::ValuesMut">ValuesMut</a>&lt;'a, K, V&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, K, V&gt; <a class="trait" href="../../core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="../../alloc/btree_map/struct.ValuesMut.html" title="struct alloc::btree_map::ValuesMut">ValuesMut</a>&lt;'a, K, V&gt;</span><span class="where fmt-newline">    type <a href='../../core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &amp;'a mut V;</span></code></div></div><span id='values_mut.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.values_mut' class='fnname'>values_mut</a>(&amp;mut self) -&gt; <a class="struct" href="../../alloc/btree_map/struct.ValuesMut.html" title="struct alloc::btree_map::ValuesMut">ValuesMut</a>&lt;K, V&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.10.0'>1.10.0</div><a class='srclink' href='../../src/alloc/btree/map.rs.html#2046-2048' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Gets a mutable iterator over the values of the map, in order by key.</p>
<h1 id="examples-18" class="section-header"><a href="#examples-18">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">1</span>, <span class="ident">String</span>::<span class="ident">from</span>(<span class="string">&quot;hello&quot;</span>));
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">2</span>, <span class="ident">String</span>::<span class="ident">from</span>(<span class="string">&quot;goodbye&quot;</span>));

<span class="kw">for</span> <span class="ident">value</span> <span class="kw">in</span> <span class="ident">a</span>.<span class="ident">values_mut</span>() {
    <span class="ident">value</span>.<span class="ident">push_str</span>(<span class="string">&quot;!&quot;</span>);
}

<span class="kw">let</span> <span class="ident">values</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">String</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">a</span>.<span class="ident">values</span>().<span class="ident">cloned</span>().<span class="ident">collect</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">values</span>, [<span class="ident">String</span>::<span class="ident">from</span>(<span class="string">&quot;hello!&quot;</span>),
                    <span class="ident">String</span>::<span class="ident">from</span>(<span class="string">&quot;goodbye!&quot;</span>)]);</pre>
</div><h4 id='method.len' class="method"><span id='len.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.len' class='fnname'>len</a>(&amp;self) -&gt; usize</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#2065-2067' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the number of elements in the map.</p>
<h1 id="examples-19" class="section-header"><a href="#examples-19">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">len</span>(), <span class="number">0</span>);
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">1</span>, <span class="string">&quot;a&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">len</span>(), <span class="number">1</span>);</pre>
</div><h4 id='method.is_empty' class="method"><span id='is_empty.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_empty' class='fnname'>is_empty</a>(&amp;self) -&gt; bool</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#2084-2086' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns <code>true</code> if the map contains no elements.</p>
<h1 id="examples-20" class="section-header"><a href="#examples-20">Examples</a></h1>
<p>Basic usage:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">BTreeMap</span>::<span class="ident">new</span>();
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">a</span>.<span class="ident">is_empty</span>());
<span class="ident">a</span>.<span class="ident">insert</span>(<span class="number">1</span>, <span class="string">&quot;a&quot;</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">a</span>.<span class="ident">is_empty</span>());</pre>
</div></div>
                <h2 id='implementations' class='small-section-header'>
                  Trait Implementations<a href='#implementations' class='anchor'></a>
                </h2>
                <div id='implementations-list'><h3 id='impl-Drop' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;K, V&gt; <a class="trait" href="../../core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code><a href='#impl-Drop' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.7.0'>1.7.0</div><a class='srclink' href='../../src/alloc/btree/map.rs.html#141-147' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.drop' class="method"><span id='drop.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/ops/drop/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&amp;mut self)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#142-146' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Executes the destructor for this type. <a href="../../core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
</div></div><h3 id='impl-Clone' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;K:&nbsp;<a class="trait" href="../../core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, V:&nbsp;<a class="trait" href="../../core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; <a class="trait" href="../../core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code><a href='#impl-Clone' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#150-218' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.clone' class="method"><span id='clone.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#151-217' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a copy of the value. <a href="../../core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class="method"><span id='clone_from.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/clone.rs.html#130-132' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="../../core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id='impl-IntoIterator' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a, K:&nbsp;'a, V:&nbsp;'a&gt; <a class="trait" href="../../core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a> for &amp;'a <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code><a href='#impl-IntoIterator' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1170-1177' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Item' class="type"><span id='Item.t' class='invisible'><code>type <a href='../../core/iter/traits/trait.IntoIterator.html#associatedtype.Item' class="type">Item</a> = (&amp;'a K, &amp;'a V)</code></span></h4>
<div class='docblock'><p>The type of the elements being iterated over.</p>
</div><h4 id='associatedtype.IntoIter' class="type"><span id='IntoIter.t' class='invisible'><code>type <a href='../../core/iter/traits/trait.IntoIterator.html#associatedtype.IntoIter' class="type">IntoIter</a> = <a class="struct" href="../../alloc/btree_map/struct.Iter.html" title="struct alloc::btree_map::Iter">Iter</a>&lt;'a, K, V&gt;</code></span></h4>
<div class='docblock'><p>Which kind of iterator are we turning this into?</p>
</div><h4 id='method.into_iter' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../alloc/btree_map/struct.Iter.html" title="struct alloc::btree_map::Iter">Iter</a>&lt;'a, K, V&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../alloc/btree_map/struct.Iter.html" title="struct alloc::btree_map::Iter">Iter</a>&lt;'a, K, V&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, K:&nbsp;'a, V:&nbsp;'a&gt; <a class="trait" href="../../core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="../../alloc/btree_map/struct.Iter.html" title="struct alloc::btree_map::Iter">Iter</a>&lt;'a, K, V&gt;</span><span class="where fmt-newline">    type <a href='../../core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = (&amp;'a K, &amp;'a V);</span></code></div></div><span id='into_iter.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/iter/traits/trait.IntoIterator.html#tymethod.into_iter' class='fnname'>into_iter</a>(self) -&gt; <a class="struct" href="../../alloc/btree_map/struct.Iter.html" title="struct alloc::btree_map::Iter">Iter</a>&lt;'a, K, V&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1174-1176' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates an iterator from a value. <a href="../../core/iter/traits/trait.IntoIterator.html#tymethod.into_iter">Read more</a></p>
</div></div><h3 id='impl-IntoIterator-1' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a, K:&nbsp;'a, V:&nbsp;'a&gt; <a class="trait" href="../../core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a> for &amp;'a mut <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code><a href='#impl-IntoIterator-1' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1230-1237' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Item-1' class="type"><span id='Item.t-1' class='invisible'><code>type <a href='../../core/iter/traits/trait.IntoIterator.html#associatedtype.Item' class="type">Item</a> = (&amp;'a K, &amp;'a mut V)</code></span></h4>
<div class='docblock'><p>The type of the elements being iterated over.</p>
</div><h4 id='associatedtype.IntoIter-1' class="type"><span id='IntoIter.t-1' class='invisible'><code>type <a href='../../core/iter/traits/trait.IntoIterator.html#associatedtype.IntoIter' class="type">IntoIter</a> = <a class="struct" href="../../alloc/btree_map/struct.IterMut.html" title="struct alloc::btree_map::IterMut">IterMut</a>&lt;'a, K, V&gt;</code></span></h4>
<div class='docblock'><p>Which kind of iterator are we turning this into?</p>
</div><h4 id='method.into_iter-1' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../alloc/btree_map/struct.IterMut.html" title="struct alloc::btree_map::IterMut">IterMut</a>&lt;'a, K, V&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../alloc/btree_map/struct.IterMut.html" title="struct alloc::btree_map::IterMut">IterMut</a>&lt;'a, K, V&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, K:&nbsp;'a, V:&nbsp;'a&gt; <a class="trait" href="../../core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="../../alloc/btree_map/struct.IterMut.html" title="struct alloc::btree_map::IterMut">IterMut</a>&lt;'a, K, V&gt;</span><span class="where fmt-newline">    type <a href='../../core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = (&amp;'a K, &amp;'a mut V);</span></code></div></div><span id='into_iter.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/iter/traits/trait.IntoIterator.html#tymethod.into_iter' class='fnname'>into_iter</a>(self) -&gt; <a class="struct" href="../../alloc/btree_map/struct.IterMut.html" title="struct alloc::btree_map::IterMut">IterMut</a>&lt;'a, K, V&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1234-1236' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates an iterator from a value. <a href="../../core/iter/traits/trait.IntoIterator.html#tymethod.into_iter">Read more</a></p>
</div></div><h3 id='impl-IntoIterator-2' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;K, V&gt; <a class="trait" href="../../core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a> for <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code><a href='#impl-IntoIterator-2' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1280-1296' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Item-2' class="type"><span id='Item.t-2' class='invisible'><code>type <a href='../../core/iter/traits/trait.IntoIterator.html#associatedtype.Item' class="type">Item</a> = (K, V)</code></span></h4>
<div class='docblock'><p>The type of the elements being iterated over.</p>
</div><h4 id='associatedtype.IntoIter-2' class="type"><span id='IntoIter.t-2' class='invisible'><code>type <a href='../../core/iter/traits/trait.IntoIterator.html#associatedtype.IntoIter' class="type">IntoIter</a> = <a class="struct" href="../../alloc/btree_map/struct.IntoIter.html" title="struct alloc::btree_map::IntoIter">IntoIter</a>&lt;K, V&gt;</code></span></h4>
<div class='docblock'><p>Which kind of iterator are we turning this into?</p>
</div><h4 id='method.into_iter-2' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../alloc/btree_map/struct.IntoIter.html" title="struct alloc::btree_map::IntoIter">IntoIter</a>&lt;K, V&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../alloc/btree_map/struct.IntoIter.html" title="struct alloc::btree_map::IntoIter">IntoIter</a>&lt;K, V&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;K, V&gt; <a class="trait" href="../../core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="../../alloc/btree_map/struct.IntoIter.html" title="struct alloc::btree_map::IntoIter">IntoIter</a>&lt;K, V&gt;</span><span class="where fmt-newline">    type <a href='../../core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = (K, V);</span></code></div></div><span id='into_iter.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/iter/traits/trait.IntoIterator.html#tymethod.into_iter' class='fnname'>into_iter</a>(self) -&gt; <a class="struct" href="../../alloc/btree_map/struct.IntoIter.html" title="struct alloc::btree_map::IntoIter">IntoIter</a>&lt;K, V&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1284-1295' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates an iterator from a value. <a href="../../core/iter/traits/trait.IntoIterator.html#tymethod.into_iter">Read more</a></p>
</div></div><h3 id='impl-FromIterator%3C(K%2C%20V)%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;K:&nbsp;<a class="trait" href="../../core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>, V&gt; <a class="trait" href="../../core/iter/traits/trait.FromIterator.html" title="trait core::iter::traits::FromIterator">FromIterator</a>&lt;(K, V)&gt; for <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code><a href='#impl-FromIterator%3C(K%2C%20V)%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1710-1716' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.from_iter' class="method"><span id='from_iter.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/iter/traits/trait.FromIterator.html#tymethod.from_iter' class='fnname'>from_iter</a>&lt;T:&nbsp;<a class="trait" href="../../core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a>&lt;Item = (K, V)&gt;&gt;(iter: T) -&gt; <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1711-1715' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates a value from an iterator. <a href="../../core/iter/traits/trait.FromIterator.html#tymethod.from_iter">Read more</a></p>
</div></div><h3 id='impl-Extend%3C(K%2C%20V)%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;K:&nbsp;<a class="trait" href="../../core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>, V&gt; <a class="trait" href="../../core/iter/traits/trait.Extend.html" title="trait core::iter::traits::Extend">Extend</a>&lt;(K, V)&gt; for <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code><a href='#impl-Extend%3C(K%2C%20V)%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1719-1726' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.extend' class="method"><span id='extend.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/iter/traits/trait.Extend.html#tymethod.extend' class='fnname'>extend</a>&lt;T:&nbsp;<a class="trait" href="../../core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a>&lt;Item = (K, V)&gt;&gt;(&amp;mut self, iter: T)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1721-1725' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Extends a collection with the contents of an iterator. <a href="../../core/iter/traits/trait.Extend.html#tymethod.extend">Read more</a></p>
</div></div><h3 id='impl-Extend%3C(%26%27a%20K%2C%20%26%27a%20V)%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a, K:&nbsp;<a class="trait" href="../../core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> + <a class="trait" href="../../core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>, V:&nbsp;<a class="trait" href="../../core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>&gt; <a class="trait" href="../../core/iter/traits/trait.Extend.html" title="trait core::iter::traits::Extend">Extend</a>&lt;(&amp;'a K, &amp;'a V)&gt; for <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code><a href='#impl-Extend%3C(%26%27a%20K%2C%20%26%27a%20V)%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.2.0'>1.2.0</div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1729-1733' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.extend-1' class="method"><span id='extend.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/iter/traits/trait.Extend.html#tymethod.extend' class='fnname'>extend</a>&lt;I:&nbsp;<a class="trait" href="../../core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a>&lt;Item = (&amp;'a K, &amp;'a V)&gt;&gt;(&amp;mut self, iter: I)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1730-1732' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Extends a collection with the contents of an iterator. <a href="../../core/iter/traits/trait.Extend.html#tymethod.extend">Read more</a></p>
</div></div><h3 id='impl-Hash' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;K:&nbsp;<a class="trait" href="../../core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a>, V:&nbsp;<a class="trait" href="../../core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a>&gt; <a class="trait" href="../../core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code><a href='#impl-Hash' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1736-1742' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.hash' class="method"><span id='hash.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a>&lt;H:&nbsp;<a class="trait" href="../../core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>&gt;(&amp;self, state: &amp;mut H)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1737-1741' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="../../core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
</div><h4 id='method.hash_slice' class="method"><span id='hash_slice.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a>&lt;H&gt;(data: &amp;[Self], state: &amp;mut H) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="../../core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.3.0'>1.3.0</div><a class='srclink' href='../../src/core/hash/mod.rs.html#203-209' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="../../core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
</div></div><h3 id='impl-Default' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;K:&nbsp;<a class="trait" href="../../core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>, V&gt; <a class="trait" href="../../core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code><a href='#impl-Default' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1745-1750' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.default' class="method"><span id='default.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -&gt; <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1747-1749' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates an empty <code>BTreeMap&lt;K, V&gt;</code>.</p>
</div></div><h3 id='impl-PartialEq' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;K:&nbsp;<a class="trait" href="../../core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>, V:&nbsp;<a class="trait" href="../../core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&gt; <a class="trait" href="../../core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a> for <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code><a href='#impl-PartialEq' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1753-1757' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.eq' class="method"><span id='eq.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;<a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;) -&gt; bool</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1754-1756' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><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="../../core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne' class="method"><span id='ne.v' class='invisible'><table class='table-display'><tbody><tr><td><code><div class="docblock attributes">#[must_use]
</div>fn <a href='../../core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: &amp;Rhs) -&gt; bool</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/cmp.rs.html#123' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-Eq' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;K:&nbsp;<a class="trait" href="../../core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>, V:&nbsp;<a class="trait" href="../../core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>&gt; <a class="trait" href="../../core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code><a href='#impl-Eq' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1760' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-PartialOrd' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;K:&nbsp;<a class="trait" href="../../core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>, V:&nbsp;<a class="trait" href="../../core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&gt; <a class="trait" href="../../core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a> for <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code><a href='#impl-PartialOrd' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1763-1768' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method"><span id='partial_cmp.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;) -&gt; <a class="enum" href="../../core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="../../core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1765-1767' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="../../core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt' class="method"><span id='lt.v' class='invisible'><table class='table-display'><tbody><tr><td><code><div class="docblock attributes">#[must_use]
</div>fn <a href='../../core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: &amp;Rhs) -&gt; bool</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/cmp.rs.html#657-662' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="../../core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le' class="method"><span id='le.v' class='invisible'><table class='table-display'><tbody><tr><td><code><div class="docblock attributes">#[must_use]
</div>fn <a href='../../core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: &amp;Rhs) -&gt; bool</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/cmp.rs.html#679-684' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="../../core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.gt' class="method"><span id='gt.v' class='invisible'><table class='table-display'><tbody><tr><td><code><div class="docblock attributes">#[must_use]
</div>fn <a href='../../core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: &amp;Rhs) -&gt; bool</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/cmp.rs.html#700-705' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="../../core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id='method.ge' class="method"><span id='ge.v' class='invisible'><table class='table-display'><tbody><tr><td><code><div class="docblock attributes">#[must_use]
</div>fn <a href='../../core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: &amp;Rhs) -&gt; bool</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/core/cmp.rs.html#722-727' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="../../core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id='impl-Ord' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;K:&nbsp;<a class="trait" href="../../core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>, V:&nbsp;<a class="trait" href="../../core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>&gt; <a class="trait" href="../../core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code><a href='#impl-Ord' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1771-1776' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.cmp' class="method"><span id='cmp.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;) -&gt; <a class="enum" href="../../core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1773-1775' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method returns an <code>Ordering</code> between <code>self</code> and <code>other</code>. <a href="../../core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
</div><h4 id='method.max' class="method"><span id='max.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -&gt; Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.21.0'>1.21.0</div><a class='srclink' href='../../src/core/cmp.rs.html#469-472' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Compares and returns the maximum of two values. <a href="../../core/cmp/trait.Ord.html#method.max">Read more</a></p>
</div><h4 id='method.min' class="method"><span id='min.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -&gt; Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.21.0'>1.21.0</div><a class='srclink' href='../../src/core/cmp.rs.html#485-488' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Compares and returns the minimum of two values. <a href="../../core/cmp/trait.Ord.html#method.min">Read more</a></p>
</div></div><h3 id='impl-Debug' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;K:&nbsp;<a class="trait" href="../../alloc/fmt/trait.Debug.html" title="trait alloc::fmt::Debug">Debug</a>, V:&nbsp;<a class="trait" href="../../alloc/fmt/trait.Debug.html" title="trait alloc::fmt::Debug">Debug</a>&gt; <a class="trait" href="../../alloc/fmt/trait.Debug.html" title="trait alloc::fmt::Debug">Debug</a> for <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt;</code><a href='#impl-Debug' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1779-1783' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../alloc/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="../../alloc/fmt/struct.Formatter.html" title="struct alloc::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="../../alloc/fmt/type.Result.html" title="type alloc::fmt::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1780-1782' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Formats the value using the given formatter. <a href="../../alloc/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-Index%3C%26%27a%20Q%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a, K:&nbsp;<a class="trait" href="../../core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>, Q:&nbsp;?<a class="trait" href="../../core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, V&gt; <a class="trait" href="../../core/ops/index/trait.Index.html" title="trait core::ops::index::Index">Index</a>&lt;&amp;'a Q&gt; for <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="../../alloc/borrow/trait.Borrow.html" title="trait alloc::borrow::Borrow">Borrow</a>&lt;Q&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Q: <a class="trait" href="../../core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,&nbsp;</span></code><a href='#impl-Index%3C%26%27a%20Q%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1786-1801' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Output' class="type"><span id='Output.t' class='invisible'><code>type <a href='../../core/ops/index/trait.Index.html#associatedtype.Output' class="type">Output</a> = V</code></span></h4>
<div class='docblock'><p>The returned type after indexing.</p>
</div><h4 id='method.index' class="method"><span id='index.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../core/ops/index/trait.Index.html#tymethod.index' class='fnname'>index</a>(&amp;self, key: &amp;Q) -&gt; &amp;V</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/alloc/btree/map.rs.html#1798-1800' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a reference to the value corresponding to the supplied key.</p>
<h1 id="panics-2" class="section-header"><a href="#panics-2">Panics</a></h1>
<p>Panics if the key is not present in the <code>BTreeMap</code>.</p>
</div></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'>
            <h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;K, V&gt; <a class="trait" href="../../core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="../../core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;V: <a class="trait" href="../../core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,&nbsp;</span></code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;K, V&gt; <a class="trait" href="../../core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../alloc/btree_map/struct.BTreeMap.html" title="struct alloc::btree_map::BTreeMap">BTreeMap</a>&lt;K, V&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="../../core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;V: <a class="trait" href="../../core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,&nbsp;</span></code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>&#9166;</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g. <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "alloc";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>