blob: 6edee753e8318fd6c832c0712950861ea8f4563d [file] [log] [blame]
<!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="The bitvector type."><meta name="keywords" content="rust, rustlang, rust-lang, BitVec"><title>BitVec in bit_vec - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../normalize.css"><link rel="stylesheet" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../ayu.css" disabled><link rel="stylesheet" href="../dark.css" disabled><link rel="stylesheet" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../bit_vec/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../bit_vec/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">BitVec</a></h2><div class="sidebar-elems"><section><h3><a href="#implementations">Methods</a></h3><ul class="block"><li><a href="#method.all">all</a></li><li><a href="#method.and">and</a></li><li><a href="#method.any">any</a></li><li><a href="#method.append">append</a></li><li><a href="#method.blocks">blocks</a></li><li><a href="#method.capacity">capacity</a></li><li><a href="#method.clear">clear</a></li><li><a href="#method.difference">difference</a></li><li><a href="#method.eq_vec">eq_vec</a></li><li><a href="#method.from_bytes">from_bytes</a></li><li><a href="#method.from_elem">from_elem</a></li><li><a href="#method.from_fn">from_fn</a></li><li><a href="#method.get">get</a></li><li><a href="#method.grow">grow</a></li><li><a href="#method.intersect">intersect</a></li><li><a href="#method.is_empty">is_empty</a></li><li><a href="#method.iter">iter</a></li><li><a href="#method.len">len</a></li><li><a href="#method.nand">nand</a></li><li><a href="#method.negate">negate</a></li><li><a href="#method.new">new</a></li><li><a href="#method.none">none</a></li><li><a href="#method.nor">nor</a></li><li><a href="#method.or">or</a></li><li><a href="#method.pop">pop</a></li><li><a href="#method.push">push</a></li><li><a href="#method.reserve">reserve</a></li><li><a href="#method.reserve_exact">reserve_exact</a></li><li><a href="#method.set">set</a></li><li><a href="#method.set_all">set_all</a></li><li><a href="#method.set_len">set_len</a></li><li><a href="#method.shrink_to_fit">shrink_to_fit</a></li><li><a href="#method.split_off">split_off</a></li><li><a href="#method.storage">storage</a></li><li><a href="#method.storage_mut">storage_mut</a></li><li><a href="#method.to_bytes">to_bytes</a></li><li><a href="#method.truncate">truncate</a></li><li><a href="#method.union">union</a></li><li><a href="#method.with_capacity">with_capacity</a></li><li><a href="#method.xnor">xnor</a></li><li><a href="#method.xor">xor</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block"><li><a href="#impl-Clone-for-BitVec%3CB%3E">Clone</a></li><li><a href="#impl-Debug-for-BitVec%3CB%3E">Debug</a></li><li><a href="#impl-Default-for-BitVec%3CB%3E">Default</a></li><li><a href="#impl-Eq-for-BitVec%3CB%3E">Eq</a></li><li><a href="#impl-Extend%3Cbool%3E-for-BitVec%3CB%3E">Extend&lt;bool&gt;</a></li><li><a href="#impl-FromIterator%3Cbool%3E-for-BitVec%3CB%3E">FromIterator&lt;bool&gt;</a></li><li><a href="#impl-Hash-for-BitVec%3CB%3E">Hash</a></li><li><a href="#impl-Index%3Cusize%3E-for-BitVec%3CB%3E">Index&lt;usize&gt;</a></li><li><a href="#impl-IntoIterator-for-%26%27a%20BitVec%3CB%3E">IntoIterator</a></li><li><a href="#impl-IntoIterator-for-BitVec%3CB%3E">IntoIterator</a></li><li><a href="#impl-Ord-for-BitVec%3CB%3E">Ord</a></li><li><a href="#impl-PartialEq%3CBitVec%3CB%3E%3E-for-BitVec%3CB%3E">PartialEq&lt;BitVec&lt;B&gt;&gt;</a></li><li><a href="#impl-PartialOrd%3CBitVec%3CB%3E%3E-for-BitVec%3CB%3E">PartialOrd&lt;BitVec&lt;B&gt;&gt;</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block"><li><a href="#impl-RefUnwindSafe-for-BitVec%3CB%3E">RefUnwindSafe</a></li><li><a href="#impl-Send-for-BitVec%3CB%3E">Send</a></li><li><a href="#impl-Sync-for-BitVec%3CB%3E">Sync</a></li><li><a href="#impl-Unpin-for-BitVec%3CB%3E">Unpin</a></li><li><a href="#impl-UnwindSafe-for-BitVec%3CB%3E">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block"><li><a href="#impl-Any-for-BitVec%3CB%3E">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-BitVec%3CB%3E">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-BitVec%3CB%3E">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-From%3CT%3E-for-BitVec%3CB%3E">From&lt;T&gt;</a></li><li><a href="#impl-Into%3CU%3E-for-BitVec%3CB%3E">Into&lt;U&gt;</a></li><li><a href="#impl-ToOwned-for-BitVec%3CB%3E">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E-for-BitVec%3CB%3E">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E-for-BitVec%3CB%3E">TryInto&lt;U&gt;</a></li></ul></section><h2><a href="index.html">In bit_vec</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Struct <a href="index.html">bit_vec</a>::<wbr><a class="struct" href="#">BitVec</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../src/bit_vec/lib.rs.html#212-217">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="item-decl"><pre class="rust struct"><code>pub struct BitVec&lt;B&nbsp;=&nbsp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt; { /* private fields */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The bitvector type.</p>
<h2 id="examples"><a href="#examples">Examples</a></h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span><span class="kw-2">mut </span>bv = BitVec::from_elem(<span class="number">10</span>, <span class="bool-val">false</span>);
<span class="comment">// insert all primes less than 10
</span>bv.set(<span class="number">2</span>, <span class="bool-val">true</span>);
bv.set(<span class="number">3</span>, <span class="bool-val">true</span>);
bv.set(<span class="number">5</span>, <span class="bool-val">true</span>);
bv.set(<span class="number">7</span>, <span class="bool-val">true</span>);
<span class="macro">println!</span>(<span class="string">&quot;{:?}&quot;</span>, bv);
<span class="macro">println!</span>(<span class="string">&quot;total bits set to true: {}&quot;</span>, bv.iter().filter(|x| <span class="kw-2">*</span>x).count());
<span class="comment">// flip all values in bitvector, producing non-primes less than 10
</span>bv.negate();
<span class="macro">println!</span>(<span class="string">&quot;{:?}&quot;</span>, bv);
<span class="macro">println!</span>(<span class="string">&quot;total bits set to true: {}&quot;</span>, bv.iter().filter(|x| <span class="kw-2">*</span>x).count());
<span class="comment">// reset bitvector to empty
</span>bv.clear();
<span class="macro">println!</span>(<span class="string">&quot;{:?}&quot;</span>, bv);
<span class="macro">println!</span>(<span class="string">&quot;total bits set to true: {}&quot;</span>, bv.iter().filter(|x| <span class="kw-2">*</span>x).count());</code></pre></div>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-BitVec%3Cu32%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#258-378">source</a><a href="#impl-BitVec%3Cu32%3E" class="anchor"></a><h3 class="code-header">impl <a class="struct" href="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.new" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#269-271">source</a><h4 class="code-header">pub fn <a href="#method.new" class="fnname">new</a>() -&gt; Self</h4></section></summary><div class="docblock"><p>Creates an empty <code>BitVec</code>.</p>
<h5 id="examples-1"><a href="#examples-1">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span><span class="kw-2">mut </span>bv = BitVec::new();</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_elem" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#288-296">source</a><h4 class="code-header">pub fn <a href="#method.from_elem" class="fnname">from_elem</a>(nbits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, bit: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Creates a <code>BitVec</code> that holds <code>nbits</code> elements, setting each element
to <code>bit</code>.</p>
<h5 id="examples-2"><a href="#examples-2">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span><span class="kw-2">mut </span>bv = BitVec::from_elem(<span class="number">10</span>, <span class="bool-val">false</span>);
<span class="macro">assert_eq!</span>(bv.len(), <span class="number">10</span>);
<span class="kw">for </span>x <span class="kw">in </span>bv.iter() {
<span class="macro">assert_eq!</span>(x, <span class="bool-val">false</span>);
}</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.with_capacity" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#306-311">source</a><h4 class="code-header">pub fn <a href="#method.with_capacity" class="fnname">with_capacity</a>(nbits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Constructs a new, empty <code>BitVec</code> with the specified capacity.</p>
<p>The bitvector will be able to hold at least <code>capacity</code> bits without
reallocating. If <code>capacity</code> is 0, it will not allocate.</p>
<p>It is important to note that this function does not specify the
<em>length</em> of the returned bitvector, but only the <em>capacity</em>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_bytes" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#328-355">source</a><h4 class="code-header">pub fn <a href="#method.from_bytes" class="fnname">from_bytes</a>(bytes: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -&gt; Self</h4></section></summary><div class="docblock"><p>Transforms a byte-vector into a <code>BitVec</code>. Each byte becomes eight bits,
with the most significant bits of each byte coming first. Each
bit becomes <code>true</code> if equal to 1 or <code>false</code> if equal to 0.</p>
<h5 id="examples-3"><a href="#examples-3">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span>bv = BitVec::from_bytes(<span class="kw-2">&amp;</span>[<span class="number">0b10100000</span>, <span class="number">0b00010010</span>]);
<span class="macro">assert!</span>(bv.eq_vec(<span class="kw-2">&amp;</span>[<span class="bool-val">true</span>, <span class="bool-val">false</span>, <span class="bool-val">true</span>, <span class="bool-val">false</span>,
<span class="bool-val">false</span>, <span class="bool-val">false</span>, <span class="bool-val">false</span>, <span class="bool-val">false</span>,
<span class="bool-val">false</span>, <span class="bool-val">false</span>, <span class="bool-val">false</span>, <span class="bool-val">true</span>,
<span class="bool-val">false</span>, <span class="bool-val">false</span>, <span class="bool-val">true</span>, <span class="bool-val">false</span>]));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_fn" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#369-377">source</a><h4 class="code-header">pub fn <a href="#method.from_fn" class="fnname">from_fn</a>&lt;F&gt;(len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, f: F) -&gt; Self<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.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,</span></h4></section></summary><div class="docblock"><p>Creates a <code>BitVec</code> of the specified length where the value at each index
is <code>f(index)</code>.</p>
<h5 id="examples-4"><a href="#examples-4">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span>bv = BitVec::from_fn(<span class="number">5</span>, |i| { i % <span class="number">2 </span>== <span class="number">0 </span>});
<span class="macro">assert!</span>(bv.eq_vec(<span class="kw-2">&amp;</span>[<span class="bool-val">true</span>, <span class="bool-val">false</span>, <span class="bool-val">true</span>, <span class="bool-val">false</span>, <span class="bool-val">true</span>]));</code></pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#380-1393">source</a><a href="#impl-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;B:&nbsp;<a class="trait" href="trait.BitBlock.html" title="trait bit_vec::BitBlock">BitBlock</a>&gt; <a class="struct" href="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.blocks" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#407-410">source</a><h4 class="code-header">pub fn <a href="#method.blocks" class="fnname">blocks</a>(&amp;self) -&gt; <a class="struct" href="struct.Blocks.html" title="struct bit_vec::Blocks">Blocks</a>&lt;'_, B&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Blocks.html" title="struct bit_vec::Blocks">Blocks</a>&lt;'a, B&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a, B:&nbsp;<a class="trait" href="trait.BitBlock.html" title="trait bit_vec::BitBlock">BitBlock</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.Blocks.html" title="struct bit_vec::Blocks">Blocks</a>&lt;'a, B&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = B;</span></code></span></span></span></span></h4></section></summary><div class="docblock"><p>Iterator over the underlying blocks of data</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.storage" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#416-418">source</a><h4 class="code-header">pub fn <a href="#method.storage" class="fnname">storage</a>(&amp;self) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[B]</a><span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]</span><code class="content"><span class="where fmt-newline">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]</span><span class="where fmt-newline">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]</span></code></span></span></span></span></h4></section></summary><div class="docblock"><p>Exposes the raw block storage of this BitVec</p>
<p>Only really intended for BitSet.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.storage_mut" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#424-426">source</a><h4 class="code-header">pub unsafe fn <a href="#method.storage_mut" class="fnname">storage_mut</a>(&amp;mut self) -&gt; &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;B&gt;</h4></section></summary><div class="docblock"><p>Exposes the raw block storage of this BitVec</p>
<p>Can probably cause unsafety. Only really intended for BitSet.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.get" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#509-519">source</a><h4 class="code-header">pub fn <a href="#method.get" class="fnname">get</a>(&amp;self, i: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&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.bool.html">bool</a>&gt;</h4></section></summary><div class="docblock"><p>Retrieves the value at index <code>i</code>, or <code>None</code> if the index is out of bounds.</p>
<h5 id="examples-5"><a href="#examples-5">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span>bv = BitVec::from_bytes(<span class="kw-2">&amp;</span>[<span class="number">0b01100000</span>]);
<span class="macro">assert_eq!</span>(bv.get(<span class="number">0</span>), <span class="prelude-val">Some</span>(<span class="bool-val">false</span>));
<span class="macro">assert_eq!</span>(bv.get(<span class="number">1</span>), <span class="prelude-val">Some</span>(<span class="bool-val">true</span>));
<span class="macro">assert_eq!</span>(bv.get(<span class="number">100</span>), <span class="prelude-val">None</span>);
<span class="comment">// Can also use array indexing
</span><span class="macro">assert_eq!</span>(bv[<span class="number">1</span>], <span class="bool-val">true</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.set" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#537-546">source</a><h4 class="code-header">pub fn <a href="#method.set" class="fnname">set</a>(&amp;mut self, i: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, x: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>)</h4></section></summary><div class="docblock"><p>Sets the value of a bit at an index <code>i</code>.</p>
<h5 id="panics"><a href="#panics">Panics</a></h5>
<p>Panics if <code>i</code> is out of bounds.</p>
<h5 id="examples-6"><a href="#examples-6">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span><span class="kw-2">mut </span>bv = BitVec::from_elem(<span class="number">5</span>, <span class="bool-val">false</span>);
bv.set(<span class="number">3</span>, <span class="bool-val">true</span>);
<span class="macro">assert_eq!</span>(bv[<span class="number">3</span>], <span class="bool-val">true</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.set_all" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#563-567">source</a><h4 class="code-header">pub fn <a href="#method.set_all" class="fnname">set_all</a>(&amp;mut self)</h4></section></summary><div class="docblock"><p>Sets all bits to 1.</p>
<h5 id="examples-7"><a href="#examples-7">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span>before = <span class="number">0b01100000</span>;
<span class="kw">let </span>after = <span class="number">0b11111111</span>;
<span class="kw">let </span><span class="kw-2">mut </span>bv = BitVec::from_bytes(<span class="kw-2">&amp;</span>[before]);
bv.set_all();
<span class="macro">assert_eq!</span>(bv, BitVec::from_bytes(<span class="kw-2">&amp;</span>[after]));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.negate" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#584-588">source</a><h4 class="code-header">pub fn <a href="#method.negate" class="fnname">negate</a>(&amp;mut self)</h4></section></summary><div class="docblock"><p>Flips all bits.</p>
<h5 id="examples-8"><a href="#examples-8">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span>before = <span class="number">0b01100000</span>;
<span class="kw">let </span>after = <span class="number">0b10011111</span>;
<span class="kw">let </span><span class="kw-2">mut </span>bv = BitVec::from_bytes(<span class="kw-2">&amp;</span>[before]);
bv.negate();
<span class="macro">assert_eq!</span>(bv, BitVec::from_bytes(<span class="kw-2">&amp;</span>[after]));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.union" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#620-622">source</a><h4 class="code-header">pub fn <a href="#method.union" class="fnname">union</a>(&amp;mut self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.7.0: Please use the ‘or’ function instead</span></div></span></summary><div class="docblock"><p>Calculates the union of two bitvectors. This acts like the bitwise <code>or</code>
function.</p>
<p>Sets <code>self</code> to the union of <code>self</code> and <code>other</code>. Both bitvectors must be
the same length. Returns <code>true</code> if <code>self</code> changed.</p>
<h5 id="panics-1"><a href="#panics-1">Panics</a></h5>
<p>Panics if the bitvectors are of different lengths.</p>
<h5 id="examples-9"><a href="#examples-9">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span>a = <span class="number">0b01100100</span>;
<span class="kw">let </span>b = <span class="number">0b01011010</span>;
<span class="kw">let </span>res = <span class="number">0b01111110</span>;
<span class="kw">let </span><span class="kw-2">mut </span>a = BitVec::from_bytes(<span class="kw-2">&amp;</span>[a]);
<span class="kw">let </span>b = BitVec::from_bytes(<span class="kw-2">&amp;</span>[b]);
<span class="macro">assert!</span>(a.union(<span class="kw-2">&amp;</span>b));
<span class="macro">assert_eq!</span>(a, BitVec::from_bytes(<span class="kw-2">&amp;</span>[res]));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.intersect" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#654-656">source</a><h4 class="code-header">pub fn <a href="#method.intersect" class="fnname">intersect</a>(&amp;mut self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.7.0: Please use the ‘and’ function instead</span></div></span></summary><div class="docblock"><p>Calculates the intersection of two bitvectors. This acts like the
bitwise <code>and</code> function.</p>
<p>Sets <code>self</code> to the intersection of <code>self</code> and <code>other</code>. Both bitvectors
must be the same length. Returns <code>true</code> if <code>self</code> changed.</p>
<h5 id="panics-2"><a href="#panics-2">Panics</a></h5>
<p>Panics if the bitvectors are of different lengths.</p>
<h5 id="examples-10"><a href="#examples-10">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span>a = <span class="number">0b01100100</span>;
<span class="kw">let </span>b = <span class="number">0b01011010</span>;
<span class="kw">let </span>res = <span class="number">0b01000000</span>;
<span class="kw">let </span><span class="kw-2">mut </span>a = BitVec::from_bytes(<span class="kw-2">&amp;</span>[a]);
<span class="kw">let </span>b = BitVec::from_bytes(<span class="kw-2">&amp;</span>[b]);
<span class="macro">assert!</span>(a.intersect(<span class="kw-2">&amp;</span>b));
<span class="macro">assert_eq!</span>(a, BitVec::from_bytes(<span class="kw-2">&amp;</span>[res]));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.or" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#683-687">source</a><h4 class="code-header">pub fn <a href="#method.or" class="fnname">or</a>(&amp;mut self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Calculates the bitwise <code>or</code> of two bitvectors.</p>
<p>Sets <code>self</code> to the union of <code>self</code> and <code>other</code>. Both bitvectors must be
the same length. Returns <code>true</code> if <code>self</code> changed.</p>
<h5 id="panics-3"><a href="#panics-3">Panics</a></h5>
<p>Panics if the bitvectors are of different lengths.</p>
<h5 id="examples-11"><a href="#examples-11">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span>a = <span class="number">0b01100100</span>;
<span class="kw">let </span>b = <span class="number">0b01011010</span>;
<span class="kw">let </span>res = <span class="number">0b01111110</span>;
<span class="kw">let </span><span class="kw-2">mut </span>a = BitVec::from_bytes(<span class="kw-2">&amp;</span>[a]);
<span class="kw">let </span>b = BitVec::from_bytes(<span class="kw-2">&amp;</span>[b]);
<span class="macro">assert!</span>(a.or(<span class="kw-2">&amp;</span>b));
<span class="macro">assert_eq!</span>(a, BitVec::from_bytes(<span class="kw-2">&amp;</span>[res]));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.and" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#714-718">source</a><h4 class="code-header">pub fn <a href="#method.and" class="fnname">and</a>(&amp;mut self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Calculates the bitwise <code>and</code> of two bitvectors.</p>
<p>Sets <code>self</code> to the intersection of <code>self</code> and <code>other</code>. Both bitvectors
must be the same length. Returns <code>true</code> if <code>self</code> changed.</p>
<h5 id="panics-4"><a href="#panics-4">Panics</a></h5>
<p>Panics if the bitvectors are of different lengths.</p>
<h5 id="examples-12"><a href="#examples-12">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span>a = <span class="number">0b01100100</span>;
<span class="kw">let </span>b = <span class="number">0b01011010</span>;
<span class="kw">let </span>res = <span class="number">0b01000000</span>;
<span class="kw">let </span><span class="kw-2">mut </span>a = BitVec::from_bytes(<span class="kw-2">&amp;</span>[a]);
<span class="kw">let </span>b = BitVec::from_bytes(<span class="kw-2">&amp;</span>[b]);
<span class="macro">assert!</span>(a.and(<span class="kw-2">&amp;</span>b));
<span class="macro">assert_eq!</span>(a, BitVec::from_bytes(<span class="kw-2">&amp;</span>[res]));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.difference" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#753-757">source</a><h4 class="code-header">pub fn <a href="#method.difference" class="fnname">difference</a>(&amp;mut self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Calculates the difference between two bitvectors.</p>
<p>Sets each element of <code>self</code> to the value of that element minus the
element of <code>other</code> at the same index. Both bitvectors must be the same
length. Returns <code>true</code> if <code>self</code> changed.</p>
<h5 id="panics-5"><a href="#panics-5">Panics</a></h5>
<p>Panics if the bitvectors are of different length.</p>
<h5 id="examples-13"><a href="#examples-13">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span>a = <span class="number">0b01100100</span>;
<span class="kw">let </span>b = <span class="number">0b01011010</span>;
<span class="kw">let </span>a_b = <span class="number">0b00100100</span>; <span class="comment">// a - b
</span><span class="kw">let </span>b_a = <span class="number">0b00011010</span>; <span class="comment">// b - a
</span><span class="kw">let </span><span class="kw-2">mut </span>bva = BitVec::from_bytes(<span class="kw-2">&amp;</span>[a]);
<span class="kw">let </span>bvb = BitVec::from_bytes(<span class="kw-2">&amp;</span>[b]);
<span class="macro">assert!</span>(bva.difference(<span class="kw-2">&amp;</span>bvb));
<span class="macro">assert_eq!</span>(bva, BitVec::from_bytes(<span class="kw-2">&amp;</span>[a_b]));
<span class="kw">let </span>bva = BitVec::from_bytes(<span class="kw-2">&amp;</span>[a]);
<span class="kw">let </span><span class="kw-2">mut </span>bvb = BitVec::from_bytes(<span class="kw-2">&amp;</span>[b]);
<span class="macro">assert!</span>(bvb.difference(<span class="kw-2">&amp;</span>bva));
<span class="macro">assert_eq!</span>(bvb, BitVec::from_bytes(<span class="kw-2">&amp;</span>[b_a]));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.xor" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#784-788">source</a><h4 class="code-header">pub fn <a href="#method.xor" class="fnname">xor</a>(&amp;mut self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Calculates the xor of two bitvectors.</p>
<p>Sets <code>self</code> to the xor of <code>self</code> and <code>other</code>. Both bitvectors must be
the same length. Returns <code>true</code> if <code>self</code> changed.</p>
<h5 id="panics-6"><a href="#panics-6">Panics</a></h5>
<p>Panics if the bitvectors are of different length.</p>
<h5 id="examples-14"><a href="#examples-14">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span>a = <span class="number">0b01100110</span>;
<span class="kw">let </span>b = <span class="number">0b01010100</span>;
<span class="kw">let </span>res = <span class="number">0b00110010</span>;
<span class="kw">let </span><span class="kw-2">mut </span>a = BitVec::from_bytes(<span class="kw-2">&amp;</span>[a]);
<span class="kw">let </span>b = BitVec::from_bytes(<span class="kw-2">&amp;</span>[b]);
<span class="macro">assert!</span>(a.xor(<span class="kw-2">&amp;</span>b));
<span class="macro">assert_eq!</span>(a, BitVec::from_bytes(<span class="kw-2">&amp;</span>[res]));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.nand" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#815-822">source</a><h4 class="code-header">pub fn <a href="#method.nand" class="fnname">nand</a>(&amp;mut self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Calculates the nand of two bitvectors.</p>
<p>Sets <code>self</code> to the nand of <code>self</code> and <code>other</code>. Both bitvectors must be
the same length. Returns <code>true</code> if <code>self</code> changed.</p>
<h5 id="panics-7"><a href="#panics-7">Panics</a></h5>
<p>Panics if the bitvectors are of different length.</p>
<h5 id="examples-15"><a href="#examples-15">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span>a = <span class="number">0b01100110</span>;
<span class="kw">let </span>b = <span class="number">0b01010100</span>;
<span class="kw">let </span>res = <span class="number">0b10111011</span>;
<span class="kw">let </span><span class="kw-2">mut </span>a = BitVec::from_bytes(<span class="kw-2">&amp;</span>[a]);
<span class="kw">let </span>b = BitVec::from_bytes(<span class="kw-2">&amp;</span>[b]);
<span class="macro">assert!</span>(a.nand(<span class="kw-2">&amp;</span>b));
<span class="macro">assert_eq!</span>(a, BitVec::from_bytes(<span class="kw-2">&amp;</span>[res]));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.nor" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#849-856">source</a><h4 class="code-header">pub fn <a href="#method.nor" class="fnname">nor</a>(&amp;mut self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Calculates the nor of two bitvectors.</p>
<p>Sets <code>self</code> to the nor of <code>self</code> and <code>other</code>. Both bitvectors must be
the same length. Returns <code>true</code> if <code>self</code> changed.</p>
<h5 id="panics-8"><a href="#panics-8">Panics</a></h5>
<p>Panics if the bitvectors are of different length.</p>
<h5 id="examples-16"><a href="#examples-16">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span>a = <span class="number">0b01100110</span>;
<span class="kw">let </span>b = <span class="number">0b01010100</span>;
<span class="kw">let </span>res = <span class="number">0b10001001</span>;
<span class="kw">let </span><span class="kw-2">mut </span>a = BitVec::from_bytes(<span class="kw-2">&amp;</span>[a]);
<span class="kw">let </span>b = BitVec::from_bytes(<span class="kw-2">&amp;</span>[b]);
<span class="macro">assert!</span>(a.nor(<span class="kw-2">&amp;</span>b));
<span class="macro">assert_eq!</span>(a, BitVec::from_bytes(<span class="kw-2">&amp;</span>[res]));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.xnor" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#883-890">source</a><h4 class="code-header">pub fn <a href="#method.xnor" class="fnname">xnor</a>(&amp;mut self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Calculates the xnor of two bitvectors.</p>
<p>Sets <code>self</code> to the xnor of <code>self</code> and <code>other</code>. Both bitvectors must be
the same length. Returns <code>true</code> if <code>self</code> changed.</p>
<h5 id="panics-9"><a href="#panics-9">Panics</a></h5>
<p>Panics if the bitvectors are of different length.</p>
<h5 id="examples-17"><a href="#examples-17">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span>a = <span class="number">0b01100110</span>;
<span class="kw">let </span>b = <span class="number">0b01010100</span>;
<span class="kw">let </span>res = <span class="number">0b11001101</span>;
<span class="kw">let </span><span class="kw-2">mut </span>a = BitVec::from_bytes(<span class="kw-2">&amp;</span>[a]);
<span class="kw">let </span>b = BitVec::from_bytes(<span class="kw-2">&amp;</span>[b]);
<span class="macro">assert!</span>(a.xnor(<span class="kw-2">&amp;</span>b));
<span class="macro">assert_eq!</span>(a, BitVec::from_bytes(<span class="kw-2">&amp;</span>[res]));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.all" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#906-916">source</a><h4 class="code-header">pub fn <a href="#method.all" class="fnname">all</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Returns <code>true</code> if all bits are 1.</p>
<h5 id="examples-18"><a href="#examples-18">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span><span class="kw-2">mut </span>bv = BitVec::from_elem(<span class="number">5</span>, <span class="bool-val">true</span>);
<span class="macro">assert_eq!</span>(bv.all(), <span class="bool-val">true</span>);
bv.set(<span class="number">1</span>, <span class="bool-val">false</span>);
<span class="macro">assert_eq!</span>(bv.all(), <span class="bool-val">false</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.iter" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#929-932">source</a><h4 class="code-header">pub fn <a href="#method.iter" class="fnname">iter</a>(&amp;self) -&gt; <a class="struct" href="struct.Iter.html" title="struct bit_vec::Iter">Iter</a>&lt;'_, B&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Iter.html" title="struct bit_vec::Iter">Iter</a>&lt;'a, B&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a, B:&nbsp;<a class="trait" href="trait.BitBlock.html" title="trait bit_vec::BitBlock">BitBlock</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.Iter.html" title="struct bit_vec::Iter">Iter</a>&lt;'a, B&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>;</span></code></span></span></span></span></h4></section></summary><div class="docblock"><p>Returns an iterator over the elements of the vector in order.</p>
<h5 id="examples-19"><a href="#examples-19">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span>bv = BitVec::from_bytes(<span class="kw-2">&amp;</span>[<span class="number">0b01110100</span>, <span class="number">0b10010010</span>]);
<span class="macro">assert_eq!</span>(bv.iter().filter(|x| <span class="kw-2">*</span>x).count(), <span class="number">7</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.append" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#951-980">source</a><h4 class="code-header">pub fn <a href="#method.append" class="fnname">append</a>(&amp;mut self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self)</h4></section></summary><div class="docblock"><p>Moves all bits from <code>other</code> into <code>Self</code>, leaving <code>other</code> empty.</p>
<h5 id="examples-20"><a href="#examples-20">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span><span class="kw-2">mut </span>a = BitVec::from_bytes(<span class="kw-2">&amp;</span>[<span class="number">0b10000000</span>]);
<span class="kw">let </span><span class="kw-2">mut </span>b = BitVec::from_bytes(<span class="kw-2">&amp;</span>[<span class="number">0b01100001</span>]);
a.append(<span class="kw-2">&amp;mut </span>b);
<span class="macro">assert_eq!</span>(a.len(), <span class="number">16</span>);
<span class="macro">assert_eq!</span>(b.len(), <span class="number">0</span>);
<span class="macro">assert!</span>(a.eq_vec(<span class="kw-2">&amp;</span>[<span class="bool-val">true</span>, <span class="bool-val">false</span>, <span class="bool-val">false</span>, <span class="bool-val">false</span>, <span class="bool-val">false</span>, <span class="bool-val">false</span>, <span class="bool-val">false</span>, <span class="bool-val">false</span>,
<span class="bool-val">false</span>, <span class="bool-val">true</span>, <span class="bool-val">true</span>, <span class="bool-val">false</span>, <span class="bool-val">false</span>, <span class="bool-val">false</span>, <span class="bool-val">false</span>, <span class="bool-val">true</span>]));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.split_off" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1006-1044">source</a><h4 class="code-header">pub fn <a href="#method.split_off" class="fnname">split_off</a>(&amp;mut self, at: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; Self</h4></section></summary><div class="docblock"><p>Splits the <code>BitVec</code> into two at the given bit,
retaining the first half in-place and returning the second one.</p>
<h5 id="panics-10"><a href="#panics-10">Panics</a></h5>
<p>Panics if <code>at</code> is out of bounds.</p>
<h5 id="examples-21"><a href="#examples-21">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span><span class="kw-2">mut </span>a = BitVec::new();
a.push(<span class="bool-val">true</span>);
a.push(<span class="bool-val">false</span>);
a.push(<span class="bool-val">false</span>);
a.push(<span class="bool-val">true</span>);
<span class="kw">let </span>b = a.split_off(<span class="number">2</span>);
<span class="macro">assert_eq!</span>(a.len(), <span class="number">2</span>);
<span class="macro">assert_eq!</span>(b.len(), <span class="number">2</span>);
<span class="macro">assert!</span>(a.eq_vec(<span class="kw-2">&amp;</span>[<span class="bool-val">true</span>, <span class="bool-val">false</span>]));
<span class="macro">assert!</span>(b.eq_vec(<span class="kw-2">&amp;</span>[<span class="bool-val">false</span>, <span class="bool-val">true</span>]));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.none" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1060-1062">source</a><h4 class="code-header">pub fn <a href="#method.none" class="fnname">none</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Returns <code>true</code> if all bits are 0.</p>
<h5 id="examples-22"><a href="#examples-22">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span><span class="kw-2">mut </span>bv = BitVec::from_elem(<span class="number">10</span>, <span class="bool-val">false</span>);
<span class="macro">assert_eq!</span>(bv.none(), <span class="bool-val">true</span>);
bv.set(<span class="number">3</span>, <span class="bool-val">true</span>);
<span class="macro">assert_eq!</span>(bv.none(), <span class="bool-val">false</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.any" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1078-1080">source</a><h4 class="code-header">pub fn <a href="#method.any" class="fnname">any</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Returns <code>true</code> if any bit is 1.</p>
<h5 id="examples-23"><a href="#examples-23">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span><span class="kw-2">mut </span>bv = BitVec::from_elem(<span class="number">10</span>, <span class="bool-val">false</span>);
<span class="macro">assert_eq!</span>(bv.any(), <span class="bool-val">false</span>);
bv.set(<span class="number">3</span>, <span class="bool-val">true</span>);
<span class="macro">assert_eq!</span>(bv.any(), <span class="bool-val">true</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.to_bytes" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1103-1127">source</a><h4 class="code-header">pub fn <a href="#method.to_bytes" class="fnname">to_bytes</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;</h4></section></summary><div class="docblock"><p>Organises the bits into bytes, such that the first bit in the
<code>BitVec</code> becomes the high-order bit of the first byte. If the
size of the <code>BitVec</code> is not a multiple of eight then trailing bits
will be filled-in with <code>false</code>.</p>
<h5 id="examples-24"><a href="#examples-24">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span><span class="kw-2">mut </span>bv = BitVec::from_elem(<span class="number">3</span>, <span class="bool-val">true</span>);
bv.set(<span class="number">1</span>, <span class="bool-val">false</span>);
<span class="macro">assert_eq!</span>(bv.to_bytes(), [<span class="number">0b10100000</span>]);
<span class="kw">let </span><span class="kw-2">mut </span>bv = BitVec::from_elem(<span class="number">9</span>, <span class="bool-val">false</span>);
bv.set(<span class="number">2</span>, <span class="bool-val">true</span>);
bv.set(<span class="number">8</span>, <span class="bool-val">true</span>);
<span class="macro">assert_eq!</span>(bv.to_bytes(), [<span class="number">0b00100000</span>, <span class="number">0b10000000</span>]);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.eq_vec" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1147-1150">source</a><h4 class="code-header">pub fn <a href="#method.eq_vec" class="fnname">eq_vec</a>(&amp;self, v: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Compares a <code>BitVec</code> to a slice of <code>bool</code>s.
Both the <code>BitVec</code> and slice must have the same length.</p>
<h5 id="panics-11"><a href="#panics-11">Panics</a></h5>
<p>Panics if the <code>BitVec</code> and slice are of different length.</p>
<h5 id="examples-25"><a href="#examples-25">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span>bv = BitVec::from_bytes(<span class="kw-2">&amp;</span>[<span class="number">0b10100000</span>]);
<span class="macro">assert!</span>(bv.eq_vec(<span class="kw-2">&amp;</span>[<span class="bool-val">true</span>, <span class="bool-val">false</span>, <span class="bool-val">true</span>, <span class="bool-val">false</span>,
<span class="bool-val">false</span>, <span class="bool-val">false</span>, <span class="bool-val">false</span>, <span class="bool-val">false</span>]));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.truncate" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1167-1175">source</a><h4 class="code-header">pub fn <a href="#method.truncate" class="fnname">truncate</a>(&amp;mut self, len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</h4></section></summary><div class="docblock"><p>Shortens a <code>BitVec</code>, dropping excess elements.</p>
<p>If <code>len</code> is greater than the vector’s current length, this has no
effect.</p>
<h5 id="examples-26"><a href="#examples-26">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span><span class="kw-2">mut </span>bv = BitVec::from_bytes(<span class="kw-2">&amp;</span>[<span class="number">0b01001011</span>]);
bv.truncate(<span class="number">2</span>);
<span class="macro">assert!</span>(bv.eq_vec(<span class="kw-2">&amp;</span>[<span class="bool-val">false</span>, <span class="bool-val">true</span>]));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.reserve" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1195-1201">source</a><h4 class="code-header">pub fn <a href="#method.reserve" class="fnname">reserve</a>(&amp;mut self, additional: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</h4></section></summary><div class="docblock"><p>Reserves capacity for at least <code>additional</code> more bits to be inserted in the given
<code>BitVec</code>. The collection may reserve more space to avoid frequent reallocations.</p>
<h5 id="panics-12"><a href="#panics-12">Panics</a></h5>
<p>Panics if the new capacity overflows <code>usize</code>.</p>
<h5 id="examples-27"><a href="#examples-27">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span><span class="kw-2">mut </span>bv = BitVec::from_elem(<span class="number">3</span>, <span class="bool-val">false</span>);
bv.reserve(<span class="number">10</span>);
<span class="macro">assert_eq!</span>(bv.len(), <span class="number">3</span>);
<span class="macro">assert!</span>(bv.capacity() &gt;= <span class="number">13</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.reserve_exact" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1225-1231">source</a><h4 class="code-header">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>)</h4></section></summary><div class="docblock"><p>Reserves the minimum capacity for exactly <code>additional</code> more bits to be inserted in the
given <code>BitVec</code>. Does nothing if the capacity is already sufficient.</p>
<p>Note that the allocator may give the collection more space than it requests. Therefore
capacity can not be relied upon to be precisely minimal. Prefer <code>reserve</code> if future
insertions are expected.</p>
<h5 id="panics-13"><a href="#panics-13">Panics</a></h5>
<p>Panics if the new capacity overflows <code>usize</code>.</p>
<h5 id="examples-28"><a href="#examples-28">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span><span class="kw-2">mut </span>bv = BitVec::from_elem(<span class="number">3</span>, <span class="bool-val">false</span>);
bv.reserve(<span class="number">10</span>);
<span class="macro">assert_eq!</span>(bv.len(), <span class="number">3</span>);
<span class="macro">assert!</span>(bv.capacity() &gt;= <span class="number">13</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.capacity" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1246-1248">source</a><h4 class="code-header">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></h4></section></summary><div class="docblock"><p>Returns the capacity in bits for this bit vector. Inserting any
element less than this amount will not trigger a resizing.</p>
<h5 id="examples-29"><a href="#examples-29">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span><span class="kw-2">mut </span>bv = BitVec::new();
bv.reserve(<span class="number">10</span>);
<span class="macro">assert!</span>(bv.capacity() &gt;= <span class="number">10</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.grow" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1266-1305">source</a><h4 class="code-header">pub fn <a href="#method.grow" class="fnname">grow</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>)</h4></section></summary><div class="docblock"><p>Grows the <code>BitVec</code> in-place, adding <code>n</code> copies of <code>value</code> to the <code>BitVec</code>.</p>
<h5 id="panics-14"><a href="#panics-14">Panics</a></h5>
<p>Panics if the new len overflows a <code>usize</code>.</p>
<h5 id="examples-30"><a href="#examples-30">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span><span class="kw-2">mut </span>bv = BitVec::from_bytes(<span class="kw-2">&amp;</span>[<span class="number">0b01001011</span>]);
bv.grow(<span class="number">2</span>, <span class="bool-val">true</span>);
<span class="macro">assert_eq!</span>(bv.len(), <span class="number">10</span>);
<span class="macro">assert_eq!</span>(bv.to_bytes(), [<span class="number">0b01001011</span>, <span class="number">0b11000000</span>]);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.pop" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1320-1337">source</a><h4 class="code-header">pub fn <a href="#method.pop" class="fnname">pop</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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;</h4></section></summary><div class="docblock"><p>Removes the last bit from the BitVec, and returns it. Returns None if the BitVec is empty.</p>
<h5 id="examples-31"><a href="#examples-31">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span><span class="kw-2">mut </span>bv = BitVec::from_bytes(<span class="kw-2">&amp;</span>[<span class="number">0b01001001</span>]);
<span class="macro">assert_eq!</span>(bv.pop(), <span class="prelude-val">Some</span>(<span class="bool-val">true</span>));
<span class="macro">assert_eq!</span>(bv.pop(), <span class="prelude-val">Some</span>(<span class="bool-val">false</span>));
<span class="macro">assert_eq!</span>(bv.len(), <span class="number">6</span>);</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.push" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1352-1359">source</a><h4 class="code-header">pub fn <a href="#method.push" class="fnname">push</a>(&amp;mut self, elem: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>)</h4></section></summary><div class="docblock"><p>Pushes a <code>bool</code> onto the end.</p>
<h5 id="examples-32"><a href="#examples-32">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bit_vec::BitVec;
<span class="kw">let </span><span class="kw-2">mut </span>bv = BitVec::new();
bv.push(<span class="bool-val">true</span>);
bv.push(<span class="bool-val">false</span>);
<span class="macro">assert!</span>(bv.eq_vec(<span class="kw-2">&amp;</span>[<span class="bool-val">true</span>, <span class="bool-val">false</span>]));</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.len" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1363">source</a><h4 class="code-header">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></h4></section></summary><div class="docblock"><p>Returns the total number of bits in this vector</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.set_len" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1369-1371">source</a><h4 class="code-header">pub unsafe fn <a href="#method.set_len" class="fnname">set_len</a>(&amp;mut self, len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</h4></section></summary><div class="docblock"><p>Sets the number of bits that this BitVec considers initialized.</p>
<p>Almost certainly can cause bad stuff. Only really intended for BitSet.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_empty" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1375">source</a><h4 class="code-header">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></h4></section></summary><div class="docblock"><p>Returns true if there are no bits in this vector</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clear" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1379-1382">source</a><h4 class="code-header">pub fn <a href="#method.clear" class="fnname">clear</a>(&amp;mut self)</h4></section></summary><div class="docblock"><p>Clears all bits in this vector.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.shrink_to_fit" class="method has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1390-1392">source</a><h4 class="code-header">pub fn <a href="#method.shrink_to_fit" class="fnname">shrink_to_fit</a>(&amp;mut self)</h4></section></summary><div class="docblock"><p>Shrinks the capacity of the underlying storage as much as
possible.</p>
<p>It will drop down as close as possible to the length but the
allocator may still inform the underlying storage that there
is space for a few more elements/bits.</p>
</div></details></div></details></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Clone-for-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1422-1435">source</a><a href="#impl-Clone-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;B:&nbsp;<a class="trait" href="trait.BitBlock.html" title="trait bit_vec::BitBlock">BitBlock</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1424-1427">source</a><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; Self</h4></section></summary><div class='docblock'>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1430-1434">source</a><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Debug-for-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1465-1473">source</a><a href="#impl-Debug-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;B:&nbsp;<a class="trait" href="trait.BitBlock.html" title="trait bit_vec::BitBlock">BitBlock</a>&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="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1466-1472">source</a><a href="#method.fmt" class="anchor"></a><h4 class="code-header">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>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Default-for-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1395-1398">source</a><a href="#impl-Default-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;B:&nbsp;<a class="trait" href="trait.BitBlock.html" title="trait bit_vec::BitBlock">BitBlock</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.default" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1397">source</a><a href="#method.default" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default" class="fnname">default</a>() -&gt; Self</h4></section></summary><div class='docblock'>Returns the “default value” for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Extend%3Cbool%3E-for-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1409-1420">source</a><a href="#impl-Extend%3Cbool%3E-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;B:&nbsp;<a class="trait" href="trait.BitBlock.html" title="trait bit_vec::BitBlock">BitBlock</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html" title="trait core::iter::traits::collect::Extend">Extend</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt; for <a class="struct" href="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.extend" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1411-1419">source</a><a href="#method.extend" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html#tymethod.extend" class="fnname">extend</a>&lt;I:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;&gt;(&amp;mut self, iterable: I)</h4></section></summary><div class='docblock'>Extends a collection with the contents of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html#tymethod.extend">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.extend_one" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/collect.rs.html#372">source</a><a href="#method.extend_one" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html#method.extend_one" class="fnname">extend_one</a>(&amp;mut self, item: A)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>extend_one</code>)</span></div></span><div class='docblock'>Extends a collection with exactly one element.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.extend_reserve" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/collect.rs.html#380">source</a><a href="#method.extend_reserve" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html#method.extend_reserve" class="fnname">extend_reserve</a>(&amp;mut self, additional: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>extend_one</code>)</span></div></span><div class='docblock'>Reserves capacity in a collection for the given number of additional elements. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html#method.extend_reserve">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-FromIterator%3Cbool%3E-for-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1400-1407">source</a><a href="#impl-FromIterator%3Cbool%3E-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;B:&nbsp;<a class="trait" href="trait.BitBlock.html" title="trait bit_vec::BitBlock">BitBlock</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html" title="trait core::iter::traits::collect::FromIterator">FromIterator</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt; for <a class="struct" href="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_iter" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1402-1406">source</a><a href="#method.from_iter" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html#tymethod.from_iter" class="fnname">from_iter</a>&lt;I:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;&gt;(iter: I) -&gt; Self</h4></section></summary><div class='docblock'>Creates a value from an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html#tymethod.from_iter">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Hash-for-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1475-1484">source</a><a href="#impl-Hash-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;B:&nbsp;<a class="trait" href="trait.BitBlock.html" title="trait bit_vec::BitBlock">BitBlock</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="struct" href="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.hash" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1477-1483">source</a><a href="#method.hash" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash" class="fnname">hash</a>&lt;H:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>&gt;(&amp;self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>H)</h4></section></summary><div class='docblock'>Feeds this value into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.hash_slice" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#237-239">source</a></span><a href="#method.hash_slice" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice" class="fnname">hash_slice</a>&lt;H&gt;(data: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>H)<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>,</span></h4></section></summary><div class='docblock'>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Index%3Cusize%3E-for-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#220-231">source</a><a href="#impl-Index%3Cusize%3E-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;B:&nbsp;<a class="trait" href="trait.BitBlock.html" title="trait bit_vec::BitBlock">BitBlock</a>&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;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt; for <a class="struct" href="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Output" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Output" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/ops/index/trait.Index.html#associatedtype.Output" class="associatedtype">Output</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>The returned type after indexing.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.index" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#224-230">source</a><a href="#method.index" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/ops/index/trait.Index.html#tymethod.index" class="fnname">index</a>(&amp;self, i: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Performs the indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/nightly/core/ops/index/trait.Index.html#tymethod.index">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-IntoIterator-for-%26%27a%20BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1531-1539">source</a><a href="#impl-IntoIterator-for-%26%27a%20BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;'a, B:&nbsp;<a class="trait" href="trait.BitBlock.html" title="trait bit_vec::BitBlock">BitBlock</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a> for &amp;'a <a class="struct" href="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Item" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Item" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>The type of the elements being iterated over.</div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.IntoIter" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.IntoIter" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" class="associatedtype">IntoIter</a> = <a class="struct" href="struct.Iter.html" title="struct bit_vec::Iter">Iter</a>&lt;'a, B&gt;</h4></section></summary><div class='docblock'>Which kind of iterator are we turning this into?</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into_iter" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1536-1538">source</a><a href="#method.into_iter" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter" class="fnname">into_iter</a>(self) -&gt; <a class="struct" href="struct.Iter.html" title="struct bit_vec::Iter">Iter</a>&lt;'a, B&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Iter.html" title="struct bit_vec::Iter">Iter</a>&lt;'a, B&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;'a, B:&nbsp;<a class="trait" href="trait.BitBlock.html" title="trait bit_vec::BitBlock">BitBlock</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.Iter.html" title="struct bit_vec::Iter">Iter</a>&lt;'a, B&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>;</span></code></span></span></span></span></h4></section></summary><div class='docblock'>Creates an iterator from a value. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-IntoIterator-for-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1564-1573">source</a><a href="#impl-IntoIterator-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;B:&nbsp;<a class="trait" href="trait.BitBlock.html" title="trait bit_vec::BitBlock">BitBlock</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a> for <a class="struct" href="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Item-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Item-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>The type of the elements being iterated over.</div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.IntoIter-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.IntoIter-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" class="associatedtype">IntoIter</a> = <a class="struct" href="struct.IntoIter.html" title="struct bit_vec::IntoIter">IntoIter</a>&lt;B&gt;</h4></section></summary><div class='docblock'>Which kind of iterator are we turning this into?</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into_iter-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1569-1572">source</a><a href="#method.into_iter-1" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter" class="fnname">into_iter</a>(self) -&gt; <a class="struct" href="struct.IntoIter.html" title="struct bit_vec::IntoIter">IntoIter</a>&lt;B&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.IntoIter.html" title="struct bit_vec::IntoIter">IntoIter</a>&lt;B&gt;</span><code class="content"><span class="where fmt-newline">impl&lt;B:&nbsp;<a class="trait" href="trait.BitBlock.html" title="trait bit_vec::BitBlock">BitBlock</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.IntoIter.html" title="struct bit_vec::IntoIter">IntoIter</a>&lt;B&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>;</span></code></span></span></span></span></h4></section></summary><div class='docblock'>Creates an iterator from a value. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Ord-for-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1444-1463">source</a><a href="#impl-Ord-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;B:&nbsp;<a class="trait" href="trait.BitBlock.html" title="trait bit_vec::BitBlock">BitBlock</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cmp" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1446-1462">source</a><a href="#method.cmp" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp" class="fnname">cmp</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></h4></section></summary><div class='docblock'>This method returns an <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.max" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#795-798">source</a></span><a href="#method.max" class="anchor"></a><h4 class="code-header">const fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max" class="fnname">max</a>(self, other: Self) -&gt; Self</h4></section></summary><div class='docblock'>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.min" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#822-825">source</a></span><a href="#method.min" class="anchor"></a><h4 class="code-header">const fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min" class="fnname">min</a>(self, other: Self) -&gt; Self</h4></section></summary><div class='docblock'>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clamp" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#854-858">source</a></span><a href="#method.clamp" class="anchor"></a><h4 class="code-header">const fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp" class="fnname">clamp</a>(self, min: Self, max: Self) -&gt; Self<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;Self&gt;,</span></h4></section></summary><div class='docblock'>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CBitVec%3CB%3E%3E-for-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1486-1496">source</a><a href="#impl-PartialEq%3CBitVec%3CB%3E%3E-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;B:&nbsp;<a class="trait" href="trait.BitBlock.html" title="trait bit_vec::BitBlock">BitBlock</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;&gt; for <a class="struct" href="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1488-1495">source</a><a href="#method.eq" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fnname">eq</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.ne" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#227">source</a></span><a href="#method.ne" class="anchor"></a><h4 class="code-header">const fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fnname">ne</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-PartialOrd%3CBitVec%3CB%3E%3E-for-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1437-1442">source</a><a href="#impl-PartialOrd%3CBitVec%3CB%3E%3E-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;B:&nbsp;<a class="trait" href="trait.BitBlock.html" title="trait bit_vec::BitBlock">BitBlock</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;<a class="struct" href="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;&gt; for <a class="struct" href="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.partial_cmp" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1439-1441">source</a><a href="#method.partial_cmp" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp" class="fnname">partial_cmp</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>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="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>&gt;</h4></section></summary><div class='docblock'>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.lt" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1119">source</a></span><a href="#method.lt" class="anchor"></a><h4 class="code-header">const fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt" class="fnname">lt</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.le" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1138">source</a></span><a href="#method.le" class="anchor"></a><h4 class="code-header">const fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le" class="fnname">le</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code>
operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.gt" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1156">source</a></span><a href="#method.gt" class="anchor"></a><h4 class="code-header">const fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt" class="fnname">gt</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.ge" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#1175">source</a></span><a href="#method.ge" class="anchor"></a><h4 class="code-header">const fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge" class="fnname">ge</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code>
operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></div></details></div></details><section id="impl-Eq-for-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/bit_vec/lib.rs.html#1498">source</a><a href="#impl-Eq-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;B:&nbsp;<a class="trait" href="trait.BitBlock.html" title="trait bit_vec::BitBlock">BitBlock</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;</h3></section></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"><section id="impl-RefUnwindSafe-for-BitVec%3CB%3E" class="impl has-srclink"><a href="#impl-RefUnwindSafe-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;B&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,</span></h3></section><section id="impl-Send-for-BitVec%3CB%3E" class="impl has-srclink"><a href="#impl-Send-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;B&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="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,</span></h3></section><section id="impl-Sync-for-BitVec%3CB%3E" class="impl has-srclink"><a href="#impl-Sync-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;B&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="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,</span></h3></section><section id="impl-Unpin-for-BitVec%3CB%3E" class="impl has-srclink"><a href="#impl-Unpin-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;B&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</span></h3></section><section id="impl-UnwindSafe-for-BitVec%3CB%3E" class="impl has-srclink"><a href="#impl-UnwindSafe-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;B&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.BitVec.html" title="struct bit_vec::BitVec">BitVec</a>&lt;B&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a>,</span></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any-for-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#200">source</a><a href="#impl-Any-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#201">source</a><a href="#method.type_id" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a><a href="#impl-Borrow%3CT%3E-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T<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.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213">source</a></span><a href="#method.borrow" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220">source</a><a href="#impl-BorrowMut%3CT%3E-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T<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.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221">source</a></span><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#733">source</a><a href="#impl-From%3CT%3E-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#736">source</a></span><a href="#method.from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#717">source</a><a href="#impl-Into%3CU%3E-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#725">source</a></span><a href="#method.into" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code><a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="From">From</a>&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-ToOwned-for-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#83">source</a><a href="#impl-ToOwned-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Owned" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#88">source</a><a href="#method.to_owned" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#92">source</a><a href="#method.clone_into" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#775">source</a><a href="#impl-TryFrom%3CU%3E-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#781">source</a></span><a href="#method.try_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-BitVec%3CB%3E" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#760">source</a><a href="#impl-TryInto%3CU%3E-for-BitVec%3CB%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#766">source</a></span><a href="#method.try_into" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="bit_vec" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>