forked from citybound/citybound
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstruct.MultiArena.html
22 lines (22 loc) · 14.1 KB
/
struct.MultiArena.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!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 `MultiArena` struct in crate `chunky`."><meta name="keywords" content="rust, rustlang, rust-lang, MultiArena"><title>chunky::MultiArena - 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">☰</div><p class='location'>Struct MultiArena</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.new">new</a><a href="#method.size_to_index">size_to_index</a><a href="#method.at">at</a><a href="#method.at_mut">at_mut</a><a href="#method.push">push</a><a href="#method.swap_remove_within_bin">swap_remove_within_bin</a><a href="#method.populated_bin_indices_and_lens">populated_bin_indices_and_lens</a><a href="#method.bin_len">bin_len</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a></div></div><p class='location'><a href='index.html'>chunky</a></p><script>window.sidebarCurrent = {name: 'MultiArena', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>chunky</a>::<wbr><a class="struct" href=''>MultiArena</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'>−</span>]</a></span><a class='srclink' href='../src/chunky/lib.rs.html#540-549' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct MultiArena<H: <a class="trait" href="../chunky/trait.Handler.html" title="trait chunky::Handler">Handler</a>> { /* fields omitted */ }</pre></div><div class='docblock'><p>Based on a collection type for fixed-size items ("Bin"), creates a collection for
heterogenously-sized items which will be stored in the most appropriately-sized bin.</p>
<p>All Bins will use children of a main chunker to create their chunks.</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<H: <a class="trait" href="../chunky/trait.Handler.html" title="trait chunky::Handler">Handler</a>> <a class="struct" href="../chunky/struct.MultiArena.html" title="struct chunky::MultiArena">MultiArena</a><H></code><a href='#impl' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/chunky/lib.rs.html#551-662' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.new' class="method"><span id='new.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.new' class='fnname'>new</a>(ident: <a class="struct" href="../chunky/struct.Ident.html" title="struct chunky::Ident">Ident</a>, typical_chunk_size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, base_size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/chunky/lib.rs.html#554-571' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Create a new <code>MultiArena</code> collection using <code>Arena</code> bins and a base size that represents
the smallest expected item size (used as the item size of the smallest-sized bin)</p>
</div><h4 id='method.size_to_index' class="method"><span id='size_to_index.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.size_to_index' class='fnname'>size_to_index</a>(&self, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <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/chunky/lib.rs.html#579-581' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Get the index of the Bin which stores items of size <code>size</code></p>
</div><h4 id='method.at' class="method"><span id='at.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.at' class='fnname'>at</a>(&self, index: <a class="struct" href="../chunky/struct.MultiArenaIndex.html" title="struct chunky::MultiArenaIndex">MultiArenaIndex</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*const </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/chunky/lib.rs.html#608-615' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Get an (untyped) pointer to the item at the given index</p>
</div><h4 id='method.at_mut' class="method"><span id='at_mut.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.at_mut' class='fnname'>at_mut</a>(&mut self, index: <a class="struct" href="../chunky/struct.MultiArenaIndex.html" title="struct chunky::MultiArenaIndex">MultiArenaIndex</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/chunky/lib.rs.html#618-625' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Get an (untyped) mutable pointer to the item at the given index</p>
</div><h4 id='method.push' class="method"><span id='push.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.push' class='fnname'>push</a>(&mut self, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>, <a class="struct" href="../chunky/struct.MultiArenaIndex.html" title="struct chunky::MultiArenaIndex">MultiArenaIndex</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/chunky/lib.rs.html#628-633' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Add an item to the end of the bin corresponding to its size</p>
</div><h4 id='method.swap_remove_within_bin' class="method"><span id='swap_remove_within_bin.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.swap_remove_within_bin' class='fnname'>swap_remove_within_bin</a>(<br> &mut self, <br> index: <a class="struct" href="../chunky/struct.MultiArenaIndex.html" title="struct chunky::MultiArenaIndex">MultiArenaIndex</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*const </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/chunky/lib.rs.html#636-643' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Remove the item referenced by <code>index</code> from its bin by swapping with the bin's last item</p>
</div><h4 id='method.populated_bin_indices_and_lens' class="method"><span id='populated_bin_indices_and_lens.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.populated_bin_indices_and_lens' class='fnname'>populated_bin_indices_and_lens</a><'a>(<br> &'a self<br>) -> impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>> + 'a</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/chunky/lib.rs.html#646-653' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Return indices of bins that actually contain items and their respective lengths</p>
</div><h4 id='method.bin_len' class="method"><span id='bin_len.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.bin_len' class='fnname'>bin_len</a>(&self, bin_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <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/chunky/lib.rs.html#656-661' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Get the length of the bin of the given bin index</p>
</div></div>
<h2 id='synthetic-implementations' class='small-section-header'>
Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
</h2>
<div id='synthetic-implementations-list'>
<h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<H> !<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="../chunky/struct.MultiArena.html" title="struct chunky::MultiArena">MultiArena</a><H></code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<H> !<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="../chunky/struct.MultiArena.html" title="struct chunky::MultiArena">MultiArena</a><H></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>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g. <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "chunky";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>