457 lines
170 KiB
HTML
457 lines
170 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A simple “flat” map based on a sorted vector"><title>LiteMap in litemap - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="litemap" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">LiteMap</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../litemap/index.html">litemap</a><span class="version">0.8.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">LiteMap</a></h2><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.as_slice" title="as_slice">as_slice</a></li><li><a href="#method.as_sliced" title="as_sliced">as_sliced</a></li><li><a href="#method.clear" title="clear">clear</a></li><li><a href="#method.const_get_indexed_or_panic" title="const_get_indexed_or_panic">const_get_indexed_or_panic</a></li><li><a href="#method.const_get_with_index" title="const_get_with_index">const_get_with_index</a></li><li><a href="#method.const_get_with_index-1" title="const_get_with_index">const_get_with_index</a></li><li><a href="#method.const_get_with_index-10" title="const_get_with_index">const_get_with_index</a></li><li><a href="#method.const_get_with_index-11" title="const_get_with_index">const_get_with_index</a></li><li><a href="#method.const_get_with_index-12" title="const_get_with_index">const_get_with_index</a></li><li><a href="#method.const_get_with_index-13" title="const_get_with_index">const_get_with_index</a></li><li><a href="#method.const_get_with_index-2" title="const_get_with_index">const_get_with_index</a></li><li><a href="#method.const_get_with_index-3" title="const_get_with_index">const_get_with_index</a></li><li><a href="#method.const_get_with_index-4" title="const_get_with_index">const_get_with_index</a></li><li><a href="#method.const_get_with_index-5" title="const_get_with_index">const_get_with_index</a></li><li><a href="#method.const_get_with_index-6" title="const_get_with_index">const_get_with_index</a></li><li><a href="#method.const_get_with_index-7" title="const_get_with_index">const_get_with_index</a></li><li><a href="#method.const_get_with_index-8" title="const_get_with_index">const_get_with_index</a></li><li><a href="#method.const_get_with_index-9" title="const_get_with_index">const_get_with_index</a></li><li><a href="#method.const_is_empty" title="const_is_empty">const_is_empty</a></li><li><a href="#method.const_len" title="const_len">const_len</a></li><li><a href="#method.contains_key" title="contains_key">contains_key</a></li><li><a href="#method.entry" title="entry">entry</a></li><li><a href="#method.extend_from_litemap" title="extend_from_litemap">extend_from_litemap</a></li><li><a href="#method.find_index" title="find_index">find_index</a></li><li><a href="#method.first" title="first">first</a></li><li><a href="#method.from_sorted_store_unchecked" title="from_sorted_store_unchecked">from_sorted_store_unchecked</a></li><li><a href="#method.get" title="get">get</a></li><li><a href="#method.get_by" title="get_by">get_by</a></li><li><a href="#method.get_indexed" title="get_indexed">get_indexed</a></li><li><a href="#method.get_indexed_range" title="get_indexed_range">get_indexed_range</a></li><li><a href="#method.get_mut" title="get_mut">get_mut</a></li><li><a href="#method.insert" title="insert">insert</a></li><li><a href="#method.is_empty" title="is_empty">is_empty</a></li><li><a href="#method.iter" title="iter">iter</a></li><li><a href="#method.iter_keys" title="iter_keys">iter_keys</a></li><li><a href="#method.iter_mut" title="iter_mut">iter_mut</a></li><li><a href="#method.iter_values" title="iter_values">iter_values</a></li><li><a href="#method.keys" title="keys">keys</a></li><li><a href="#method.last" title="last">last</a></li><li><a href="#method.len" title="len">len</a></li><li><a href="#method.new" title="new">new</a></li><li><a href="#method.remove" title="remove">remove</a></li><li><a href="#method.reserve" title="reserve">reserve</a></li><li><a href="#method.retain" title="retain">retain</a></li><li><a href="#method.to_borrowed_keys" title="to_borrowed_keys">to_borrowed_keys</a></li><li><a href="#method.to_borrowed_keys_values" title="to_borrowed_keys_values">to_borrowed_keys_values</a></li><li><a href="#method.to_borrowed_values" title="to_borrowed_values">to_borrowed_values</a></li><li><a href="#method.try_append" title="try_append">try_append</a></li><li><a href="#method.try_get_or_insert" title="try_get_or_insert">try_get_or_insert</a></li><li><a href="#method.try_insert" title="try_insert">try_insert</a></li><li><a href="#method.values" title="values">values</a></li><li><a href="#method.with_capacity" title="with_capacity">with_capacity</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Clone-for-LiteMap%3CK,+V,+S%3E" title="Clone">Clone</a></li><li><a href="#impl-Debug-for-LiteMap%3CK,+V,+S%3E" title="Debug">Debug</a></li><li><a href="#impl-Default-for-LiteMap%3CK,+V,+S%3E" title="Default">Default</a></li><li><a href="#impl-Eq-for-LiteMap%3CK,+V,+S%3E" title="Eq">Eq</a></li><li><a href="#impl-Extend%3C(K,+V)%3E-for-LiteMap%3CK,+V,+S%3E" title="Extend<(K, V)>">Extend<(K, V)></a></li><li><a href="#impl-FromIterator%3C(K,+V)%3E-for-LiteMap%3CK,+V,+S%3E" title="FromIterator<(K, V)>">FromIterator<(K, V)></a></li><li><a href="#impl-Hash-for-LiteMap%3CK,+V,+S%3E" title="Hash">Hash</a></li><li><a href="#impl-Index%3C%26K%3E-for-LiteMap%3CK,+V,+S%3E" title="Index<&K>">Index<&K></a></li><li><a href="#impl-IndexMut%3C%26K%3E-for-LiteMap%3CK,+V,+S%3E" title="IndexMut<&K>">IndexMut<&K></a></li><li><a href="#impl-IntoIterator-for-%26LiteMap%3CK,+V,+S%3E" title="IntoIterator">IntoIterator</a></li><li><a href="#impl-IntoIterator-for-%26mut+LiteMap%3CK,+V,+S%3E" title="IntoIterator">IntoIterator</a></li><li><a href="#impl-IntoIterator-for-LiteMap%3CK,+V,+S%3E" title="IntoIterator">IntoIterator</a></li><li><a href="#impl-Ord-for-LiteMap%3CK,+V,+S%3E" title="Ord">Ord</a></li><li><a href="#impl-PartialEq-for-LiteMap%3CK,+V,+S%3E" title="PartialEq">PartialEq</a></li><li><a href="#impl-PartialOrd-for-LiteMap%3CK,+V,+S%3E" title="PartialOrd">PartialOrd</a></li><li><a href="#impl-StructuralPartialEq-for-LiteMap%3CK,+V,+S%3E" title="StructuralPartialEq">StructuralPartialEq</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-LiteMap%3CK,+V,+S%3E" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-LiteMap%3CK,+V,+S%3E" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-LiteMap%3CK,+V,+S%3E" title="Send">Send</a></li><li><a href="#impl-Sync-for-LiteMap%3CK,+V,+S%3E" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-LiteMap%3CK,+V,+S%3E" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-LiteMap%3CK,+V,+S%3E" title="UnwindSafe">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow<T>">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut<T>">BorrowMut<T></a></li><li><a href="#impl-CloneToUninit-for-T" title="CloneToUninit">CloneToUninit</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From<T>">From<T></a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into<U>">Into<U></a></li><li><a href="#impl-ToOwned-for-T" title="ToOwned">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom<U>">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto<U>">TryInto<U></a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate litemap</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">litemap</a></div><h1>Struct <span class="struct">LiteMap</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/litemap/map.rs.html#39">Source</a> </span></div><pre class="rust item-decl"><code>pub struct LiteMap<K: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, V: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, S> { <span class="comment">/* private fields */</span> }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A simple “flat” map based on a sorted vector</p>
|
||
<p>See the <a href="index.html" title="mod litemap">module level documentation</a> for why one should use this.</p>
|
||
<p>The API is roughly similar to that of <a href="https://doc.rust-lang.org/1.93.1/alloc/collections/btree/map/struct.BTreeMap.html" title="struct alloc::collections::btree::map::BTreeMap"><code>std::collections::BTreeMap</code></a>.</p>
|
||
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#55-66">Source</a><a href="#impl-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K, V, S> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from_sorted_store_unchecked" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#59-65">Source</a><h4 class="code-header">pub const fn <a href="#method.from_sorted_store_unchecked" class="fn">from_sorted_store_unchecked</a>(values: S) -> Self</h4></section></summary><div class="docblock"><p>Construct a new <a href="struct.LiteMap.html" title="struct litemap::LiteMap"><code>LiteMap</code></a> using the given values</p>
|
||
<p>The store must be sorted and have no duplicate keys.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3CK,+V,+S%3E-1" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#79-91">Source</a><a href="#impl-LiteMap%3CK,+V,+S%3E-1" class="anchor">§</a><h3 class="code-header">impl<K: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, V: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, S> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
S: <a class="trait" href="store/trait.StoreConstEmpty.html" title="trait litemap::store::StoreConstEmpty">StoreConstEmpty</a><K, V>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#84-90">Source</a><h4 class="code-header">pub const fn <a href="#method.new" class="fn">new</a>() -> Self</h4></section></summary><div class="docblock"><p>Create a new empty <a href="struct.LiteMap.html" title="struct litemap::LiteMap"><code>LiteMap</code></a></p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3CK,+V,+S%3E-2" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#93-269">Source</a><a href="#impl-LiteMap%3CK,+V,+S%3E-2" class="anchor">§</a><h3 class="code-header">impl<K: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, V: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, S> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
S: <a class="trait" href="store/trait.Store.html" title="trait litemap::store::Store">Store</a><K, V>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.len" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#98-100">Source</a><h4 class="code-header">pub fn <a href="#method.len" class="fn">len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>The number of elements in the <a href="struct.LiteMap.html" title="struct litemap::LiteMap"><code>LiteMap</code></a></p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_empty" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#103-105">Source</a><h4 class="code-header">pub fn <a href="#method.is_empty" class="fn">is_empty</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Whether the <a href="struct.LiteMap.html" title="struct litemap::LiteMap"><code>LiteMap</code></a> is empty</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_indexed" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#111-113">Source</a><h4 class="code-header">pub fn <a href="#method.get_indexed" class="fn">get_indexed</a>(&self, index: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&V</a>)></h4></section></summary><div class="docblock"><p>Get the key-value pair residing at a particular index</p>
|
||
<p>In most cases, prefer <a href="struct.LiteMap.html#method.get" title="method litemap::LiteMap::get"><code>LiteMap::get()</code></a> over this method.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.first" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#128-130">Source</a><h4 class="code-header">pub fn <a href="#method.first" class="fn">first</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&V</a>)></h4></section></summary><div class="docblock"><p>Get the lowest-rank key/value pair from the <code>LiteMap</code>, if it exists.</p>
|
||
<h5 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>map =
|
||
LiteMap::<i32, <span class="kw-2">&</span>str, Vec<<span class="kw">_</span>>>::from_iter([(<span class="number">1</span>, <span class="string">"uno"</span>), (<span class="number">3</span>, <span class="string">"tres"</span>)]);
|
||
|
||
<span class="macro">assert_eq!</span>(map.first(), <span class="prelude-val">Some</span>((<span class="kw-2">&</span><span class="number">1</span>, <span class="kw-2">&</span><span class="string">"uno"</span>)));</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.last" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#145-147">Source</a><h4 class="code-header">pub fn <a href="#method.last" class="fn">last</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&V</a>)></h4></section></summary><div class="docblock"><p>Get the highest-rank key/value pair from the <code>LiteMap</code>, if it exists.</p>
|
||
<h5 id="examples-1"><a class="doc-anchor" href="#examples-1">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>map =
|
||
LiteMap::<i32, <span class="kw-2">&</span>str, Vec<<span class="kw">_</span>>>::from_iter([(<span class="number">1</span>, <span class="string">"uno"</span>), (<span class="number">3</span>, <span class="string">"tres"</span>)]);
|
||
|
||
<span class="macro">assert_eq!</span>(map.last(), <span class="prelude-val">Some</span>((<span class="kw-2">&</span><span class="number">3</span>, <span class="kw-2">&</span><span class="string">"tres"</span>)));</code></pre></div></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3CK,+V,+S%3E-3" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#271-339">Source</a><a href="#impl-LiteMap%3CK,+V,+S%3E-3" class="anchor">§</a><h3 class="code-header">impl<K, V: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, S> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
|
||
S: <a class="trait" href="store/trait.Store.html" title="trait litemap::store::Store">Store</a><K, V>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.get" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#287-297">Source</a><h4 class="code-header">pub fn <a href="#method.get" class="fn">get</a><Q>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&Q</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&V</a>><div class="where">where
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q>,
|
||
Q: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Get the value associated with <code>key</code>, if it exists.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>map = LiteMap::new_vec();
|
||
map.insert(<span class="number">1</span>, <span class="string">"one"</span>);
|
||
map.insert(<span class="number">2</span>, <span class="string">"two"</span>);
|
||
<span class="macro">assert_eq!</span>(map.get(<span class="kw-2">&</span><span class="number">1</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="string">"one"</span>));
|
||
<span class="macro">assert_eq!</span>(map.get(<span class="kw-2">&</span><span class="number">3</span>), <span class="prelude-val">None</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.get_by" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#300-303">Source</a><h4 class="code-header">pub fn <a href="#method.get_by" class="fn">get_by</a>(&self, predicate: impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&K</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&V</a>></h4></section></summary><div class="docblock"><p>Binary search the map with <code>predicate</code> to find a key, returning the value.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.contains_key" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#316-322">Source</a><h4 class="code-header">pub fn <a href="#method.contains_key" class="fn">contains_key</a><Q>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&Q</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a><div class="where">where
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q>,
|
||
Q: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Returns whether <code>key</code> is contained in this map</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>map = LiteMap::new_vec();
|
||
map.insert(<span class="number">1</span>, <span class="string">"one"</span>);
|
||
map.insert(<span class="number">2</span>, <span class="string">"two"</span>);
|
||
<span class="macro">assert!</span>(map.contains_key(<span class="kw-2">&</span><span class="number">1</span>));
|
||
<span class="macro">assert!</span>(!map.contains_key(<span class="kw-2">&</span><span class="number">3</span>));</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.find_index" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#332-338">Source</a><h4 class="code-header">pub fn <a href="#method.find_index" class="fn">find_index</a><Q>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&Q</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>><div class="where">where
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q>,
|
||
Q: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Obtain the index for a given key, or if the key is not found, the index
|
||
at which it would be inserted.</p>
|
||
<p>(The return value works equivalently to <a href="https://doc.rust-lang.org/1.93.1/std/primitive.slice.html#method.binary_search_by" title="method slice::binary_search_by"><code>slice::binary_search_by()</code></a>)</p>
|
||
<p>The indices returned can be used with <a href="struct.LiteMap.html#method.get_indexed" title="method litemap::LiteMap::get_indexed"><code>Self::get_indexed()</code></a>. Prefer using
|
||
<a href="struct.LiteMap.html#method.get" title="method litemap::LiteMap::get"><code>Self::get()</code></a> directly where possible.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3CK,+V,+S%3E-4" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#341-421">Source</a><a href="#impl-LiteMap%3CK,+V,+S%3E-4" class="anchor">§</a><h3 class="code-header">impl<K: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, V: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, S> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
S: <a class="trait" href="store/trait.StoreSlice.html" title="trait litemap::store::StoreSlice">StoreSlice</a><K, V>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.get_indexed_range" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#362-369">Source</a><h4 class="code-header">pub fn <a href="#method.get_indexed_range" class="fn">get_indexed_range</a>(
|
||
&self,
|
||
range: <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/ops/range/struct.Range.html" title="struct core::ops::range::Range">Range</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, &S::<a class="associatedtype" href="store/trait.StoreSlice.html#associatedtype.Slice" title="type litemap::store::StoreSlice::Slice">Slice</a>>></h4></section></summary><div class="docblock"><p>Creates a new <a href="struct.LiteMap.html" title="struct litemap::LiteMap"><code>LiteMap</code></a> from a range of the current <a href="struct.LiteMap.html" title="struct litemap::LiteMap"><code>LiteMap</code></a>.</p>
|
||
<h5 id="examples-2"><a class="doc-anchor" href="#examples-2">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>map = LiteMap::new_vec();
|
||
map.insert(<span class="number">1</span>, <span class="string">"one"</span>);
|
||
map.insert(<span class="number">2</span>, <span class="string">"two"</span>);
|
||
map.insert(<span class="number">3</span>, <span class="string">"three"</span>);
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>sub_map = map.get_indexed_range(<span class="number">1</span>..<span class="number">3</span>).expect(<span class="string">"valid range"</span>);
|
||
<span class="macro">assert_eq!</span>(sub_map.get(<span class="kw-2">&</span><span class="number">1</span>), <span class="prelude-val">None</span>);
|
||
<span class="macro">assert_eq!</span>(sub_map.get(<span class="kw-2">&</span><span class="number">2</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="string">"two"</span>));
|
||
<span class="macro">assert_eq!</span>(sub_map.get(<span class="kw-2">&</span><span class="number">3</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="string">"three"</span>));</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.as_sliced" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#389-398">Source</a><h4 class="code-header">pub fn <a href="#method.as_sliced" class="fn">as_sliced</a>(&self) -> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, &S::<a class="associatedtype" href="store/trait.StoreSlice.html#associatedtype.Slice" title="type litemap::store::StoreSlice::Slice">Slice</a>></h4></section></summary><div class="docblock"><p>Borrows this <a href="struct.LiteMap.html" title="struct litemap::LiteMap"><code>LiteMap</code></a> as one of its slice type.</p>
|
||
<p>This can be useful in situations where you need a <code>LiteMap</code> by value but do not want
|
||
to clone the owned version.</p>
|
||
<h5 id="examples-3"><a class="doc-anchor" href="#examples-3">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>map = LiteMap::new_vec();
|
||
map.insert(<span class="number">1</span>, <span class="string">"one"</span>);
|
||
map.insert(<span class="number">2</span>, <span class="string">"two"</span>);
|
||
|
||
<span class="kw">let </span>borrowed_map = map.as_sliced();
|
||
<span class="macro">assert_eq!</span>(borrowed_map.get(<span class="kw-2">&</span><span class="number">1</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="string">"one"</span>));
|
||
<span class="macro">assert_eq!</span>(borrowed_map.get(<span class="kw-2">&</span><span class="number">2</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="string">"two"</span>));</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.as_slice" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#416-420">Source</a><h4 class="code-header">pub fn <a href="#method.as_slice" class="fn">as_slice</a>(&self) -> &S::<a class="associatedtype" href="store/trait.StoreSlice.html#associatedtype.Slice" title="type litemap::store::StoreSlice::Slice">Slice</a></h4></section></summary><div class="docblock"><p>Borrows the backing buffer of this <a href="struct.LiteMap.html" title="struct litemap::LiteMap"><code>LiteMap</code></a> as its slice type.</p>
|
||
<p>The slice will be sorted.</p>
|
||
<h5 id="examples-4"><a class="doc-anchor" href="#examples-4">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>map = LiteMap::new_vec();
|
||
map.insert(<span class="number">1</span>, <span class="string">"one"</span>);
|
||
map.insert(<span class="number">2</span>, <span class="string">"two"</span>);
|
||
|
||
<span class="kw">let </span>slice = map.as_slice();
|
||
<span class="macro">assert_eq!</span>(slice, <span class="kw-2">&</span>[(<span class="number">1</span>, <span class="string">"one"</span>), (<span class="number">2</span>, <span class="string">"two"</span>)]);</code></pre></div></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3CK,+V,+S%3E-5" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#423-530">Source</a><a href="#impl-LiteMap%3CK,+V,+S%3E-5" class="anchor">§</a><h3 class="code-header">impl<'a, K: 'a, V: 'a, S> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
S: <a class="trait" href="store/trait.Store.html" title="trait litemap::store::Store">Store</a><K, V>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.to_borrowed_keys_values" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#442-461">Source</a><h4 class="code-header">pub fn <a href="#method.to_borrowed_keys_values" class="fn">to_borrowed_keys_values</a><KB: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, VB: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, SB>(
|
||
&'a self,
|
||
) -> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a KB</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a VB</a>, SB><div class="where">where
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><KB>,
|
||
V: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><VB>,
|
||
SB: <a class="trait" href="store/trait.StoreMut.html" title="trait litemap::store::StoreMut">StoreMut</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a KB</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a VB</a>>,</div></h4></section></summary><div class="docblock"><p>Returns a new <a href="struct.LiteMap.html" title="struct litemap::LiteMap"><code>LiteMap</code></a> with keys and values borrowed from this one.</p>
|
||
<h5 id="examples-5"><a class="doc-anchor" href="#examples-5">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>map: LiteMap<Box<usize>, String> = LiteMap::new_vec();
|
||
map.insert(Box::new(<span class="number">1</span>), <span class="string">"one"</span>.to_string());
|
||
map.insert(Box::new(<span class="number">2</span>), <span class="string">"two"</span>.to_string());
|
||
|
||
<span class="kw">let </span>borrowed_map: LiteMap<<span class="kw-2">&</span>usize, <span class="kw-2">&</span>str> = map.to_borrowed_keys_values();
|
||
|
||
<span class="macro">assert_eq!</span>(borrowed_map.get(<span class="kw-2">&</span><span class="number">1</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="string">"one"</span>));</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.to_borrowed_keys" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#478-495">Source</a><h4 class="code-header">pub fn <a href="#method.to_borrowed_keys" class="fn">to_borrowed_keys</a><KB: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, SB>(&'a self) -> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a KB</a>, V, SB><div class="where">where
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><KB>,
|
||
V: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
||
SB: <a class="trait" href="store/trait.StoreMut.html" title="trait litemap::store::StoreMut">StoreMut</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a KB</a>, V>,</div></h4></section></summary><div class="docblock"><p>Returns a new <a href="struct.LiteMap.html" title="struct litemap::LiteMap"><code>LiteMap</code></a> with keys borrowed from this one and cloned values.</p>
|
||
<h5 id="examples-6"><a class="doc-anchor" href="#examples-6">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>map: LiteMap<Box<usize>, String> = LiteMap::new_vec();
|
||
map.insert(Box::new(<span class="number">1</span>), <span class="string">"one"</span>.to_string());
|
||
map.insert(Box::new(<span class="number">2</span>), <span class="string">"two"</span>.to_string());
|
||
|
||
<span class="kw">let </span>borrowed_map: LiteMap<<span class="kw-2">&</span>usize, String> = map.to_borrowed_keys();
|
||
|
||
<span class="macro">assert_eq!</span>(borrowed_map.get(<span class="kw-2">&</span><span class="number">1</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="string">"one"</span>.to_string()));</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.to_borrowed_values" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#512-529">Source</a><h4 class="code-header">pub fn <a href="#method.to_borrowed_values" class="fn">to_borrowed_values</a><VB: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, SB>(&'a self) -> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a VB</a>, SB><div class="where">where
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
||
V: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><VB>,
|
||
SB: <a class="trait" href="store/trait.StoreMut.html" title="trait litemap::store::StoreMut">StoreMut</a><K, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a VB</a>>,</div></h4></section></summary><div class="docblock"><p>Returns a new <a href="struct.LiteMap.html" title="struct litemap::LiteMap"><code>LiteMap</code></a> with values borrowed from this one and cloned keys.</p>
|
||
<h5 id="examples-7"><a class="doc-anchor" href="#examples-7">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>map: LiteMap<Box<usize>, String> = LiteMap::new_vec();
|
||
map.insert(Box::new(<span class="number">1</span>), <span class="string">"one"</span>.to_string());
|
||
map.insert(Box::new(<span class="number">2</span>), <span class="string">"two"</span>.to_string());
|
||
|
||
<span class="kw">let </span>borrowed_map: LiteMap<Box<usize>, <span class="kw-2">&</span>str> = map.to_borrowed_values();
|
||
|
||
<span class="macro">assert_eq!</span>(borrowed_map.get(<span class="kw-2">&</span><span class="number">1</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="string">"one"</span>));</code></pre></div></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3CK,+V,+S%3E-6" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#532-559">Source</a><a href="#impl-LiteMap%3CK,+V,+S%3E-6" class="anchor">§</a><h3 class="code-header">impl<K, V, S> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
S: <a class="trait" href="store/trait.StoreMut.html" title="trait litemap::store::StoreMut">StoreMut</a><K, V>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.with_capacity" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#537-543">Source</a><h4 class="code-header">pub fn <a href="#method.with_capacity" class="fn">with_capacity</a>(capacity: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> Self</h4></section></summary><div class="docblock"><p>Construct a new <a href="struct.LiteMap.html" title="struct litemap::LiteMap"><code>LiteMap</code></a> with a given capacity</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.clear" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#546-548">Source</a><h4 class="code-header">pub fn <a href="#method.clear" class="fn">clear</a>(&mut self)</h4></section></summary><div class="docblock"><p>Remove all elements from the <a href="struct.LiteMap.html" title="struct litemap::LiteMap"><code>LiteMap</code></a></p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.reserve" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#556-558">Source</a><h4 class="code-header">pub fn <a href="#method.reserve" class="fn">reserve</a>(&mut self, additional: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>)</h4></section></summary><div class="docblock"><p>Reserve capacity for <code>additional</code> more elements to be inserted into
|
||
the <a href="struct.LiteMap.html" title="struct litemap::LiteMap"><code>LiteMap</code></a> to avoid frequent reallocations.</p>
|
||
<p>See <a href="alloc::vec::Vec::reserve"><code>Vec::reserve()</code></a> for more information.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3CK,+V,+S%3E-7" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#561-773">Source</a><a href="#impl-LiteMap%3CK,+V,+S%3E-7" class="anchor">§</a><h3 class="code-header">impl<K, V, S> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,
|
||
S: <a class="trait" href="store/trait.StoreMut.html" title="trait litemap::store::StoreMut">StoreMut</a><K, V>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.get_mut" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#579-589">Source</a><h4 class="code-header">pub fn <a href="#method.get_mut" class="fn">get_mut</a><Q>(&mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&Q</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&mut V</a>><div class="where">where
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q>,
|
||
Q: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Get the value associated with <code>key</code>, if it exists, as a mutable reference.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>map = LiteMap::new_vec();
|
||
map.insert(<span class="number">1</span>, <span class="string">"one"</span>);
|
||
map.insert(<span class="number">2</span>, <span class="string">"two"</span>);
|
||
<span class="kw">if let </span><span class="prelude-val">Some</span>(<span class="kw-2">mut </span>v) = map.get_mut(<span class="kw-2">&</span><span class="number">1</span>) {
|
||
<span class="kw-2">*</span>v = <span class="string">"uno"</span>;
|
||
}
|
||
<span class="macro">assert_eq!</span>(map.get(<span class="kw-2">&</span><span class="number">1</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="string">"uno"</span>));</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_append" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#620-629">Source</a><h4 class="code-header">pub fn <a href="#method.try_append" class="fn">try_append</a>(&mut self, key: K, value: V) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.tuple.html">(K, V)</a>></h4></section></summary><div class="docblock"><p>Appends <code>value</code> with <code>key</code> to the end of the underlying vector, returning
|
||
<code>key</code> and <code>value</code> <em>if it failed</em>. Useful for extending with an existing
|
||
sorted list.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>map = LiteMap::new_vec();
|
||
<span class="macro">assert!</span>(map.try_append(<span class="number">1</span>, <span class="string">"uno"</span>).is_none());
|
||
<span class="macro">assert!</span>(map.try_append(<span class="number">3</span>, <span class="string">"tres"</span>).is_none());
|
||
|
||
<span class="macro">assert!</span>(
|
||
<span class="macro">matches!</span>(map.try_append(<span class="number">3</span>, <span class="string">"tres-updated"</span>), <span class="prelude-val">Some</span>((<span class="number">3</span>, <span class="string">"tres-updated"</span>))),
|
||
<span class="string">"append duplicate of last key"</span>,
|
||
);
|
||
|
||
<span class="macro">assert!</span>(
|
||
<span class="macro">matches!</span>(map.try_append(<span class="number">2</span>, <span class="string">"dos"</span>), <span class="prelude-val">Some</span>((<span class="number">2</span>, <span class="string">"dos"</span>))),
|
||
<span class="string">"append out of order"
|
||
</span>);
|
||
|
||
<span class="macro">assert_eq!</span>(map.get(<span class="kw-2">&</span><span class="number">1</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="string">"uno"</span>));
|
||
|
||
<span class="comment">// contains the original value for the key: 3
|
||
</span><span class="macro">assert_eq!</span>(map.get(<span class="kw-2">&</span><span class="number">3</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="string">"tres"</span>));
|
||
|
||
<span class="comment">// not appended since it wasn't in order
|
||
</span><span class="macro">assert_eq!</span>(map.get(<span class="kw-2">&</span><span class="number">2</span>), <span class="prelude-val">None</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.insert" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#642-644">Source</a><h4 class="code-header">pub fn <a href="#method.insert" class="fn">insert</a>(&mut self, key: K, value: V) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><V></h4></section></summary><div class="docblock"><p>Insert <code>value</code> with <code>key</code>, returning the existing value if it exists.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>map = LiteMap::new_vec();
|
||
map.insert(<span class="number">1</span>, <span class="string">"one"</span>);
|
||
map.insert(<span class="number">2</span>, <span class="string">"two"</span>);
|
||
<span class="macro">assert_eq!</span>(map.get(<span class="kw-2">&</span><span class="number">1</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="string">"one"</span>));
|
||
<span class="macro">assert_eq!</span>(map.get(<span class="kw-2">&</span><span class="number">3</span>), <span class="prelude-val">None</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_insert" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#684-692">Source</a><h4 class="code-header">pub fn <a href="#method.try_insert" class="fn">try_insert</a>(&mut self, key: K, value: V) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.tuple.html">(K, V)</a>></h4></section></summary><div class="docblock"><p>Attempts to insert a unique entry into the map.</p>
|
||
<p>If <code>key</code> is not already in the map, inserts it with the corresponding <code>value</code>
|
||
and returns <code>None</code>.</p>
|
||
<p>If <code>key</code> is already in the map, no change is made to the map, and the key and value
|
||
are returned back to the caller.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>map = LiteMap::new_vec();
|
||
map.insert(<span class="number">1</span>, <span class="string">"one"</span>);
|
||
map.insert(<span class="number">3</span>, <span class="string">"three"</span>);
|
||
|
||
<span class="comment">// 2 is not yet in the map...
|
||
</span><span class="macro">assert_eq!</span>(map.try_insert(<span class="number">2</span>, <span class="string">"two"</span>), <span class="prelude-val">None</span>);
|
||
<span class="macro">assert_eq!</span>(map.len(), <span class="number">3</span>);
|
||
|
||
<span class="comment">// ...but now it is.
|
||
</span><span class="macro">assert_eq!</span>(map.try_insert(<span class="number">2</span>, <span class="string">"TWO"</span>), <span class="prelude-val">Some</span>((<span class="number">2</span>, <span class="string">"TWO"</span>)));
|
||
<span class="macro">assert_eq!</span>(map.len(), <span class="number">3</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.try_get_or_insert" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#735-750">Source</a><h4 class="code-header">pub fn <a href="#method.try_get_or_insert" class="fn">try_get_or_insert</a><E>(
|
||
&mut self,
|
||
key: K,
|
||
value: impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&K</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><V, E>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&V</a>), E></h4></section></summary><div class="docblock"><p>Attempts to insert a unique entry into the map.</p>
|
||
<p>If <code>key</code> is not already in the map, invokes the closure to compute <code>value</code>, inserts
|
||
the pair into the map, and returns a reference to the value. The closure is passed
|
||
a reference to the <code>key</code> argument.</p>
|
||
<p>If <code>key</code> is already in the map, a reference to the existing value is returned.</p>
|
||
<p>Additionally, the index of the value in the map is returned. If it is not desirable
|
||
to hold on to the mutable reference’s lifetime, the index can be used to access the
|
||
element via <a href="struct.LiteMap.html#method.get_indexed" title="method litemap::LiteMap::get_indexed"><code>LiteMap::get_indexed()</code></a>.</p>
|
||
<p>The closure returns a <code>Result</code> to allow for a fallible insertion function. If the
|
||
creation of <code>value</code> is infallible, you can use <a href="https://doc.rust-lang.org/1.93.1/core/convert/enum.Infallible.html" title="enum core::convert::Infallible"><code>core::convert::Infallible</code></a>.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="doccomment">/// Helper function to unwrap an `Infallible` result from the insertion function
|
||
</span><span class="kw">fn </span>unwrap_infallible<T>(result: <span class="prelude-ty">Result</span><T, core::convert::Infallible>) -> T {
|
||
result.unwrap_or_else(|never| <span class="kw">match </span>never {})
|
||
}
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>map = LiteMap::new_vec();
|
||
map.insert(<span class="number">1</span>, <span class="string">"one"</span>);
|
||
map.insert(<span class="number">3</span>, <span class="string">"three"</span>);
|
||
|
||
<span class="comment">// 2 is not yet in the map...
|
||
</span><span class="kw">let </span>result1 = unwrap_infallible(
|
||
map.try_get_or_insert(<span class="number">2</span>, |<span class="kw">_</span>| <span class="prelude-val">Ok</span>(<span class="string">"two"</span>))
|
||
);
|
||
<span class="macro">assert_eq!</span>(result1.<span class="number">1</span>, <span class="kw-2">&</span><span class="string">"two"</span>);
|
||
<span class="macro">assert_eq!</span>(map.len(), <span class="number">3</span>);
|
||
|
||
<span class="comment">// ...but now it is.
|
||
</span><span class="kw">let </span>result1 = unwrap_infallible(
|
||
map.try_get_or_insert(<span class="number">2</span>, |<span class="kw">_</span>| <span class="prelude-val">Ok</span>(<span class="string">"TWO"</span>))
|
||
);
|
||
<span class="macro">assert_eq!</span>(result1.<span class="number">1</span>, <span class="kw-2">&</span><span class="string">"two"</span>);
|
||
<span class="macro">assert_eq!</span>(map.len(), <span class="number">3</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.remove" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#763-772">Source</a><h4 class="code-header">pub fn <a href="#method.remove" class="fn">remove</a><Q>(&mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&Q</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><V><div class="where">where
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q>,
|
||
Q: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Remove the value at <code>key</code>, returning it if it exists.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>map = LiteMap::new_vec();
|
||
map.insert(<span class="number">1</span>, <span class="string">"one"</span>);
|
||
map.insert(<span class="number">2</span>, <span class="string">"two"</span>);
|
||
<span class="macro">assert_eq!</span>(map.remove(<span class="kw-2">&</span><span class="number">1</span>), <span class="prelude-val">Some</span>(<span class="string">"one"</span>));
|
||
<span class="macro">assert_eq!</span>(map.get(<span class="kw-2">&</span><span class="number">1</span>), <span class="prelude-val">None</span>);</code></pre></div></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3CK,+V,+S%3E-8" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#775-847">Source</a><a href="#impl-LiteMap%3CK,+V,+S%3E-8" class="anchor">§</a><h3 class="code-header">impl<K, V, S> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,
|
||
S: <a class="trait" href="store/trait.StoreIntoIterator.html" title="trait litemap::store::StoreIntoIterator">StoreIntoIterator</a><K, V> + <a class="trait" href="store/trait.StoreFromIterator.html" title="trait litemap::store::StoreFromIterator">StoreFromIterator</a><K, V>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.extend_from_litemap" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#812-846">Source</a><h4 class="code-header">pub fn <a href="#method.extend_from_litemap" class="fn">extend_from_litemap</a>(&mut self, other: Self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self></h4></section></summary><div class="docblock"><p>Insert all elements from <code>other</code> into this <code>LiteMap</code>.</p>
|
||
<p>If <code>other</code> contains keys that already exist in <code>self</code>, the values in <code>other</code> replace the
|
||
corresponding ones in <code>self</code>, and the rejected items from <code>self</code> are returned as a new
|
||
<code>LiteMap</code>. Otherwise, <code>None</code> is returned.</p>
|
||
<p>The implementation of this function is optimized if <code>self</code> and <code>other</code> have no overlap.</p>
|
||
<h5 id="examples-8"><a class="doc-anchor" href="#examples-8">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>map1 = LiteMap::new_vec();
|
||
map1.insert(<span class="number">1</span>, <span class="string">"one"</span>);
|
||
map1.insert(<span class="number">2</span>, <span class="string">"two"</span>);
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>map2 = LiteMap::new_vec();
|
||
map2.insert(<span class="number">2</span>, <span class="string">"TWO"</span>);
|
||
map2.insert(<span class="number">4</span>, <span class="string">"FOUR"</span>);
|
||
|
||
<span class="kw">let </span>leftovers = map1.extend_from_litemap(map2);
|
||
|
||
<span class="macro">assert_eq!</span>(map1.len(), <span class="number">3</span>);
|
||
<span class="macro">assert_eq!</span>(map1.get(<span class="kw-2">&</span><span class="number">1</span>), <span class="prelude-val">Some</span>(<span class="string">"one"</span>).as_ref());
|
||
<span class="macro">assert_eq!</span>(map1.get(<span class="kw-2">&</span><span class="number">2</span>), <span class="prelude-val">Some</span>(<span class="string">"TWO"</span>).as_ref());
|
||
<span class="macro">assert_eq!</span>(map1.get(<span class="kw-2">&</span><span class="number">4</span>), <span class="prelude-val">Some</span>(<span class="string">"FOUR"</span>).as_ref());
|
||
|
||
<span class="kw">let </span>map3 = leftovers.expect(<span class="string">"Duplicate keys"</span>);
|
||
<span class="macro">assert_eq!</span>(map3.len(), <span class="number">1</span>);
|
||
<span class="macro">assert_eq!</span>(map3.get(<span class="kw-2">&</span><span class="number">2</span>), <span class="prelude-val">Some</span>(<span class="string">"two"</span>).as_ref());</code></pre></div></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3CK,+V,+S%3E-9" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#899-929">Source</a><a href="#impl-LiteMap%3CK,+V,+S%3E-9" class="anchor">§</a><h3 class="code-header">impl<'a, K: 'a, V: 'a, S> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
S: <a class="trait" href="store/trait.StoreIterable.html" title="trait litemap::store::StoreIterable">StoreIterable</a><'a, K, V>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.iter" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#904-906">Source</a><h4 class="code-header">pub fn <a href="#method.iter" class="fn">iter</a>(&'a self) -> impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator">DoubleEndedIterator</a><Item = (<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a V</a>)></h4></section></summary><div class="docblock"><p>Produce an ordered iterator over key-value pairs</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.iter_keys" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#910-912">Source</a><h4 class="code-header">pub fn <a href="#method.iter_keys" class="fn">iter_keys</a>(&'a self) -> impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator">DoubleEndedIterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a K</a>></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated: use keys() instead</span></div></span></summary><div class="docblock"><p>Produce an ordered iterator over keys</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.iter_values" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#916-918">Source</a><h4 class="code-header">pub fn <a href="#method.iter_values" class="fn">iter_values</a>(&'a self) -> impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator">DoubleEndedIterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a V</a>></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated: use values() instead</span></div></span></summary><div class="docblock"><p>Produce an iterator over values, ordered by their keys</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.keys" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#921-923">Source</a><h4 class="code-header">pub fn <a href="#method.keys" class="fn">keys</a>(&'a self) -> impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator">DoubleEndedIterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a K</a>></h4></section></summary><div class="docblock"><p>Produce an ordered iterator over keys</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.values" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#926-928">Source</a><h4 class="code-header">pub fn <a href="#method.values" class="fn">values</a>(&'a self) -> impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator">DoubleEndedIterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a V</a>></h4></section></summary><div class="docblock"><p>Produce an iterator over values, ordered by their keys</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3CK,+V,+S%3E-10" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#931-939">Source</a><a href="#impl-LiteMap%3CK,+V,+S%3E-10" class="anchor">§</a><h3 class="code-header">impl<'a, K: 'a, V: 'a, S> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
S: <a class="trait" href="store/trait.StoreIterableMut.html" title="trait litemap::store::StoreIterableMut">StoreIterableMut</a><'a, K, V>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.iter_mut" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#936-938">Source</a><h4 class="code-header">pub fn <a href="#method.iter_mut" class="fn">iter_mut</a>(
|
||
&'a mut self,
|
||
) -> impl <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator">DoubleEndedIterator</a><Item = (<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a mut V</a>)></h4></section></summary><div class="docblock"><p>Produce an ordered mutable iterator over key-value pairs</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3CK,+V,+S%3E-11" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#977-1008">Source</a><a href="#impl-LiteMap%3CK,+V,+S%3E-11" class="anchor">§</a><h3 class="code-header">impl<K, V, S> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
S: <a class="trait" href="store/trait.StoreBulkMut.html" title="trait litemap::store::StoreBulkMut">StoreBulkMut</a><K, V>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.retain" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#1002-1007">Source</a><h4 class="code-header">pub fn <a href="#method.retain" class="fn">retain</a><F>(&mut self, predicate: F)<div class="where">where
|
||
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&V</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a>,</div></h4></section></summary><div class="docblock"><p>Retains only the elements specified by the predicate.</p>
|
||
<p>In other words, remove all elements such that <code>f((&k, &v))</code> returns <code>false</code>.</p>
|
||
<h5 id="example"><a class="doc-anchor" href="#example">§</a>Example</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>map = LiteMap::new_vec();
|
||
map.insert(<span class="number">1</span>, <span class="string">"one"</span>);
|
||
map.insert(<span class="number">2</span>, <span class="string">"two"</span>);
|
||
map.insert(<span class="number">3</span>, <span class="string">"three"</span>);
|
||
|
||
<span class="comment">// Retain elements with odd keys
|
||
</span>map.retain(|k, <span class="kw">_</span>| k % <span class="number">2 </span>== <span class="number">1</span>);
|
||
|
||
<span class="macro">assert_eq!</span>(map.get(<span class="kw-2">&</span><span class="number">1</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="string">"one"</span>));
|
||
<span class="macro">assert_eq!</span>(map.get(<span class="kw-2">&</span><span class="number">2</span>), <span class="prelude-val">None</span>);</code></pre></div></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3CK,+V,+%26%5B(K,+V)%5D%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#1010-1069">Source</a><a href="#impl-LiteMap%3CK,+V,+%26%5B(K,+V)%5D%3E" class="anchor">§</a><h3 class="code-header">impl<'a, K, V> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, &'a [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.tuple.html">(K, V)</a>]></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.const_len" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#1025-1027">Source</a><h4 class="code-header">pub const fn <a href="#method.const_len" class="fn">const_len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Const version of <a href="struct.LiteMap.html#method.len" title="method litemap::LiteMap::len"><code>LiteMap::len()</code></a> for a slice store.</p>
|
||
<p>Note: This function will no longer be needed if const trait behavior is stabilized.</p>
|
||
<h5 id="examples-9"><a class="doc-anchor" href="#examples-9">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">const </span>MAP: LiteMap<<span class="kw-2">&</span>str, usize, <span class="kw-2">&</span>[(<span class="kw-2">&</span>str, usize)]> =
|
||
LiteMap::from_sorted_store_unchecked(<span class="kw-2">&</span>[(<span class="string">"a"</span>, <span class="number">11</span>), (<span class="string">"b"</span>, <span class="number">22</span>)]);
|
||
<span class="macro">assert_eq!</span>(<span class="kw">const </span>{ MAP.const_len() }, <span class="number">2</span>);</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.const_is_empty" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#1043-1045">Source</a><h4 class="code-header">pub const fn <a href="#method.const_is_empty" class="fn">const_is_empty</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Const version of <a href="struct.LiteMap.html#method.is_empty" title="method litemap::LiteMap::is_empty"><code>LiteMap::is_empty()</code></a> for a slice store.</p>
|
||
<p>Note: This function will no longer be needed if const trait behavior is stabilized.</p>
|
||
<h5 id="examples-10"><a class="doc-anchor" href="#examples-10">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">const </span>MAP: LiteMap<<span class="kw-2">&</span>str, usize, <span class="kw-2">&</span>[(<span class="kw-2">&</span>str, usize)]> =
|
||
LiteMap::from_sorted_store_unchecked(<span class="kw-2">&</span>[]);
|
||
<span class="macro">assert!</span>(<span class="kw">const </span>{ MAP.const_is_empty() });</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.const_get_indexed_or_panic" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#1066-1068">Source</a><h4 class="code-header">pub const fn <a href="#method.const_get_indexed_or_panic" class="fn">const_get_indexed_or_panic</a>(&self, index: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> &'a <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.tuple.html">(K, V)</a></h4></section></summary><div class="docblock"><p>Const version of <a href="struct.LiteMap.html#method.get_indexed" title="method litemap::LiteMap::get_indexed"><code>LiteMap::get_indexed()</code></a> for a slice store.</p>
|
||
<p>Note: This function will no longer be needed if const trait behavior is stabilized.</p>
|
||
<h5 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h5>
|
||
<p>Panics if the index is out of bounds.</p>
|
||
<h5 id="examples-11"><a class="doc-anchor" href="#examples-11">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">const </span>MAP: LiteMap<<span class="kw-2">&</span>str, usize, <span class="kw-2">&</span>[(<span class="kw-2">&</span>str, usize)]> =
|
||
LiteMap::from_sorted_store_unchecked(<span class="kw-2">&</span>[(<span class="string">"a"</span>, <span class="number">11</span>), (<span class="string">"b"</span>, <span class="number">22</span>)]);
|
||
<span class="macro">assert_eq!</span>(<span class="kw">const </span>{ <span class="kw-2">*</span>MAP.const_get_indexed_or_panic(<span class="number">0</span>) }, (<span class="string">"a"</span>, <span class="number">11</span>));</code></pre></div></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3C%26str,+V,+%26%5B(%26str,+V)%5D%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#1094-1134">Source</a><a href="#impl-LiteMap%3C%26str,+V,+%26%5B(%26str,+V)%5D%3E" class="anchor">§</a><h3 class="code-header">impl<'a, V> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><&'a <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.str.html">str</a>, V, &'a [(&'a <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.str.html">str</a>, V)]></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.const_get_with_index" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#1119-1133">Source</a><h4 class="code-header">pub const fn <a href="#method.const_get_with_index" class="fn">const_get_with_index</a>(&self, key: &<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a V</a>)></h4></section></summary><div class="docblock"><p>Const function to get the value associated with a <code>&str</code> key, if it exists.</p>
|
||
<p>Also returns the index of the value.</p>
|
||
<p>Note: This function will no longer be needed if const trait behavior is stabilized.</p>
|
||
<h5 id="examples-12"><a class="doc-anchor" href="#examples-12">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">const </span>MAP: LiteMap<<span class="kw-2">&</span>str, usize, <span class="kw-2">&</span>[(<span class="kw-2">&</span>str, usize)]> =
|
||
LiteMap::from_sorted_store_unchecked(<span class="kw-2">&</span>[
|
||
(<span class="string">"abc"</span>, <span class="number">11</span>),
|
||
(<span class="string">"bcd"</span>, <span class="number">22</span>),
|
||
(<span class="string">"cde"</span>, <span class="number">33</span>),
|
||
(<span class="string">"def"</span>, <span class="number">44</span>),
|
||
(<span class="string">"efg"</span>, <span class="number">55</span>),
|
||
]);
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="kw">const </span>{ MAP.const_get_with_index(<span class="string">"def"</span>) }, <span class="prelude-val">Some</span>((<span class="number">3</span>, <span class="kw-2">&</span><span class="number">44</span>)));
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="kw">const </span>{ MAP.const_get_with_index(<span class="string">"dng"</span>) }, <span class="prelude-val">None</span>);</code></pre></div></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3C%26%5Bu8%5D,+V,+%26%5B(%26%5Bu8%5D,+V)%5D%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#1136-1176">Source</a><a href="#impl-LiteMap%3C%26%5Bu8%5D,+V,+%26%5B(%26%5Bu8%5D,+V)%5D%3E" class="anchor">§</a><h3 class="code-header">impl<'a, V> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><&'a [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>], V, &'a [(&'a [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>], V)]></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.const_get_with_index-1" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#1161-1175">Source</a><h4 class="code-header">pub const fn <a href="#method.const_get_with_index-1" class="fn">const_get_with_index</a>(&self, key: &[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a V</a>)></h4></section></summary><div class="docblock"><p>Const function to get the value associated with a <code>&[u8]</code> key, if it exists.</p>
|
||
<p>Also returns the index of the value.</p>
|
||
<p>Note: This function will no longer be needed if const trait behavior is stabilized.</p>
|
||
<h5 id="examples-13"><a class="doc-anchor" href="#examples-13">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>litemap::LiteMap;
|
||
|
||
<span class="kw">const </span>MAP: LiteMap<<span class="kw-2">&</span>[u8], usize, <span class="kw-2">&</span>[(<span class="kw-2">&</span>[u8], usize)]> =
|
||
LiteMap::from_sorted_store_unchecked(<span class="kw-2">&</span>[
|
||
(<span class="string">b"abc"</span>, <span class="number">11</span>),
|
||
(<span class="string">b"bcd"</span>, <span class="number">22</span>),
|
||
(<span class="string">b"cde"</span>, <span class="number">33</span>),
|
||
(<span class="string">b"def"</span>, <span class="number">44</span>),
|
||
(<span class="string">b"efg"</span>, <span class="number">55</span>),
|
||
]);
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="kw">const </span>{ MAP.const_get_with_index(<span class="string">b"def"</span>) }, <span class="prelude-val">Some</span>((<span class="number">3</span>, <span class="kw-2">&</span><span class="number">44</span>)));
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="kw">const </span>{ MAP.const_get_with_index(<span class="string">b"dng"</span>) }, <span class="prelude-val">None</span>);</code></pre></div></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3Cu8,+V,+%26%5B(u8,+V)%5D%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#1207">Source</a><a href="#impl-LiteMap%3Cu8,+V,+%26%5B(u8,+V)%5D%3E" class="anchor">§</a><h3 class="code-header">impl<'a, V> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>, V, &'a [(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>, V)]></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.const_get_with_index-2" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#1207">Source</a><h4 class="code-header">pub const fn <a href="#method.const_get_with_index-2" class="fn">const_get_with_index</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a V</a>)></h4></section></summary><div class="docblock"><p>Const function to get the value associated with an integer key, if it exists.</p>
|
||
<p>Note: This function will no longer be needed if const trait behavior is stabilized.</p>
|
||
<p>Also returns the index of the value.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3Cu16,+V,+%26%5B(u16,+V)%5D%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#1208">Source</a><a href="#impl-LiteMap%3Cu16,+V,+%26%5B(u16,+V)%5D%3E" class="anchor">§</a><h3 class="code-header">impl<'a, V> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u16.html">u16</a>, V, &'a [(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u16.html">u16</a>, V)]></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.const_get_with_index-3" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#1208">Source</a><h4 class="code-header">pub const fn <a href="#method.const_get_with_index-3" class="fn">const_get_with_index</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u16.html">u16</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a V</a>)></h4></section></summary><div class="docblock"><p>Const function to get the value associated with an integer key, if it exists.</p>
|
||
<p>Note: This function will no longer be needed if const trait behavior is stabilized.</p>
|
||
<p>Also returns the index of the value.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3Cu32,+V,+%26%5B(u32,+V)%5D%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#1209">Source</a><a href="#impl-LiteMap%3Cu32,+V,+%26%5B(u32,+V)%5D%3E" class="anchor">§</a><h3 class="code-header">impl<'a, V> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a>, V, &'a [(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a>, V)]></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.const_get_with_index-4" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#1209">Source</a><h4 class="code-header">pub const fn <a href="#method.const_get_with_index-4" class="fn">const_get_with_index</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u32.html">u32</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a V</a>)></h4></section></summary><div class="docblock"><p>Const function to get the value associated with an integer key, if it exists.</p>
|
||
<p>Note: This function will no longer be needed if const trait behavior is stabilized.</p>
|
||
<p>Also returns the index of the value.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3Cu64,+V,+%26%5B(u64,+V)%5D%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#1210">Source</a><a href="#impl-LiteMap%3Cu64,+V,+%26%5B(u64,+V)%5D%3E" class="anchor">§</a><h3 class="code-header">impl<'a, V> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, V, &'a [(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>, V)]></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.const_get_with_index-5" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#1210">Source</a><h4 class="code-header">pub const fn <a href="#method.const_get_with_index-5" class="fn">const_get_with_index</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u64.html">u64</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a V</a>)></h4></section></summary><div class="docblock"><p>Const function to get the value associated with an integer key, if it exists.</p>
|
||
<p>Note: This function will no longer be needed if const trait behavior is stabilized.</p>
|
||
<p>Also returns the index of the value.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3Cu128,+V,+%26%5B(u128,+V)%5D%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#1211">Source</a><a href="#impl-LiteMap%3Cu128,+V,+%26%5B(u128,+V)%5D%3E" class="anchor">§</a><h3 class="code-header">impl<'a, V> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a>, V, &'a [(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a>, V)]></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.const_get_with_index-6" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#1211">Source</a><h4 class="code-header">pub const fn <a href="#method.const_get_with_index-6" class="fn">const_get_with_index</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u128.html">u128</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a V</a>)></h4></section></summary><div class="docblock"><p>Const function to get the value associated with an integer key, if it exists.</p>
|
||
<p>Note: This function will no longer be needed if const trait behavior is stabilized.</p>
|
||
<p>Also returns the index of the value.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3Cusize,+V,+%26%5B(usize,+V)%5D%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#1212">Source</a><a href="#impl-LiteMap%3Cusize,+V,+%26%5B(usize,+V)%5D%3E" class="anchor">§</a><h3 class="code-header">impl<'a, V> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, V, &'a [(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, V)]></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.const_get_with_index-7" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#1212">Source</a><h4 class="code-header">pub const fn <a href="#method.const_get_with_index-7" class="fn">const_get_with_index</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a V</a>)></h4></section></summary><div class="docblock"><p>Const function to get the value associated with an integer key, if it exists.</p>
|
||
<p>Note: This function will no longer be needed if const trait behavior is stabilized.</p>
|
||
<p>Also returns the index of the value.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3Ci8,+V,+%26%5B(i8,+V)%5D%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#1213">Source</a><a href="#impl-LiteMap%3Ci8,+V,+%26%5B(i8,+V)%5D%3E" class="anchor">§</a><h3 class="code-header">impl<'a, V> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i8.html">i8</a>, V, &'a [(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i8.html">i8</a>, V)]></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.const_get_with_index-8" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#1213">Source</a><h4 class="code-header">pub const fn <a href="#method.const_get_with_index-8" class="fn">const_get_with_index</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i8.html">i8</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a V</a>)></h4></section></summary><div class="docblock"><p>Const function to get the value associated with an integer key, if it exists.</p>
|
||
<p>Note: This function will no longer be needed if const trait behavior is stabilized.</p>
|
||
<p>Also returns the index of the value.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3Ci16,+V,+%26%5B(i16,+V)%5D%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#1214">Source</a><a href="#impl-LiteMap%3Ci16,+V,+%26%5B(i16,+V)%5D%3E" class="anchor">§</a><h3 class="code-header">impl<'a, V> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i16.html">i16</a>, V, &'a [(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i16.html">i16</a>, V)]></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.const_get_with_index-9" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#1214">Source</a><h4 class="code-header">pub const fn <a href="#method.const_get_with_index-9" class="fn">const_get_with_index</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i16.html">i16</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a V</a>)></h4></section></summary><div class="docblock"><p>Const function to get the value associated with an integer key, if it exists.</p>
|
||
<p>Note: This function will no longer be needed if const trait behavior is stabilized.</p>
|
||
<p>Also returns the index of the value.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3Ci32,+V,+%26%5B(i32,+V)%5D%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#1215">Source</a><a href="#impl-LiteMap%3Ci32,+V,+%26%5B(i32,+V)%5D%3E" class="anchor">§</a><h3 class="code-header">impl<'a, V> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i32.html">i32</a>, V, &'a [(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i32.html">i32</a>, V)]></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.const_get_with_index-10" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#1215">Source</a><h4 class="code-header">pub const fn <a href="#method.const_get_with_index-10" class="fn">const_get_with_index</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i32.html">i32</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a V</a>)></h4></section></summary><div class="docblock"><p>Const function to get the value associated with an integer key, if it exists.</p>
|
||
<p>Note: This function will no longer be needed if const trait behavior is stabilized.</p>
|
||
<p>Also returns the index of the value.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3Ci64,+V,+%26%5B(i64,+V)%5D%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#1216">Source</a><a href="#impl-LiteMap%3Ci64,+V,+%26%5B(i64,+V)%5D%3E" class="anchor">§</a><h3 class="code-header">impl<'a, V> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, V, &'a [(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>, V)]></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.const_get_with_index-11" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#1216">Source</a><h4 class="code-header">pub const fn <a href="#method.const_get_with_index-11" class="fn">const_get_with_index</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i64.html">i64</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a V</a>)></h4></section></summary><div class="docblock"><p>Const function to get the value associated with an integer key, if it exists.</p>
|
||
<p>Note: This function will no longer be needed if const trait behavior is stabilized.</p>
|
||
<p>Also returns the index of the value.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3Ci128,+V,+%26%5B(i128,+V)%5D%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#1217">Source</a><a href="#impl-LiteMap%3Ci128,+V,+%26%5B(i128,+V)%5D%3E" class="anchor">§</a><h3 class="code-header">impl<'a, V> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a>, V, &'a [(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a>, V)]></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.const_get_with_index-12" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#1217">Source</a><h4 class="code-header">pub const fn <a href="#method.const_get_with_index-12" class="fn">const_get_with_index</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.i128.html">i128</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a V</a>)></h4></section></summary><div class="docblock"><p>Const function to get the value associated with an integer key, if it exists.</p>
|
||
<p>Note: This function will no longer be needed if const trait behavior is stabilized.</p>
|
||
<p>Also returns the index of the value.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3Cisize,+V,+%26%5B(isize,+V)%5D%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#1218">Source</a><a href="#impl-LiteMap%3Cisize,+V,+%26%5B(isize,+V)%5D%3E" class="anchor">§</a><h3 class="code-header">impl<'a, V> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.isize.html">isize</a>, V, &'a [(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.isize.html">isize</a>, V)]></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.const_get_with_index-13" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#1218">Source</a><h4 class="code-header">pub const fn <a href="#method.const_get_with_index-13" class="fn">const_get_with_index</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.isize.html">isize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a V</a>)></h4></section></summary><div class="docblock"><p>Const function to get the value associated with an integer key, if it exists.</p>
|
||
<p>Note: This function will no longer be needed if const trait behavior is stabilized.</p>
|
||
<p>Also returns the index of the value.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-LiteMap%3CK,+V,+S%3E-12" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#1373-1389">Source</a><a href="#impl-LiteMap%3CK,+V,+S%3E-12" class="anchor">§</a><h3 class="code-header">impl<K, V, S> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,
|
||
S: <a class="trait" href="store/trait.StoreMut.html" title="trait litemap::store::StoreMut">StoreMut</a><K, V>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.entry" class="method"><a class="src rightside" href="../src/litemap/map.rs.html#1379-1388">Source</a><h4 class="code-header">pub fn <a href="#method.entry" class="fn">entry</a>(&mut self, key: K) -> <a class="enum" href="enum.Entry.html" title="enum litemap::Entry">Entry</a><'_, K, V, S></h4></section></summary><div class="docblock"><p>Gets the entry for the given key in the map for in-place manipulation.</p>
|
||
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Clone-for-LiteMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#39">Source</a><a href="#impl-Clone-for-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, V: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, S: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#39">Source</a><a href="#method.clone" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html#tymethod.clone" class="fn">clone</a>(&self) -> <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S></h4></section></summary><div class='docblock'>Returns a duplicate of the value. <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html#tymethod.clone">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/clone.rs.html#245-247">Source</a></span><a href="#method.clone_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html#method.clone_from" class="fn">clone_from</a>(&mut self, source: &Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html#method.clone_from">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-LiteMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#39">Source</a><a href="#impl-Debug-for-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, V: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, S: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#39">Source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/1.93.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Default-for-LiteMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#849-860">Source</a><a href="#impl-Default-for-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K, V, S> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
S: <a class="trait" href="store/trait.Store.html" title="trait litemap::store::Store">Store</a><K, V> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/default/trait.Default.html" title="trait core::default::Default">Default</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.default" class="method trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#853-859">Source</a><a href="#method.default" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/default/trait.Default.html#tymethod.default" class="fn">default</a>() -> Self</h4></section></summary><div class='docblock'>Returns the “default value” for a type. <a href="https://doc.rust-lang.org/1.93.1/core/default/trait.Default.html#tymethod.default">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Extend%3C(K,+V)%3E-for-LiteMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#1391-1399">Source</a><a href="#impl-Extend%3C(K,+V)%3E-for-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K, V, S> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.Extend.html" title="trait core::iter::traits::collect::Extend">Extend</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.tuple.html">(K, V)</a>> for <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,
|
||
S: <a class="trait" href="store/trait.StoreBulkMut.html" title="trait litemap::store::StoreBulkMut">StoreBulkMut</a><K, V>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.extend" class="method trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#1396-1398">Source</a><a href="#method.extend" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.Extend.html#tymethod.extend" class="fn">extend</a><T: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.tuple.html">(K, V)</a>>>(&mut self, iter: T)</h4></section></summary><div class='docblock'>Extends a collection with the contents of an iterator. <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.Extend.html#tymethod.extend">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.extend_one" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/iter/traits/collect.rs.html#417">Source</a><a href="#method.extend_one" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.Extend.html#method.extend_one" class="fn">extend_one</a>(&mut self, item: A)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>extend_one</code>)</span></div></span><div class='docblock'>Extends a collection with exactly one element.</div></details><details class="toggle method-toggle" open><summary><section id="method.extend_reserve" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/iter/traits/collect.rs.html#425">Source</a><a href="#method.extend_reserve" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.Extend.html#method.extend_reserve" class="fn">extend_reserve</a>(&mut self, additional: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>extend_one</code>)</span></div></span><div class='docblock'>Reserves capacity in a collection for the given number of additional elements. <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.Extend.html#method.extend_reserve">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-FromIterator%3C(K,+V)%3E-for-LiteMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#888-897">Source</a><a href="#impl-FromIterator%3C(K,+V)%3E-for-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K, V, S> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.FromIterator.html" title="trait core::iter::traits::collect::FromIterator">FromIterator</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.tuple.html">(K, V)</a>> for <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,
|
||
S: <a class="trait" href="store/trait.StoreFromIterable.html" title="trait litemap::store::StoreFromIterable">StoreFromIterable</a><K, V>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from_iter" class="method trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#893-896">Source</a><a href="#method.from_iter" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.FromIterator.html#tymethod.from_iter" class="fn">from_iter</a><I: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.tuple.html">(K, V)</a>>>(iter: I) -> Self</h4></section></summary><div class='docblock'>Creates a value from an iterator. <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.FromIterator.html#tymethod.from_iter">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Hash-for-LiteMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#39">Source</a><a href="#impl-Hash-for-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, V: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, S: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a>> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.hash" class="method trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#39">Source</a><a href="#method.hash" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/hash/trait.Hash.html#tymethod.hash" class="fn">hash</a><__H: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&mut __H</a>)</h4></section></summary><div class='docblock'>Feeds this value into the given <a href="https://doc.rust-lang.org/1.93.1/core/hash/trait.Hasher.html" title="trait core::hash::Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/1.93.1/core/hash/trait.Hash.html#tymethod.hash">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.hash_slice" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/hash/mod.rs.html#235-237">Source</a></span><a href="#method.hash_slice" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/hash/trait.Hash.html#method.hash_slice" class="fn">hash_slice</a><H>(data: &[Self], state: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&mut H</a>)<div class="where">where
|
||
H: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>,
|
||
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/1.93.1/core/hash/trait.Hasher.html" title="trait core::hash::Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/1.93.1/core/hash/trait.Hash.html#method.hash_slice">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Index%3C%26K%3E-for-LiteMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#861-874">Source</a><a href="#impl-Index%3C%26K%3E-for-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K, V, S> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/index/trait.Index.html" title="trait core::ops::index::Index">Index</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&K</a>> for <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,
|
||
S: <a class="trait" href="store/trait.Store.html" title="trait litemap::store::Store">Store</a><K, V>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output" class="associatedtype trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#866">Source</a><a href="#associatedtype.Output" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.1/core/ops/index/trait.Index.html#associatedtype.Output" class="associatedtype">Output</a> = V</h4></section></summary><div class='docblock'>The returned type after indexing.</div></details><details class="toggle method-toggle" open><summary><section id="method.index" class="method trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#867-873">Source</a><a href="#method.index" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/ops/index/trait.Index.html#tymethod.index" class="fn">index</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&K</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&V</a></h4></section></summary><div class='docblock'>Performs the indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.93.1/core/ops/index/trait.Index.html#tymethod.index">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IndexMut%3C%26K%3E-for-LiteMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#875-887">Source</a><a href="#impl-IndexMut%3C%26K%3E-for-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K, V, S> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/index/trait.IndexMut.html" title="trait core::ops::index::IndexMut">IndexMut</a><<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&K</a>> for <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,
|
||
S: <a class="trait" href="store/trait.StoreMut.html" title="trait litemap::store::StoreMut">StoreMut</a><K, V>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.index_mut" class="method trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#880-886">Source</a><a href="#method.index_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/ops/index/trait.IndexMut.html#tymethod.index_mut" class="fn">index_mut</a>(&mut self, key: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&K</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&mut V</a></h4></section></summary><div class='docblock'>Performs the mutable indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.93.1/core/ops/index/trait.IndexMut.html#tymethod.index_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IntoIterator-for-%26LiteMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#953-963">Source</a><a href="#impl-IntoIterator-for-%26LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<'a, K, V, S> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a> for &'a <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
S: <a class="trait" href="store/trait.StoreIterable.html" title="trait litemap::store::StoreIterable">StoreIterable</a><'a, K, V>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Item-1" class="associatedtype trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#957">Source</a><a href="#associatedtype.Item-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" class="associatedtype">Item</a> = (<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a V</a>)</h4></section></summary><div class='docblock'>The type of the elements being iterated over.</div></details><details class="toggle" open><summary><section id="associatedtype.IntoIter-1" class="associatedtype trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#958">Source</a><a href="#associatedtype.IntoIter-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" class="associatedtype">IntoIter</a> = <S as <a class="trait" href="store/trait.StoreIterable.html" title="trait litemap::store::StoreIterable">StoreIterable</a><'a, K, V>>::<a class="associatedtype" href="store/trait.StoreIterable.html#associatedtype.KeyValueIter" title="type litemap::store::StoreIterable::KeyValueIter">KeyValueIter</a></h4></section></summary><div class='docblock'>Which kind of iterator are we turning this into?</div></details><details class="toggle method-toggle" open><summary><section id="method.into_iter-1" class="method trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#960-962">Source</a><a href="#method.into_iter-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter" class="fn">into_iter</a>(self) -> Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" title="type core::iter::traits::collect::IntoIterator::IntoIter">IntoIter</a></h4></section></summary><div class='docblock'>Creates an iterator from a value. <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IntoIterator-for-%26mut+LiteMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#965-975">Source</a><a href="#impl-IntoIterator-for-%26mut+LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<'a, K, V, S> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a> for &'a mut <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
S: <a class="trait" href="store/trait.StoreIterableMut.html" title="trait litemap::store::StoreIterableMut">StoreIterableMut</a><'a, K, V>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Item-2" class="associatedtype trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#969">Source</a><a href="#associatedtype.Item-2" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" class="associatedtype">Item</a> = (<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a K</a>, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&'a mut V</a>)</h4></section></summary><div class='docblock'>The type of the elements being iterated over.</div></details><details class="toggle" open><summary><section id="associatedtype.IntoIter-2" class="associatedtype trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#970">Source</a><a href="#associatedtype.IntoIter-2" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" class="associatedtype">IntoIter</a> = <S as <a class="trait" href="store/trait.StoreIterableMut.html" title="trait litemap::store::StoreIterableMut">StoreIterableMut</a><'a, K, V>>::<a class="associatedtype" href="store/trait.StoreIterableMut.html#associatedtype.KeyValueIterMut" title="type litemap::store::StoreIterableMut::KeyValueIterMut">KeyValueIterMut</a></h4></section></summary><div class='docblock'>Which kind of iterator are we turning this into?</div></details><details class="toggle method-toggle" open><summary><section id="method.into_iter-2" class="method trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#972-974">Source</a><a href="#method.into_iter-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter" class="fn">into_iter</a>(self) -> Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" title="type core::iter::traits::collect::IntoIterator::IntoIter">IntoIter</a></h4></section></summary><div class='docblock'>Creates an iterator from a value. <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IntoIterator-for-LiteMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#941-951">Source</a><a href="#impl-IntoIterator-for-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K, V, S> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a> for <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
S: <a class="trait" href="store/trait.StoreIntoIterator.html" title="trait litemap::store::StoreIntoIterator">StoreIntoIterator</a><K, V>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Item" class="associatedtype trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#945">Source</a><a href="#associatedtype.Item" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.tuple.html">(K, V)</a></h4></section></summary><div class='docblock'>The type of the elements being iterated over.</div></details><details class="toggle" open><summary><section id="associatedtype.IntoIter" class="associatedtype trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#946">Source</a><a href="#associatedtype.IntoIter" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" class="associatedtype">IntoIter</a> = <S as <a class="trait" href="store/trait.StoreIntoIterator.html" title="trait litemap::store::StoreIntoIterator">StoreIntoIterator</a><K, V>>::<a class="associatedtype" href="store/trait.StoreIntoIterator.html#associatedtype.KeyValueIntoIter" title="type litemap::store::StoreIntoIterator::KeyValueIntoIter">KeyValueIntoIter</a></h4></section></summary><div class='docblock'>Which kind of iterator are we turning this into?</div></details><details class="toggle method-toggle" open><summary><section id="method.into_iter" class="method trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#948-950">Source</a><a href="#method.into_iter" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter" class="fn">into_iter</a>(self) -> Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" title="type core::iter::traits::collect::IntoIterator::IntoIter">IntoIter</a></h4></section></summary><div class='docblock'>Creates an iterator from a value. <a href="https://doc.rust-lang.org/1.93.1/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Ord-for-LiteMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#39">Source</a><a href="#impl-Ord-for-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, V: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, S: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.cmp" class="method trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#39">Source</a><a href="#method.cmp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html#tymethod.cmp" class="fn">cmp</a>(&self, other: &<a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></h4></section></summary><div class='docblock'>This method returns an <a href="https://doc.rust-lang.org/1.93.1/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering"><code>Ordering</code></a> between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.max" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/cmp.rs.html#1021-1023">Source</a></span><a href="#method.max" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html#method.max" class="fn">max</a>(self, other: Self) -> Self<div class="where">where
|
||
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html#method.max">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.min" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/cmp.rs.html#1060-1062">Source</a></span><a href="#method.min" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html#method.min" class="fn">min</a>(self, other: Self) -> Self<div class="where">where
|
||
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html#method.min">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clamp" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/cmp.rs.html#1086-1088">Source</a></span><a href="#method.clamp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html#method.clamp" class="fn">clamp</a>(self, min: Self, max: Self) -> Self<div class="where">where
|
||
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class='docblock'>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html#method.clamp">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq-for-LiteMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#39">Source</a><a href="#impl-PartialEq-for-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, V: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, S: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a> for <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#39">Source</a><a href="#method.eq" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/cmp.rs.html#264">Source</a></span><a href="#method.ne" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialOrd-for-LiteMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#39">Source</a><a href="#impl-PartialOrd-for-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, V: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, S: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a> for <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.partial_cmp" class="method trait-impl"><a class="src rightside" href="../src/litemap/map.rs.html#39">Source</a><a href="#method.partial_cmp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp" class="fn">partial_cmp</a>(&self, other: &<a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S>) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/1.93.1/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></h4></section></summary><div class='docblock'>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.lt" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/cmp.rs.html#1398">Source</a></span><a href="#method.lt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html#method.lt" class="fn">lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.le" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/cmp.rs.html#1416">Source</a></span><a href="#method.le" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html#method.le" class="fn">le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the
|
||
<code><=</code> operator. <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html#method.le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.gt" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/cmp.rs.html#1434">Source</a></span><a href="#method.gt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html#method.gt" class="fn">gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code>
|
||
operator. <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.ge" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/cmp.rs.html#1452">Source</a></span><a href="#method.ge" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html#method.ge" class="fn">ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by
|
||
the <code>>=</code> operator. <a href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></div></details></div></details><section id="impl-Eq-for-LiteMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#39">Source</a><a href="#impl-Eq-for-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, V: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, S: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S></h3></section><section id="impl-StructuralPartialEq-for-LiteMap%3CK,+V,+S%3E" class="impl"><a class="src rightside" href="../src/litemap/map.rs.html#39">Source</a><a href="#impl-StructuralPartialEq-for-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, V: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, S> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S></h3></section></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-LiteMap%3CK,+V,+S%3E" class="impl"><a href="#impl-Freeze-for-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K, V, S> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
S: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a>,
|
||
K: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
|
||
V: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section><section id="impl-RefUnwindSafe-for-LiteMap%3CK,+V,+S%3E" class="impl"><a href="#impl-RefUnwindSafe-for-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K, V, S> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
S: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
|
||
V: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section><section id="impl-Send-for-LiteMap%3CK,+V,+S%3E" class="impl"><a href="#impl-Send-for-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K, V, S> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
S: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
|
||
V: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section><section id="impl-Sync-for-LiteMap%3CK,+V,+S%3E" class="impl"><a href="#impl-Sync-for-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K, V, S> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
S: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
|
||
V: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section><section id="impl-Unpin-for-LiteMap%3CK,+V,+S%3E" class="impl"><a href="#impl-Unpin-for-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K, V, S> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
S: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
|
||
V: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section><section id="impl-UnwindSafe-for-LiteMap%3CK,+V,+S%3E" class="impl"><a href="#impl-UnwindSafe-for-LiteMap%3CK,+V,+S%3E" class="anchor">§</a><h3 class="code-header">impl<K, V, S> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.LiteMap.html" title="struct litemap::LiteMap">LiteMap</a><K, V, S><div class="where">where
|
||
S: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a>,
|
||
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
|
||
V: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
|
||
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/any.rs.html#139">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.93.1/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/borrow.rs.html#212">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T<div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/borrow.rs.html#214">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/borrow.rs.html#221">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/borrow.rs.html#222">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.93.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-CloneToUninit-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/clone.rs.html#547">Source</a><a href="#impl-CloneToUninit-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.CloneToUninit.html" title="trait core::clone::CloneToUninit">CloneToUninit</a> for T<div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone_to_uninit" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/clone.rs.html#549">Source</a><a href="#method.clone_to_uninit" class="anchor">§</a><h4 class="code-header">unsafe fn <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit" class="fn">clone_to_uninit</a>(&self, dest: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>clone_to_uninit</code>)</span></div></span><div class='docblock'>Performs copy-assignment from <code>self</code> to <code>dest</code>. <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#785">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#788">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#767-769">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#777">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -> U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
|
||
<p>That is, this conversion is whatever the implementation of
|
||
<code><a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-ToOwned-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/borrow.rs.html#85-87">Source</a><a href="#impl-ToOwned-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.93.1/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T<div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/borrow.rs.html#89">Source</a><a href="#associatedtype.Owned" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.1/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/borrow.rs.html#90">Source</a><a href="#method.to_owned" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fn">to_owned</a>(&self) -> T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/1.93.1/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/borrow.rs.html#94">Source</a><a href="#method.clone_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fn">clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&mut T</a>)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/1.93.1/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#827-829">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#831">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#834">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#811-813">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#815">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#818">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main></body></html> |