Files
tantivy/master/bitpacking/trait.BitPacker.html
2019-06-16 03:00:46 +00:00

139 lines
53 KiB
HTML
Raw Permalink 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 `BitPacker` trait in crate `bitpacking`."><meta name="keywords" content="rust, rustlang, rust-lang, BitPacker"><title>bitpacking::BitPacker - 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><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../bitpacking/index.html'><img src='../rust-logo.png' alt='logo' width='100'></a><p class='location'>Trait BitPacker</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-const">Associated Constants</a><div class="sidebar-links"><a href="#associatedconstant.BLOCK_LEN">BLOCK_LEN</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.compress">compress</a><a href="#tymethod.compress_sorted">compress_sorted</a><a href="#tymethod.decompress">decompress</a><a href="#tymethod.decompress_sorted">decompress_sorted</a><a href="#tymethod.new">new</a><a href="#tymethod.num_bits">num_bits</a><a href="#tymethod.num_bits_sorted">num_bits_sorted</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.compressed_block_size">compressed_block_size</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>bitpacking</a></p><script>window.sidebarCurrent = {name: 'BitPacker', ty: 'trait', 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"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><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='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/bitpacking/lib.rs.html#163-256' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>bitpacking</a>::<wbr><a class="trait" href=''>BitPacker</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait BitPacker: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> {
const <a href='#associatedconstant.BLOCK_LEN' class="constant"><b>BLOCK_LEN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>;
fn <a href='#tymethod.new' class='fnname'>new</a>() -&gt; Self;
<div class='item-spacer'></div> fn <a href='#tymethod.compress' class='fnname'>compress</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>;
<div class='item-spacer'></div> fn <a href='#tymethod.compress_sorted' class='fnname'>compress_sorted</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;initial: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>;
<div class='item-spacer'></div> fn <a href='#tymethod.decompress' class='fnname'>decompress</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>;
<div class='item-spacer'></div> fn <a href='#tymethod.decompress_sorted' class='fnname'>decompress_sorted</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;initial: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>;
<div class='item-spacer'></div> fn <a href='#tymethod.num_bits' class='fnname'>num_bits</a>(&amp;self, decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>;
<div class='item-spacer'></div> fn <a href='#tymethod.num_bits_sorted' class='fnname'>num_bits_sorted</a>(&amp;self, initial: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>;
fn <a href='#method.compressed_block_size' class='fnname'>compressed_block_size</a>(num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a> { ... }
}</pre></div><div class='docblock'><h1 id="examples-without-delta-encoding" class="section-header"><a href="#examples-without-delta-encoding">Examples without delta-encoding</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">bitpacking</span>;
<span class="kw">use</span> <span class="ident">bitpacking</span>::{<span class="ident">BitPacker4x</span>, <span class="ident">BitPacker</span>};
<span class="kw">let</span> <span class="ident">bitpacker</span> <span class="op">=</span> <span class="ident">BitPacker4x</span>::<span class="ident">new</span>();
<span class="kw">let</span> <span class="ident">num_bits</span>: <span class="ident">u8</span> <span class="op">=</span> <span class="ident">bitpacker</span>.<span class="ident">num_bits</span>(<span class="kw-2">&amp;</span><span class="ident">my_data</span>);
<span class="comment">// A block will be take at most 4 bytes per-integers.</span>
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">compressed</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="number">0u8</span>; <span class="number">4</span> <span class="op">*</span> <span class="ident">BitPacker4x</span>::<span class="ident">BLOCK_LEN</span>];
<span class="kw">let</span> <span class="ident">compressed_len</span> <span class="op">=</span> <span class="ident">bitpacker</span>.<span class="ident">compress</span>(<span class="kw-2">&amp;</span><span class="ident">my_data</span>, <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">compressed</span>[..], <span class="ident">num_bits</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>((<span class="ident">num_bits</span> <span class="kw">as</span> <span class="ident">usize</span>) <span class="op">*</span> <span class="ident">BitPacker4x</span>::<span class="ident">BLOCK_LEN</span> <span class="op">/</span> <span class="number">8</span>, <span class="ident">compressed_len</span>);
<span class="comment">// Decompressing</span>
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">decompressed</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="number">0u32</span>; <span class="ident">BitPacker4x</span>::<span class="ident">BLOCK_LEN</span>];
<span class="ident">bitpacker</span>.<span class="ident">decompress</span>(<span class="kw-2">&amp;</span><span class="ident">compressed</span>[..<span class="ident">compressed_len</span>], <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">decompressed</span>[..], <span class="ident">num_bits</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">&amp;</span><span class="ident">my_data</span>, <span class="kw-2">&amp;</span><span class="ident">decompressed</span>);</pre></div>
<h1 id="examples-with-delta-encoding" class="section-header"><a href="#examples-with-delta-encoding">Examples with delta-encoding</a></h1>
<p>Delta-encoding makes it possible to store sorted integers in an efficient manner.
Rather than encoding the integers directly, the interval (or deltas) between each of them
are computed and then encoded.</p>
<p>Decoding then requires to first decode the deltas and then operate a cumulative sum (also called
integration or prefix sum) on them.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">bitpacking</span>;
<span class="kw">use</span> <span class="ident">bitpacking</span>::{<span class="ident">BitPacker4x</span>, <span class="ident">BitPacker</span>};
<span class="comment">// The initial value is used to compute the first delta.</span>
<span class="comment">// In most use cases, you will be compressing long increasing</span>
<span class="comment">// integer sequences.</span>
<span class="comment">//</span>
<span class="comment">// You should probably pass an initial value of `0u32` to the</span>
<span class="comment">// first block if you do not have any information.</span>
<span class="comment">//</span>
<span class="comment">// When encoding the second block however, you will want to pass the last</span>
<span class="comment">// value of the first block.</span>
<span class="kw">let</span> <span class="ident">initial_value</span> <span class="op">=</span> <span class="number">0u32</span>;
<span class="kw">let</span> <span class="ident">bitpacker</span> <span class="op">=</span> <span class="ident">BitPacker4x</span>::<span class="ident">new</span>();
<span class="kw">let</span> <span class="ident">num_bits</span>: <span class="ident">u8</span> <span class="op">=</span> <span class="ident">bitpacker</span>.<span class="ident">num_bits_sorted</span>(<span class="ident">initial_value</span>, <span class="kw-2">&amp;</span><span class="ident">my_data</span>);
<span class="comment">// A block will be take at most 4 bytes per-integers.</span>
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">compressed</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="number">0u8</span>; <span class="number">4</span> <span class="op">*</span> <span class="ident">BitPacker4x</span>::<span class="ident">BLOCK_LEN</span>];
<span class="kw">let</span> <span class="ident">compressed_len</span> <span class="op">=</span> <span class="ident">bitpacker</span>.<span class="ident">compress_sorted</span>(<span class="ident">initial_value</span>, <span class="kw-2">&amp;</span><span class="ident">my_data</span>, <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">compressed</span>[..], <span class="ident">num_bits</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>((<span class="ident">num_bits</span> <span class="kw">as</span> <span class="ident">usize</span>) <span class="op">*</span> <span class="ident">BitPacker4x</span>::<span class="ident">BLOCK_LEN</span> <span class="op">/</span> <span class="number">8</span>, <span class="ident">compressed_len</span>);
<span class="comment">// Decompressing</span>
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">decompressed</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="number">0u32</span>; <span class="ident">BitPacker4x</span>::<span class="ident">BLOCK_LEN</span>];
<span class="comment">// The initial value must be the same as the one passed</span>
<span class="comment">// when compressing the block.</span>
<span class="ident">bitpacker</span>.<span class="ident">decompress_sorted</span>(<span class="ident">initial_value</span>, <span class="kw-2">&amp;</span><span class="ident">compressed</span>[..<span class="ident">compressed_len</span>], <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">decompressed</span>[..], <span class="ident">num_bits</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">&amp;</span><span class="ident">my_data</span>, <span class="kw-2">&amp;</span><span class="ident">decompressed</span>);</pre></div>
</div>
<h2 id='associated-const' class='small-section-header'>Associated Constants<a href='#associated-const' class='anchor'></a></h2><div class='methods'><h3 id='associatedconstant.BLOCK_LEN' class='method'><code id='BLOCK_LEN.v'>const <a href='#associatedconstant.BLOCK_LEN' class="constant"><b>BLOCK_LEN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h3><div class='docblock'><p>Number of <code>u32</code> per compressed block</p>
</div></div><span class='loading-content'>Loading content...</span>
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.new' class='method'><code id='new.v'>fn <a href='#tymethod.new' class='fnname'>new</a>() -&gt; Self</code></h3><div class='docblock'><p>Checks the available instructions set on the current
CPU and returns the best available implementation.</p>
<p>Calling <code>.new()</code> is extremely cheap, and does not
require any heap allocation. It is <em>not</em> required to cache
its result too aggressively.</p>
</div><h3 id='tymethod.compress' class='method'><code id='compress.v'>fn <a href='#tymethod.compress' class='fnname'>compress</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h3><div class='docblock'><p>Compress a block of <code>u32</code>.</p>
<p>Assumes that the integers are all lower than <code>2^num_bits</code>.
The result is undefined if they are larger.</p>
<p>Returns the amount of bytes of the compressed block.</p>
<h1 id="panics" class="section-header"><a href="#panics">Panics</a></h1>
<ul>
<li>Panics if the compressed destination array is too small</li>
<li>Panics if <code>decompressed</code> length is not exactly the <code>BLOCK_LEN</code>.</li>
</ul>
</div><h3 id='tymethod.compress_sorted' class='method'><code id='compress_sorted.v'>fn <a href='#tymethod.compress_sorted' class='fnname'>compress_sorted</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;initial: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h3><div class='docblock'><p>Delta encode and compressed the <code>decompressed</code> array.</p>
<p>Assumes that the elements in the <code>decompressed</code> array are sorted.
<code>initial</code> will be used to compute the first <code>delta</code>.</p>
<h1 id="panics-1" class="section-header"><a href="#panics-1">Panics</a></h1>
<ul>
<li>Panics if <code>initial</code> is greater than <code>decompressed[0]</code></li>
<li>Panics if <code>decompressed</code> is not sorted</li>
<li>Panics if <code>decompressed</code>'s length is not exactly <code>BLOCK_LEN</code></li>
<li>Panics if <code>compressed</code> is not large enough to receive the compressed data</li>
<li>Panics if the compressed destination array is too small.</li>
</ul>
<p>Returns the amount of bytes of the compressed block.</p>
<h1 id="panics-2" class="section-header"><a href="#panics-2">Panics</a></h1>
<ul>
<li>Panics if the compressed array is too short.</li>
<li>Panics if the decompressed array is not exactly the <code>BLOCK_LEN</code>.</li>
</ul>
</div><h3 id='tymethod.decompress' class='method'><code id='decompress.v'>fn <a href='#tymethod.decompress' class='fnname'>decompress</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h3><div class='docblock'><p>Decompress the <code>compress</code> array to the <code>decompressed</code> array.</p>
<p>Returns the amount of bytes that were consumed.</p>
<h1 id="panics-3" class="section-header"><a href="#panics-3">Panics</a></h1>
<p>Panics if the compressed array is too short, or the decompressed array is too short.</p>
</div><h3 id='tymethod.decompress_sorted' class='method'><code id='decompress_sorted.v'>fn <a href='#tymethod.decompress_sorted' class='fnname'>decompress_sorted</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;initial: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h3><div class='docblock'><p>Decompress the<code>compress</code>array to the <code>decompressed</code> array.
The <code>compressed</code> array is assumed to have been delta-encoded and compressed.</p>
<p><code>initial</code> must be the value that was passed as the <code>initial</code> argument compressing
the block.</p>
<p>Returns the amount of bytes that have been read.</p>
<h1 id="panics-4" class="section-header"><a href="#panics-4">Panics</a></h1>
<ul>
<li>Panics if the compressed array is too short to contain <code>BLOCK_LEN</code> elements</li>
<li>Panics if the decompressed array is too short.</li>
</ul>
</div><h3 id='tymethod.num_bits' class='method'><code id='num_bits.v'>fn <a href='#tymethod.num_bits' class='fnname'>num_bits</a>(&amp;self, decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code></h3><div class='docblock'><p>Returns the minimum number of bits used to represent the largest integer in the
<code>decompressed</code> array.</p>
</div><h3 id='tymethod.num_bits_sorted' class='method'><code id='num_bits_sorted.v'>fn <a href='#tymethod.num_bits_sorted' class='fnname'>num_bits_sorted</a>(&amp;self, initial: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code></h3><div class='docblock'><p>Returns the minimum number of bits used to represent the largest <code>delta</code> in the deltas in the
<code>decompressed</code> array.</p>
</div></div><span class='loading-content'>Loading content...</span>
<h2 id='provided-methods' class='small-section-header'>Provided methods<a href='#provided-methods' class='anchor'></a></h2><div class='methods'><h3 id='method.compressed_block_size' class='method'><code id='compressed_block_size.v'>fn <a href='#method.compressed_block_size' class='fnname'>compressed_block_size</a>(num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h3><div class='docblock'><p>Returns the size of a compressed block.</p>
</div></div><span class='loading-content'>Loading content...</span>
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-BitPacker' class='impl'><code class='in-band'>impl BitPacker for <a class="struct" href="../bitpacking/struct.BitPacker1x.html" title="struct bitpacking::BitPacker1x">BitPacker1x</a></code><a href='#impl-BitPacker' class='anchor'></a><a class='srclink' href='../src/bitpacking/bitpacker1x.rs.html#66-122' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedconstant.BLOCK_LEN-1' class="associatedconstant hidden"><code id='BLOCK_LEN.v-1'>const <a href='#associatedconstant.BLOCK_LEN-1' class="constant"><b>BLOCK_LEN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../src/bitpacking/bitpacker1x.rs.html#67' title='goto source code'>[src]</a></h4><h4 id='method.new' class="method hidden"><code id='new.v-1'>fn <a href='#method.new' class='fnname'>new</a>() -&gt; <a class="struct" href="../bitpacking/struct.BitPacker1x.html" title="struct bitpacking::BitPacker1x">BitPacker1x</a></code><a class='srclink' href='../src/bitpacking/bitpacker1x.rs.html#69-71' title='goto source code'>[src]</a></h4><h4 id='method.compress' class="method hidden"><code id='compress.v-1'>fn <a href='#method.compress' class='fnname'>compress</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../src/bitpacking/bitpacker1x.rs.html#73-75' title='goto source code'>[src]</a></h4><h4 id='method.compress_sorted' class="method hidden"><code id='compress_sorted.v-1'>fn <a href='#method.compress_sorted' class='fnname'>compress_sorted</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;initial: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../src/bitpacking/bitpacker1x.rs.html#77-92' title='goto source code'>[src]</a></h4><h4 id='method.decompress' class="method hidden"><code id='decompress.v-1'>fn <a href='#method.decompress' class='fnname'>decompress</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../src/bitpacking/bitpacker1x.rs.html#94-96' title='goto source code'>[src]</a></h4><h4 id='method.decompress_sorted' class="method hidden"><code id='decompress_sorted.v-1'>fn <a href='#method.decompress_sorted' class='fnname'>decompress_sorted</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;initial: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../src/bitpacking/bitpacker1x.rs.html#98-113' title='goto source code'>[src]</a></h4><h4 id='method.num_bits' class="method hidden"><code id='num_bits.v-1'>fn <a href='#method.num_bits' class='fnname'>num_bits</a>(&amp;self, decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code><a class='srclink' href='../src/bitpacking/bitpacker1x.rs.html#115-117' title='goto source code'>[src]</a></h4><h4 id='method.num_bits_sorted' class="method hidden"><code id='num_bits_sorted.v-1'>fn <a href='#method.num_bits_sorted' class='fnname'>num_bits_sorted</a>(&amp;self, initial: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code><a class='srclink' href='../src/bitpacking/bitpacker1x.rs.html#119-121' title='goto source code'>[src]</a></h4><h4 id='method.compressed_block_size-1' class="method"><code id='compressed_block_size.v-1'>fn <a href='../bitpacking/trait.BitPacker.html#method.compressed_block_size' class='fnname'>compressed_block_size</a>(num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../src/bitpacking/lib.rs.html#253-255' title='goto source code'>[src]</a></h4></div><h3 id='impl-BitPacker-1' class='impl'><code class='in-band'>impl BitPacker for <a class="struct" href="../bitpacking/struct.BitPacker4x.html" title="struct bitpacking::BitPacker4x">BitPacker4x</a></code><a href='#impl-BitPacker-1' class='anchor'></a><a class='srclink' href='../src/bitpacking/bitpacker4x.rs.html#170-287' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedconstant.BLOCK_LEN-2' class="associatedconstant hidden"><code id='BLOCK_LEN.v-2'>const <a href='#associatedconstant.BLOCK_LEN-2' class="constant"><b>BLOCK_LEN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../src/bitpacking/bitpacker4x.rs.html#171' title='goto source code'>[src]</a></h4><h4 id='method.new-1' class="method"><code id='new.v-2'>fn <a href='#method.new-1' class='fnname'>new</a>() -&gt; Self</code><a class='srclink' href='../src/bitpacking/bitpacker4x.rs.html#174-182' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the best available implementation for the current CPU.</p>
</div><h4 id='method.compress-1' class="method hidden"><code id='compress.v-2'>fn <a href='#method.compress-1' class='fnname'>compress</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../src/bitpacking/bitpacker4x.rs.html#184-196' title='goto source code'>[src]</a></h4><h4 id='method.compress_sorted-1' class="method hidden"><code id='compress_sorted.v-2'>fn <a href='#method.compress_sorted-1' class='fnname'>compress_sorted</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;initial: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../src/bitpacking/bitpacker4x.rs.html#198-222' title='goto source code'>[src]</a></h4><h4 id='method.decompress-1' class="method hidden"><code id='decompress.v-2'>fn <a href='#method.decompress-1' class='fnname'>decompress</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../src/bitpacking/bitpacker4x.rs.html#224-236' title='goto source code'>[src]</a></h4><h4 id='method.decompress_sorted-1' class="method hidden"><code id='decompress_sorted.v-2'>fn <a href='#method.decompress_sorted-1' class='fnname'>decompress_sorted</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;initial: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../src/bitpacking/bitpacker4x.rs.html#238-262' title='goto source code'>[src]</a></h4><h4 id='method.num_bits-1' class="method hidden"><code id='num_bits.v-2'>fn <a href='#method.num_bits-1' class='fnname'>num_bits</a>(&amp;self, decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code><a class='srclink' href='../src/bitpacking/bitpacker4x.rs.html#264-272' title='goto source code'>[src]</a></h4><h4 id='method.num_bits_sorted-1' class="method hidden"><code id='num_bits_sorted.v-2'>fn <a href='#method.num_bits_sorted-1' class='fnname'>num_bits_sorted</a>(&amp;self, initial: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code><a class='srclink' href='../src/bitpacking/bitpacker4x.rs.html#274-286' title='goto source code'>[src]</a></h4><h4 id='method.compressed_block_size-2' class="method"><code id='compressed_block_size.v-2'>fn <a href='../bitpacking/trait.BitPacker.html#method.compressed_block_size' class='fnname'>compressed_block_size</a>(num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../src/bitpacking/lib.rs.html#253-255' title='goto source code'>[src]</a></h4></div><h3 id='impl-BitPacker-2' class='impl'><code class='in-band'>impl BitPacker for <a class="struct" href="../bitpacking/struct.BitPacker8x.html" title="struct bitpacking::BitPacker8x">BitPacker8x</a></code><a href='#impl-BitPacker-2' class='anchor'></a><a class='srclink' href='../src/bitpacking/bitpacker8x.rs.html#205-321' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedconstant.BLOCK_LEN-3' class="associatedconstant hidden"><code id='BLOCK_LEN.v-3'>const <a href='#associatedconstant.BLOCK_LEN-3' class="constant"><b>BLOCK_LEN</b></a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../src/bitpacking/bitpacker8x.rs.html#206' title='goto source code'>[src]</a></h4><h4 id='method.new-2' class="method hidden"><code id='new.v-3'>fn <a href='#method.new-2' class='fnname'>new</a>() -&gt; Self</code><a class='srclink' href='../src/bitpacking/bitpacker8x.rs.html#208-216' title='goto source code'>[src]</a></h4><h4 id='method.compress-2' class="method hidden"><code id='compress.v-3'>fn <a href='#method.compress-2' class='fnname'>compress</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../src/bitpacking/bitpacker8x.rs.html#218-230' title='goto source code'>[src]</a></h4><h4 id='method.compress_sorted-2' class="method hidden"><code id='compress_sorted.v-3'>fn <a href='#method.compress_sorted-2' class='fnname'>compress_sorted</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;initial: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../src/bitpacking/bitpacker8x.rs.html#232-256' title='goto source code'>[src]</a></h4><h4 id='method.decompress-2' class="method hidden"><code id='decompress.v-3'>fn <a href='#method.decompress-2' class='fnname'>decompress</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../src/bitpacking/bitpacker8x.rs.html#258-270' title='goto source code'>[src]</a></h4><h4 id='method.decompress_sorted-2' class="method hidden"><code id='decompress_sorted.v-3'>fn <a href='#method.decompress_sorted-2' class='fnname'>decompress_sorted</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;initial: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;compressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../src/bitpacking/bitpacker8x.rs.html#272-296' title='goto source code'>[src]</a></h4><h4 id='method.num_bits-2' class="method hidden"><code id='num_bits.v-3'>fn <a href='#method.num_bits-2' class='fnname'>num_bits</a>(&amp;self, decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code><a class='srclink' href='../src/bitpacking/bitpacker8x.rs.html#298-306' title='goto source code'>[src]</a></h4><h4 id='method.num_bits_sorted-2' class="method hidden"><code id='num_bits_sorted.v-3'>fn <a href='#method.num_bits_sorted-2' class='fnname'>num_bits_sorted</a>(&amp;self, initial: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, decompressed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code><a class='srclink' href='../src/bitpacking/bitpacker8x.rs.html#308-320' title='goto source code'>[src]</a></h4><h4 id='method.compressed_block_size-3' class="method"><code id='compressed_block_size.v-3'>fn <a href='../bitpacking/trait.BitPacker.html#method.compressed_block_size' class='fnname'>compressed_block_size</a>(num_bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../src/bitpacking/lib.rs.html#253-255' title='goto source code'>[src]</a></h4></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
src="../implementors/bitpacking/trait.BitPacker.js">
</script></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd></kbd></dt><dd>Move up in search results</dd><dt><kbd></kbd></dt><dd>Move down in search results</dd><dt><kbd></kbd></dt><dd>Switch tab</dd><dt><kbd>&#9166;</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "bitpacking";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>