mentat/docs/apis/rust/slab/struct.Slab.html
2018-06-22 12:08:32 +01:00

183 lines
No EOL
37 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

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

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `Slab` struct in crate `slab`.">
<meta name="keywords" content="rust, rustlang, rust-lang, Slab">
<title>slab::Slab - Rust</title>
<link rel="stylesheet" type="text/css" href="../normalize.css">
<link rel="stylesheet" type="text/css" href="../rustdoc.css"
id="mainThemeStyle">
<link rel="stylesheet" type="text/css" href="../dark.css">
<link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle">
<script src="../storage.js"></script>
</head>
<body class="rustdoc struct">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<div class="sidebar-menu">&#9776;</div>
<p class='location'>Struct Slab</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.with_capacity">with_capacity</a><a href="#method.len">len</a><a href="#method.capacity">capacity</a><a href="#method.is_empty">is_empty</a><a href="#method.available">available</a><a href="#method.has_available">has_available</a><a href="#method.contains">contains</a><a href="#method.get">get</a><a href="#method.get_mut">get_mut</a><a href="#method.insert">insert</a><a href="#method.entry">entry</a><a href="#method.vacant_entry">vacant_entry</a><a href="#method.remove">remove</a><a href="#method.retain">retain</a><a href="#method.iter">iter</a><a href="#method.iter_mut">iter_mut</a><a href="#method.clear">clear</a><a href="#method.reserve_exact">reserve_exact</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Index%3CI%3E">Index&lt;I&gt;</a><a href="#impl-IndexMut%3CI%3E">IndexMut&lt;I&gt;</a><a href="#impl-Debug">Debug</a><a href="#impl-IntoIterator">IntoIterator</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Sync">Sync</a></div></div><p class='location'><a href='index.html'>slab</a></p><script>window.sidebarCurrent = {name: 'Slab', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
</nav>
<div class="theme-picker">
<button id="theme-picker" aria-label="Pick another theme!">
<img src="../brush.svg" width="18" alt="Pick another theme!">
</button>
<div id="theme-choices"></div>
</div>
<script src="../theme.js"></script>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content"><h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>slab</a>::<wbr><a class="struct" href=''>Slab</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/slab/lib.rs.html#7-19' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct Slab&lt;T, I&nbsp;=&nbsp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt; { /* fields omitted */ }</pre></div><div class='docblock'><p>A preallocated chunk of memory for storing objects of the same type.</p>
</div>
<h2 id='methods' class='small-section-header'>
Methods<a href='#methods' class='anchor'></a>
</h2>
<h3 id='impl' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T, I&gt; <a class="struct" href="../slab/struct.Slab.html" title="struct slab::Slab">Slab</a>&lt;T, I&gt;</code><a href='#impl' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#63-102' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.with_capacity' class="method"><span id='with_capacity.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.with_capacity' class='fnname'>with_capacity</a>(capacity: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="../slab/struct.Slab.html" title="struct slab::Slab">Slab</a>&lt;T, I&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#65-76' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns an empty <code>Slab</code> with the requested capacity</p>
</div><h4 id='method.len' class="method"><span id='len.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.len' class='fnname'>len</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#79-81' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the number of values stored by the <code>Slab</code></p>
</div><h4 id='method.capacity' class="method"><span id='capacity.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.capacity' class='fnname'>capacity</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#84-86' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the total capacity of the <code>Slab</code></p>
</div><h4 id='method.is_empty' class="method"><span id='is_empty.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_empty' class='fnname'>is_empty</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#89-91' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns true if the <code>Slab</code> is storing no values</p>
</div><h4 id='method.available' class="method"><span id='available.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.available' class='fnname'>available</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#94-96' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the number of available slots remaining in the <code>Slab</code></p>
</div><h4 id='method.has_available' class="method"><span id='has_available.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.has_available' class='fnname'>has_available</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#99-101' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns true if the <code>Slab</code> has available slots</p>
</div></div><h3 id='impl-1' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T, I:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt; <a class="struct" href="../slab/struct.Slab.html" title="struct slab::Slab">Slab</a>&lt;T, I&gt;</code><a href='#impl-1' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#104-271' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.contains' class="method"><span id='contains.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.contains' class='fnname'>contains</a>(&amp;self, idx: I) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#106-108' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns true if the <code>Slab</code> contains a value for the given token</p>
</div><h4 id='method.get' class="method"><span id='get.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get' class='fnname'>get</a>(&amp;self, idx: I) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#111-119' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Get a reference to the value associated with the given token</p>
</div><h4 id='method.get_mut' class="method"><span id='get_mut.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_mut' class='fnname'>get_mut</a>(&amp;mut self, idx: I) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#122-129' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Get a mutable reference to the value associated with the given token</p>
</div><h4 id='method.insert' class="method"><span id='insert.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.insert' class='fnname'>insert</a>(&amp;mut self, val: T) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;I, T&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#132-137' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Insert a value into the slab, returning the associated token</p>
</div><h4 id='method.entry' class="method"><span id='entry.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.entry' class='fnname'>entry</a>(&amp;mut self, idx: I) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../slab/struct.Entry.html" title="struct slab::Entry">Entry</a>&lt;T, I&gt;&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#143-156' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a handle to an entry.</p>
<p>This allows more advanced manipulation of the value stored at the given
index.</p>
</div><h4 id='method.vacant_entry' class="method"><span id='vacant_entry.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.vacant_entry' class='fnname'>vacant_entry</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../slab/struct.VacantEntry.html" title="struct slab::VacantEntry">VacantEntry</a>&lt;T, I&gt;&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#162-173' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a handle to a vacant entry.</p>
<p>This allows optionally inserting a value that is constructed with the
index.</p>
</div><h4 id='method.remove' class="method"><span id='remove.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.remove' class='fnname'>remove</a>(&amp;mut self, idx: I) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;T&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#176-178' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Releases the given slot</p>
</div><h4 id='method.retain' class="method"><span id='retain.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.retain' class='fnname'>retain</a>&lt;F&gt;(&amp;mut self, f: F) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,&nbsp;</span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#185-195' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Retain only the elements specified by the predicate.</p>
<p>In other words, remove all elements <code>e</code> such that <code>f(&amp;e)</code> returns false.
This method operates in place and preserves the order of the retained
elements.</p>
</div><h4 id='method.iter' class="method"><div class="important-traits"><div class='tooltip'><span class='tooltiptext'>Important traits for <a class="struct" href="../slab/struct.Iter.html" title="struct slab::Iter">Iter</a>&lt;'a, T, I&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../slab/struct.Iter.html" title="struct slab::Iter">Iter</a>&lt;'a, T, I&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, T, I&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="../slab/struct.Iter.html" title="struct slab::Iter">Iter</a>&lt;'a, T, I&gt;</span><span class="where fmt-newline"> type <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a </a>T;</span></code></div></div><span id='iter.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.iter' class='fnname'>iter</a>(&amp;self) -&gt; <a class="struct" href="../slab/struct.Iter.html" title="struct slab::Iter">Iter</a>&lt;T, I&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#198-204' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>An iterator for visiting all elements stored in the <code>Slab</code></p>
</div><h4 id='method.iter_mut' class="method"><div class="important-traits"><div class='tooltip'><span class='tooltiptext'>Important traits for <a class="struct" href="../slab/struct.IterMut.html" title="struct slab::IterMut">IterMut</a>&lt;'a, T, I&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../slab/struct.IterMut.html" title="struct slab::IterMut">IterMut</a>&lt;'a, T, I&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, T, I&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="../slab/struct.IterMut.html" title="struct slab::IterMut">IterMut</a>&lt;'a, T, I&gt;</span><span class="where fmt-newline"> type <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a mut </a>T;</span></code></div></div><span id='iter_mut.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.iter_mut' class='fnname'>iter_mut</a>(&amp;mut self) -&gt; <a class="struct" href="../slab/struct.IterMut.html" title="struct slab::IterMut">IterMut</a>&lt;T, I&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#207-214' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>A mutable iterator for visiting all elements stored in the <code>Slab</code></p>
</div><h4 id='method.clear' class="method"><span id='clear.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.clear' class='fnname'>clear</a>(&amp;mut self)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#217-223' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Empty the slab, by freeing all entries</p>
</div><h4 id='method.reserve_exact' class="method"><span id='reserve_exact.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.reserve_exact' class='fnname'>reserve_exact</a>(&amp;mut self, additional: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#228-238' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Reserves the minimum capacity for exactly <code>additional</code> more elements to
be inserted in the given <code>Slab</code>. Does nothing if the capacity is
already sufficient.</p>
</div></div>
<h2 id='implementations' class='small-section-header'>
Trait Implementations<a href='#implementations' class='anchor'></a>
</h2>
<div id='implementations-list'>
<h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T, I&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../slab/struct.Slab.html" title="struct slab::Slab">Slab</a>&lt;T, I&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,&nbsp;</span></code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#54' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Index%3CI%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T, I:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/index/trait.Index.html" title="trait core::ops::index::Index">Index</a>&lt;I&gt; for <a class="struct" href="../slab/struct.Slab.html" title="struct slab::Slab">Slab</a>&lt;T, I&gt;</code><a href='#impl-Index%3CI%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#273-279' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Output' class="type"><span id='Output.t' class='invisible'><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/index/trait.Index.html#associatedtype.Output' class="type">Output</a> = T</code></span></h4>
<div class='docblock'><p>The returned type after indexing.</p>
</div><h4 id='method.index' class="method"><span id='index.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/index/trait.Index.html#tymethod.index' class='fnname'>index</a>(&amp;self, index: I) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#276-278' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Performs the indexing (<code>container[index]</code>) operation.</p>
</div></div><h3 id='impl-IndexMut%3CI%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T, I:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/index/trait.IndexMut.html" title="trait core::ops::index::IndexMut">IndexMut</a>&lt;I&gt; for <a class="struct" href="../slab/struct.Slab.html" title="struct slab::Slab">Slab</a>&lt;T, I&gt;</code><a href='#impl-IndexMut%3CI%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#281-285' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.index_mut' class="method"><span id='index_mut.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/index/trait.IndexMut.html#tymethod.index_mut' class='fnname'>index_mut</a>(&amp;mut self, index: I) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#282-284' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Performs the mutable indexing (<code>container[index]</code>) operation.</p>
</div></div><h3 id='impl-Debug' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T, I&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../slab/struct.Slab.html" title="struct slab::Slab">Slab</a>&lt;T, I&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,&nbsp;</span></code><a href='#impl-Debug' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#287-297' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, fmt: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#291-296' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-IntoIterator' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a, T, I:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a> for &amp;'a <a class="struct" href="../slab/struct.Slab.html" title="struct slab::Slab">Slab</a>&lt;T, I&gt;</code><a href='#impl-IntoIterator' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#299-306' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Item' class="type"><span id='Item.t' class='invisible'><code>type <a href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a </a>T</code></span></h4>
<div class='docblock'><p>The type of the elements being iterated over.</p>
</div><h4 id='associatedtype.IntoIter' class="type"><span id='IntoIter.t' class='invisible'><code>type <a href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html#associatedtype.IntoIter' class="type">IntoIter</a> = <a class="struct" href="../slab/struct.Iter.html" title="struct slab::Iter">Iter</a>&lt;'a, T, I&gt;</code></span></h4>
<div class='docblock'><p>Which kind of iterator are we turning this into?</p>
</div><h4 id='method.into_iter' class="method"><div class="important-traits"><div class='tooltip'><span class='tooltiptext'>Important traits for <a class="struct" href="../slab/struct.Iter.html" title="struct slab::Iter">Iter</a>&lt;'a, T, I&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../slab/struct.Iter.html" title="struct slab::Iter">Iter</a>&lt;'a, T, I&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, T, I&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="../slab/struct.Iter.html" title="struct slab::Iter">Iter</a>&lt;'a, T, I&gt;</span><span class="where fmt-newline"> type <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a </a>T;</span></code></div></div><span id='into_iter.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html#tymethod.into_iter' class='fnname'>into_iter</a>(self) -&gt; <a class="struct" href="../slab/struct.Iter.html" title="struct slab::Iter">Iter</a>&lt;'a, T, I&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#303-305' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates an iterator from a value. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html#tymethod.into_iter">Read more</a></p>
</div></div><h3 id='impl-IntoIterator-1' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a, T, I:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a> for &amp;'a mut <a class="struct" href="../slab/struct.Slab.html" title="struct slab::Slab">Slab</a>&lt;T, I&gt;</code><a href='#impl-IntoIterator-1' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#308-315' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Item-1' class="type"><span id='Item.t-1' class='invisible'><code>type <a href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a mut </a>T</code></span></h4>
<div class='docblock'><p>The type of the elements being iterated over.</p>
</div><h4 id='associatedtype.IntoIter-1' class="type"><span id='IntoIter.t-1' class='invisible'><code>type <a href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html#associatedtype.IntoIter' class="type">IntoIter</a> = <a class="struct" href="../slab/struct.IterMut.html" title="struct slab::IterMut">IterMut</a>&lt;'a, T, I&gt;</code></span></h4>
<div class='docblock'><p>Which kind of iterator are we turning this into?</p>
</div><h4 id='method.into_iter-1' class="method"><div class="important-traits"><div class='tooltip'><span class='tooltiptext'>Important traits for <a class="struct" href="../slab/struct.IterMut.html" title="struct slab::IterMut">IterMut</a>&lt;'a, T, I&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../slab/struct.IterMut.html" title="struct slab::IterMut">IterMut</a>&lt;'a, T, I&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, T, I&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="../slab/struct.IterMut.html" title="struct slab::IterMut">IterMut</a>&lt;'a, T, I&gt;</span><span class="where fmt-newline"> type <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a mut </a>T;</span></code></div></div><span id='into_iter.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html#tymethod.into_iter' class='fnname'>into_iter</a>(self) -&gt; <a class="struct" href="../slab/struct.IterMut.html" title="struct slab::IterMut">IterMut</a>&lt;'a, T, I&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/slab/lib.rs.html#312-314' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates an iterator from a value. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html#tymethod.into_iter">Read more</a></p>
</div></div></div>
<h2 id='synthetic-implementations' class='small-section-header'>
Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
</h2>
<div id='synthetic-implementations-list'>
<h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T, I&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../slab/struct.Slab.html" title="struct slab::Slab">Slab</a>&lt;T, I&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,&nbsp;</span></code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt><kbd>?</kbd></dt>
<dd>Show this help dialog</dd>
<dt><kbd>S</kbd></dt>
<dd>Focus the search field</dd>
<dt><kbd></kbd></dt>
<dd>Move up in search results</dd>
<dt><kbd></kbd></dt>
<dd>Move down in search results</dd>
<dt><kbd></kbd></dt>
<dd>Switch tab</dd>
<dt><kbd>&#9166;</kbd></dt>
<dd>Go to active search result</dd>
<dt><kbd>+</kbd></dt>
<dd>Expand all sections</dd>
<dt><kbd>-</kbd></dt>
<dd>Collapse all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "slab";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>