mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-18 14:00:39 +00:00
Deploying to gh-pages from @ GreptimeTeam/greptimedb@0572a680af 🚀
This commit is contained in:
1
common_base/bit_vec/index.html
Normal file
1
common_base/bit_vec/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `bit_vec` mod in crate `common_base`."><title>common_base::bit_vec - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="common_base" data-themes="" data-resource-suffix="" data-rustdoc-version="1.92.0-nightly (fa3155a64 2025-09-30)" data-channel="nightly" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-828709d0.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-ce535bd0.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module bit_vec</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../common_base/index.html">common_<wbr>base</a><span class="version">1.0.0-rc.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module bit_vec</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate common_<wbr>base</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">common_base</a></div><h1>Module <span>bit_vec</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/common_base/bit_vec.rs.html#15-19">Source</a> </span></div><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="prelude/index.html" title="mod common_base::bit_vec::prelude">prelude</a></dt><dd>Symbol Export</dd></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.BitVec.html" title="type common_base::bit_vec::BitVec">BitVec</a></dt></dl></section></div></main></body></html>
|
||||
8
common_base/bit_vec/prelude/index.html
Normal file
8
common_base/bit_vec/prelude/index.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<!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="Symbol Export"><title>common_base::bit_vec::prelude - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="common_base" data-themes="" data-resource-suffix="" data-rustdoc-version="1.92.0-nightly (fa3155a64 2025-09-30)" data-channel="nightly" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-828709d0.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-ce535bd0.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module prelude</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../common_base/index.html">common_<wbr>base</a><span class="version">1.0.0-rc.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module prelude</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#symbol-export" title="Symbol Export">Symbol Export</a></li></ul><h3><a href="#macros">Module Items</a></h3><ul class="block"><li><a href="#macros" title="Macros">Macros</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In common_<wbr>base::<wbr>bit_<wbr>vec</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">common_base</a>::<wbr><a href="../index.html">bit_vec</a></div><h1>Module <span>prelude</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><h2 id="symbol-export"><a class="doc-anchor" href="#symbol-export">§</a>Symbol Export</h2>
|
||||
<p>This module collects the general public API into a single place for bulk import,
|
||||
as <code>use bitvec::prelude::*;</code>, without polluting the root namespace of the crate.</p>
|
||||
<p>This provides all the data structure types and macros, as well as the two traits
|
||||
needed to operate them as type parameters, by name. It also imports extension
|
||||
traits without naming them, so that their methods are available but their trait
|
||||
names are not.</p>
|
||||
</div></details><h2 id="macros" class="section-header">Macros<a href="#macros" class="anchor">§</a></h2><dl class="item-table"><dt><a class="macro" href="macro.BitArr.html" title="macro common_base::bit_vec::prelude::BitArr">BitArr</a></dt><dd>Bit-Array Type Definition</dd><dt><a class="macro" href="macro.bitarr.html" title="macro common_base::bit_vec::prelude::bitarr">bitarr</a></dt><dd>Bit-Array Value Constructor</dd><dt><a class="macro" href="macro.bitbox.html" title="macro common_base::bit_vec::prelude::bitbox">bitbox</a></dt><dd>Boxed Bit-Slice Constructor</dd><dt><a class="macro" href="macro.bits.html" title="macro common_base::bit_vec::prelude::bits">bits</a></dt><dd>Bit-Slice Region Constructor</dd><dt><a class="macro" href="macro.bitvec.html" title="macro common_base::bit_vec::prelude::bitvec">bitvec</a></dt><dd>Bit-Vector Constructor</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.BitArray.html" title="struct common_base::bit_vec::prelude::BitArray">BitArray</a></dt><dd>Bit-Precision Array Immediate</dd><dt><a class="struct" href="struct.BitBox.html" title="struct common_base::bit_vec::prelude::BitBox">BitBox</a></dt><dd>Fixed-Size, Heap-Allocated, Bit Slice</dd><dt><a class="struct" href="struct.BitPtr.html" title="struct common_base::bit_vec::prelude::BitPtr">BitPtr</a></dt><dd>Single-Bit Pointer</dd><dt><a class="struct" href="struct.BitPtrRange.html" title="struct common_base::bit_vec::prelude::BitPtrRange">BitPtr<wbr>Range</a></dt><dd>Bit-Pointer Range</dd><dt><a class="struct" href="struct.BitRef.html" title="struct common_base::bit_vec::prelude::BitRef">BitRef</a></dt><dd>Proxy Bit-Reference</dd><dt><a class="struct" href="struct.BitSlice.html" title="struct common_base::bit_vec::prelude::BitSlice">BitSlice</a></dt><dd>Bit-Addressable Memory</dd><dt><a class="struct" href="struct.BitVec.html" title="struct common_base::bit_vec::prelude::BitVec">BitVec</a></dt><dd>Bit-Precision Dynamic Array</dd><dt><a class="struct" href="struct.LocalBits.html" title="struct common_base::bit_vec::prelude::LocalBits">Local<wbr>Bits</a></dt><dd>Least-Significant-First Bit Traversal</dd><dt><a class="struct" href="struct.Lsb0.html" title="struct common_base::bit_vec::prelude::Lsb0">Lsb0</a></dt><dd>Least-Significant-First Bit Traversal</dd><dt><a class="struct" href="struct.Msb0.html" title="struct common_base::bit_vec::prelude::Msb0">Msb0</a></dt><dd>Most-Significant-First Bit Traversal</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.AsBits.html" title="trait common_base::bit_vec::prelude::AsBits">AsBits</a></dt><dd>Immutable Bit View</dd><dt><a class="trait" href="trait.AsMutBits.html" title="trait common_base::bit_vec::prelude::AsMutBits">AsMut<wbr>Bits</a></dt><dd>Mutable Bit View</dd><dt><a class="trait" href="trait.BitOrder.html" title="trait common_base::bit_vec::prelude::BitOrder">BitOrder</a></dt><dd>In-Element Bit Ordering</dd><dt><a class="trait" href="trait.BitStore.html" title="trait common_base::bit_vec::prelude::BitStore">BitStore</a></dt><dd>Bit Storage</dd><dt><a class="trait" href="trait._.html" title="trait common_base::bit_vec::prelude::_">_</a></dt><dd>C-Style Bit-Field Access</dd><dt><a class="trait" href="trait._.html" title="trait common_base::bit_vec::prelude::_">_</a></dt><dd>Bit View</dd><dt><a class="trait" href="trait._.html" title="trait common_base::bit_vec::prelude::_">_</a></dt><dd>Helper trait for scalars and arrays, but not slices.</dd></dl></section></div></main></body></html>
|
||||
11
common_base/bit_vec/prelude/macro.BitArr!.html
Normal file
11
common_base/bit_vec/prelude/macro.BitArr!.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=macro.BitArr.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="macro.BitArr.html">macro.BitArr.html</a>...</p>
|
||||
<script>location.replace("macro.BitArr.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
30
common_base/bit_vec/prelude/macro.BitArr.html
Normal file
30
common_base/bit_vec/prelude/macro.BitArr.html
Normal file
@@ -0,0 +1,30 @@
|
||||
<!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="Bit-Array Type Definition"><title>BitArr in common_base::bit_vec::prelude - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="common_base" data-themes="" data-resource-suffix="" data-rustdoc-version="1.92.0-nightly (fa3155a64 2025-09-30)" data-channel="nightly" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-828709d0.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-ce535bd0.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">BitArr</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../common_base/index.html">common_<wbr>base</a><span class="version">1.0.0-rc.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">BitArr</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#bit-array-type-definition" title="Bit-Array Type Definition">Bit-Array Type Definition</a><ul><li><a href="#examples" title="Examples">Examples</a></li></ul></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In common_<wbr>base::<wbr>bit_<wbr>vec::<wbr>prelude</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">common_base</a>::<wbr><a href="../index.html">bit_vec</a>::<wbr><a href="index.html">prelude</a></div><h1>Macro <span class="macro">BitArr</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>macro_rules! BitArr {
|
||||
(for $len:expr, in $store:ty, $order:ty $(,)?) => { ... };
|
||||
(for $len:expr, in $store:ty $(,)?) => { ... };
|
||||
(for $len:expr) => { ... };
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><h2 id="bit-array-type-definition"><a class="doc-anchor" href="#bit-array-type-definition">§</a>Bit-Array Type Definition</h2>
|
||||
<p>Because <code>BitArray<T, O, const BITS: usize></code> is not expressible in stable Rust,
|
||||
this macro serves the purpose of creating a type definition that expands to a
|
||||
suitable <code>BitArray</code>. It creates the correct, rounded-up, <code>BitArray</code> to hold a
|
||||
requested number of bits in a requested set of ordering/storage parameters.</p>
|
||||
<p>The macro takes a minimum number of bits to store, and an optional set of
|
||||
bit-order and bit-store type names, and creates a <code>BitArray</code> that satisfies the
|
||||
request. As this macro is only usable in type position, it is named with
|
||||
<code>PascalCase</code> rather than <code>snake_case</code>.</p>
|
||||
<h3 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h3>
|
||||
<p>You must provide a bit-count; you may optionally provide a storage type, or a
|
||||
bit-ordering <em>and</em> a storage type, as subsequent arguments. When elided, the
|
||||
type parameters are set to the crate defaut type parameters of <code>Lsb0</code> and
|
||||
<code>usize</code>.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bitvec::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">use </span>core::cell::Cell;
|
||||
|
||||
<span class="kw">let </span>a: <span class="macro">BitArr!</span>(<span class="kw">for </span><span class="number">100</span>) = BitArray::ZERO;
|
||||
<span class="kw">let </span>b: <span class="macro">BitArr!</span>(<span class="kw">for </span><span class="number">100</span>, <span class="kw">in </span>u32) = BitArray::<<span class="kw">_</span>>::ZERO;
|
||||
<span class="kw">let </span>c: <span class="macro">BitArr!</span>(<span class="kw">for </span><span class="number">100</span>, <span class="kw">in </span>Cell<u16>, Msb0) = BitArray::<<span class="kw">_</span>, <span class="kw">_</span>>::ZERO;</code></pre></div>
|
||||
<p>The length expression must be <code>const</code>. It may be a literal, a named <code>const</code>
|
||||
item, or a <code>const</code> expression, as long as it evaluates to a <code>usize</code>. The type
|
||||
arguments have no restrictions, as long as they are in-scope at the invocation
|
||||
site and are implementors of <a href="trait.BitOrder.html" title="trait common_base::bit_vec::prelude::BitOrder"><code>BitOrder</code></a> and <a href="trait.BitStore.html" title="trait common_base::bit_vec::prelude::BitStore"><code>BitStore</code></a>.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
11
common_base/bit_vec/prelude/macro.bitarr!.html
Normal file
11
common_base/bit_vec/prelude/macro.bitarr!.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=macro.bitarr.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="macro.bitarr.html">macro.bitarr.html</a>...</p>
|
||||
<script>location.replace("macro.bitarr.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
68
common_base/bit_vec/prelude/macro.bitarr.html
Normal file
68
common_base/bit_vec/prelude/macro.bitarr.html
Normal file
@@ -0,0 +1,68 @@
|
||||
<!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="Bit-Array Value Constructor"><title>bitarr in common_base::bit_vec::prelude - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="common_base" data-themes="" data-resource-suffix="" data-rustdoc-version="1.92.0-nightly (fa3155a64 2025-09-30)" data-channel="nightly" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-828709d0.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-ce535bd0.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">bitarr</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../common_base/index.html">common_<wbr>base</a><span class="version">1.0.0-rc.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">bitarr</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#bit-array-value-constructor" title="Bit-Array Value Constructor">Bit-Array Value Constructor</a><ul><li><a href="#argument-syntax" title="Argument Syntax">Argument Syntax</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In common_<wbr>base::<wbr>bit_<wbr>vec::<wbr>prelude</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">common_base</a>::<wbr><a href="../index.html">bit_vec</a>::<wbr><a href="index.html">prelude</a></div><h1>Macro <span class="macro">bitarr</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>macro_rules! bitarr {
|
||||
(const Cell<$store:ident>, $order:ident; $($val:expr),* $(,)?) => { ... };
|
||||
(const $store:ident, $order:ident; $($val:expr),* $(,)?) => { ... };
|
||||
(const $store:ty, $order:ty; $val:expr; $len:expr) => { ... };
|
||||
(const $val:expr; $len:expr) => { ... };
|
||||
(const $($val:expr),* $(,)?) => { ... };
|
||||
(Cell<$store:ident>, $order:ident; $($val:expr),* $(,)?) => { ... };
|
||||
(Cell<$store:ident>, $order:path; $($val:expr),* $(,)?) => { ... };
|
||||
($store:ident, $order:ident; $($val:expr),* $(,)?) => { ... };
|
||||
($store:ident, $order:path; $($val:expr),* $(,)?) => { ... };
|
||||
($store:ty, $order:ty; $val:expr; $len:expr) => { ... };
|
||||
($val:expr; $len:expr) => { ... };
|
||||
($($val:expr),* $(,)?) => { ... };
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><h2 id="bit-array-value-constructor"><a class="doc-anchor" href="#bit-array-value-constructor">§</a>Bit-Array Value Constructor</h2>
|
||||
<p>This macro provides a bit-initializer syntax for <a href="struct.BitArray.html" title="struct common_base::bit_vec::prelude::BitArray"><code>BitArray</code></a> values. It takes a
|
||||
superset of the <a href="https://doc.rust-lang.org/nightly/alloc/macro.vec.html" title="macro alloc::vec"><code>vec!</code></a> arguments, and is capable of producing bit-arrays in
|
||||
<code>const</code> contexts (for known type parameters).</p>
|
||||
<p>Like <code>vec!</code>, it can accept a sequence of comma-separated bit values, or a
|
||||
semicolon-separated pair of a bit value and a repetition counter. Bit values may
|
||||
be any integer or name of a <code>const</code> integer, but <em>should</em> only be <code>0</code> or <code>1</code>.</p>
|
||||
<h3 id="argument-syntax"><a class="doc-anchor" href="#argument-syntax">§</a>Argument Syntax</h3>
|
||||
<p>It accepts zero, one, or three prefix arguments:</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p><code>const</code>: If the first argument to the macro is the keyword <code>const</code>, separated
|
||||
from remaining arguments by a space, then the macro expands to a
|
||||
<code>const</code>-expression that can be used in any appropriate context (initializing
|
||||
a <code>static</code>, a <code>const</code>, or passed to a <code>const fn</code>). This only works when the
|
||||
bit-ordering argument is either implicit, or one of the three tokens that
|
||||
<code>bitvec</code> can recognize.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>$order ,</code>: When this is one of the three literal tokens <code>LocalBits</code>, <code>Lsb0</code>,
|
||||
or <code>Msb0</code>, then the macro is able to compute the encoded bit-array contents at
|
||||
compile time, including in <code>const</code> contexts. When it is anything else, the
|
||||
encoding must take place at runtime. The name or path chosen must be in scope
|
||||
at the macro invocation site.</p>
|
||||
<p>When not provided, this defaults to <code>Lbs0</code>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>$store ;</code>: This must be one of <code>uTYPE</code>, <code>Cell<uTYPE></code>, <code>AtomicUTYPE</code>, or
|
||||
<code>RadiumUTYPE</code> where <code>TYPE</code> is one of <code>8</code>, <code>16</code>, <code>32</code>, <code>64</code>, or <code>size</code>. The
|
||||
macro recognizes this token textually, and does not have access to the type
|
||||
system resolver, so it will not accept aliases or qualified paths.</p>
|
||||
<p>When not provided, this defaults to <code>usize</code>.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>The <code>const</code> argument can be present or absent independently of the
|
||||
type-parameter pair. The pair must be either both absent or both present
|
||||
together.</p>
|
||||
<blockquote>
|
||||
<p>Previous versions of <code>bitvec</code> supported <code>$order</code>-only arguments. This has been
|
||||
removed for clarity of use and ease of implementation.</p>
|
||||
</blockquote>
|
||||
<h3 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h3>
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bitvec::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">use </span>core::{cell::Cell, mem};
|
||||
<span class="kw">use </span>radium::types::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="kw">let </span>a: BitArray = <span class="macro">bitarr!</span>[<span class="number">0</span>, <span class="number">1</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>];
|
||||
|
||||
<span class="kw">let </span>b: BitArray = <span class="macro">bitarr!</span>[<span class="number">1</span>; <span class="number">5</span>];
|
||||
<span class="macro">assert_eq!</span>(b.len(), mem::size_of::<usize>() * <span class="number">8</span>);
|
||||
|
||||
<span class="kw">let </span>c = <span class="macro">bitarr!</span>[u16, Lsb0; <span class="number">0</span>, <span class="number">1</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>];
|
||||
<span class="kw">let </span>d = <span class="macro">bitarr!</span>[Cell<u16>, Msb0; <span class="number">1</span>; <span class="number">10</span>];
|
||||
<span class="kw">const </span>E: BitArray<[u32; <span class="number">1</span>], LocalBits> = <span class="macro">bitarr!</span>[u32, LocalBits; <span class="number">1</span>; <span class="number">15</span>];
|
||||
<span class="kw">let </span>f = <span class="macro">bitarr!</span>[RadiumU32, Msb0; <span class="number">1</span>; <span class="number">20</span>];</code></pre></div></div></details></section></div></main></body></html>
|
||||
11
common_base/bit_vec/prelude/macro.bitbox!.html
Normal file
11
common_base/bit_vec/prelude/macro.bitbox!.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=macro.bitbox.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="macro.bitbox.html">macro.bitbox.html</a>...</p>
|
||||
<script>location.replace("macro.bitbox.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
8
common_base/bit_vec/prelude/macro.bitbox.html
Normal file
8
common_base/bit_vec/prelude/macro.bitbox.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<!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="Boxed Bit-Slice Constructor"><title>bitbox in common_base::bit_vec::prelude - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="common_base" data-themes="" data-resource-suffix="" data-rustdoc-version="1.92.0-nightly (fa3155a64 2025-09-30)" data-channel="nightly" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-828709d0.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-ce535bd0.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">bitbox</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../common_base/index.html">common_<wbr>base</a><span class="version">1.0.0-rc.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">bitbox</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#boxed-bit-slice-constructor" title="Boxed Bit-Slice Constructor">Boxed Bit-Slice Constructor</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In common_<wbr>base::<wbr>bit_<wbr>vec::<wbr>prelude</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">common_base</a>::<wbr><a href="../index.html">bit_vec</a>::<wbr><a href="index.html">prelude</a></div><h1>Macro <span class="macro">bitbox</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>macro_rules! bitbox {
|
||||
($($arg:tt)*) => { ... };
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><h2 id="boxed-bit-slice-constructor"><a class="doc-anchor" href="#boxed-bit-slice-constructor">§</a>Boxed Bit-Slice Constructor</h2>
|
||||
<p>This macro creates encoded <code>BitSlice</code> buffers at compile-time, and at run-time
|
||||
copies them directly into a new heap allocation.</p>
|
||||
<p>It forwards all of its arguments to <a href="macro.bitvec.html" title="macro common_base::bit_vec::prelude::bitvec"><code>bitvec!</code></a>, and calls
|
||||
<a href="struct.BitVec.html#method.into_boxed_bitslice" title="method common_base::bit_vec::prelude::BitVec::into_boxed_bitslice"><code>BitVec::into_boxed_bitslice</code></a> on the produced <code>BitVec</code>.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
11
common_base/bit_vec/prelude/macro.bits!.html
Normal file
11
common_base/bit_vec/prelude/macro.bits!.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=macro.bits.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="macro.bits.html">macro.bits.html</a>...</p>
|
||||
<script>location.replace("macro.bits.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
113
common_base/bit_vec/prelude/macro.bits.html
Normal file
113
common_base/bit_vec/prelude/macro.bits.html
Normal file
@@ -0,0 +1,113 @@
|
||||
<!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="Bit-Slice Region Constructor"><title>bits in common_base::bit_vec::prelude - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="common_base" data-themes="" data-resource-suffix="" data-rustdoc-version="1.92.0-nightly (fa3155a64 2025-09-30)" data-channel="nightly" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-828709d0.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-ce535bd0.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">bits</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../common_base/index.html">common_<wbr>base</a><span class="version">1.0.0-rc.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">bits</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#bit-slice-region-constructor" title="Bit-Slice Region Constructor">Bit-Slice Region Constructor</a><ul><li><a href="#argument-syntax" title="Argument Syntax">Argument Syntax</a></li><li><a href="#safety" title="Safety">Safety</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In common_<wbr>base::<wbr>bit_<wbr>vec::<wbr>prelude</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">common_base</a>::<wbr><a href="../index.html">bit_vec</a>::<wbr><a href="index.html">prelude</a></div><h1>Macro <span class="macro">bits</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>macro_rules! bits {
|
||||
(static mut Cell<$store:ident>, $order:ty; $val:expr; $len:expr) => { ... };
|
||||
(static mut $store:ident, $order:ident; $val:expr; $len:expr) => { ... };
|
||||
(static mut Cell<$store:ident>, $order:ident; $($val:expr),* $(,)?) => { ... };
|
||||
(static mut $store:ident, $order:ident; $($val:expr),* $(,)?) => { ... };
|
||||
(static mut $val:expr; $len:expr) => { ... };
|
||||
(static mut $($val:expr),* $(,)?) => { ... };
|
||||
(static Cell<$store:ident>, $order:ty; $val:expr; $len:expr) => { ... };
|
||||
(static Cell<$store:ident>, $order:ident; $($val:expr),* $(,)?) => { ... };
|
||||
(static $store:ident, $order:ident; $val:expr; $len:expr) => { ... };
|
||||
(static $val:expr; $len:expr) => { ... };
|
||||
(static $store:ident, $order:ident; $($val:expr),* $(,)?) => { ... };
|
||||
(static $($val:expr),* $(,)?) => { ... };
|
||||
(mut Cell<$store:ident>, $order:ident; $($val:expr),* $(,)?) => { ... };
|
||||
(mut Cell<$store:ident>, $order:path; $($val:expr),* $(,)?) => { ... };
|
||||
(mut $store:ident, $order:ident; $($val:expr),* $(,)?) => { ... };
|
||||
(mut $store:ident, $order:path; $($val:expr),* $(,)?) => { ... };
|
||||
(mut $store:ty, $order:ty; $val:expr; $len:expr) => { ... };
|
||||
(mut $val:expr; $len:expr) => { ... };
|
||||
(mut $($val:expr),* $(,)?) => { ... };
|
||||
($store:ty, $order:ty; $val:expr; $len:expr) => { ... };
|
||||
(Cell<$store:ident>, $order:ident; $($val:expr),* $(,)?) => { ... };
|
||||
($store:ident, $order:ident; $($val:expr),* $(,)?) => { ... };
|
||||
(Cell<$store:ident>, $order:path; $($val:expr),* $(,)?) => { ... };
|
||||
($store:ident, $order:path; $($val:expr),* $(,)?) => { ... };
|
||||
($val:expr; $len:expr) => { ... };
|
||||
($($val:expr),* $(,)?) => { ... };
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><h2 id="bit-slice-region-constructor"><a class="doc-anchor" href="#bit-slice-region-constructor">§</a>Bit-Slice Region Constructor</h2>
|
||||
<p>This macro provides a bit-initializer syntax for <a href="struct.BitSlice.html" title="struct common_base::bit_vec::prelude::BitSlice"><code>BitSlice</code></a> reference values.
|
||||
It takes a superset of the <a href="https://doc.rust-lang.org/nightly/alloc/macro.vec.html" title="macro alloc::vec"><code>vec!</code></a> arguments, and is capable of producing
|
||||
bit-slices in <code>const</code> contexts (for known type parameters).</p>
|
||||
<p>Like <code>vec!</code>, it can accept a sequence of comma-separated bit values, or a
|
||||
semicolon-separated pair of a bit value and a repetition counter. Bit values may
|
||||
be any integer or name of a <code>const</code> integer, but <em>should</em> only be <code>0</code> or <code>1</code>.</p>
|
||||
<h3 id="argument-syntax"><a class="doc-anchor" href="#argument-syntax">§</a>Argument Syntax</h3>
|
||||
<p>It accepts two modifier prefixes, zero or two type parameters, and the bit
|
||||
expressions described above.</p>
|
||||
<p>The modifier prefixes are separated from the remaining arguments by clearspace.</p>
|
||||
<ul>
|
||||
<li><code>static</code>: If the first argument is the keyword <code>static</code>, then this produces a
|
||||
<code>&'static BitSlice</code> reference bound into a (hidden, unnameable)
|
||||
<code>static BitArray</code> item. If not, then it produces a stack temporary that the
|
||||
Rust compiler automatically extends to have the lifetime of the returned
|
||||
reference. Note that non-<code>static</code> invocations rely on the compiler’s escape
|
||||
analysis, and you should typically not try to move them up the call stack.</li>
|
||||
<li><code>mut</code>: If the first argument is the keyword <code>mut</code>, then this produces a <code>&mut</code>
|
||||
writable <code>BitSlice</code>.</li>
|
||||
<li><code>static mut</code>: These can be combined to create a <code>&'static mut BitSlice</code>. It is
|
||||
always safe to use this reference, because the <code>static mut BitArray</code> it
|
||||
creates is concealed and unreachable by any other codepath, and so the
|
||||
produced reference is always the sole handle that can reach it.</li>
|
||||
</ul>
|
||||
<p>The next possible arguments are a pair of <code>BitOrder</code>/<code>BitStore</code> type parameters.</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p><code>$order ,</code>: When this is one of the three literal tokens <code>LocalBits</code>, <code>Lsb0</code>,
|
||||
or <code>Msb0</code>, then the macro is able to compute the encoded bit-array contents at
|
||||
compile time, including in <code>const</code> contexts. When it is anything else, the
|
||||
encoding must take place at runtime. The name or path chosen must be in scope
|
||||
at the macro invocation site.</p>
|
||||
<p>When not provided, this defaults to <code>Lsb0</code>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>$store ;</code>: This must be one of <code>uTYPE</code>, <code>Cell<uTYPE></code>, <code>AtomicUTYPE</code>, or
|
||||
<code>RadiumUTYPE</code> where <code>TYPE</code> is one of <code>8</code>, <code>16</code>, <code>32</code>, <code>64</code>, or <code>size</code>. The
|
||||
macro recognizes this token textually, and does not have access to the type
|
||||
system resolver, so it will not accept aliases or qualified paths.</p>
|
||||
<p>When not provided, this defaults to <code>usize</code>.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>The <code>static</code>/<code>mut</code> modifiers may be individually present or absent independently
|
||||
of the type-parameter pair. The pair must be either both absent or both present
|
||||
together.</p>
|
||||
<blockquote>
|
||||
<p>Previous versions of <code>bitvec</code> supported $order`-only arguments. This has been
|
||||
removed for clarity of use and ease of implementation.</p>
|
||||
</blockquote>
|
||||
<h3 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h3>
|
||||
<p>Rust considers all <code>static mut</code> bindings to be <code>unsafe</code> to use. While <code>bits!</code>
|
||||
can prevent <em>some</em> of this unsafety by preventing direct access to the created
|
||||
<code>static mut</code> buffer, there are still ways to create multiple names referring to
|
||||
the same underlying buffer.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bitvec::prelude::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="kw">fn </span>unsound() -> <span class="kw-2">&</span><span class="lifetime">'static </span><span class="kw-2">mut </span>BitSlice<usize, Lsb0> {
|
||||
<span class="kw">unsafe </span>{ <span class="macro">bits!</span>[<span class="kw">static </span><span class="kw-2">mut </span><span class="number">0</span>; <span class="number">64</span>] }
|
||||
}
|
||||
|
||||
<span class="kw">let </span>a = unsound();
|
||||
<span class="kw">let </span>b = unsound();</code></pre></div>
|
||||
<p>The two names <code>a</code> and <code>b</code> can be used to produce aliasing <code>&mut [usize]</code>
|
||||
references.</p>
|
||||
<p><strong>You must not invoke <code>bits![static mut …]</code> in a context where it can be used</strong>
|
||||
<strong>to create multiple escaping names</strong>. This, and only this, argument combination
|
||||
of the macro produces a value that requires a call-site <code>unsafe</code> block to use.</p>
|
||||
<p>If you do not use this behavior to create multiple names over the same
|
||||
underlying buffer, then the macro’s expansion is safe to use, as <code>bitvec</code>’s
|
||||
existing alias-protection behavior suffices.</p>
|
||||
<h3 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h3>
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bitvec::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">use </span>core::cell::Cell;
|
||||
<span class="kw">use </span>radium::types::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="kw">let </span>a: <span class="kw-2">&</span>BitSlice = <span class="macro">bits!</span>[<span class="number">0</span>, <span class="number">1</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>];
|
||||
|
||||
<span class="kw">let </span>b: <span class="kw-2">&</span>BitSlice = <span class="macro">bits!</span>[<span class="number">1</span>; <span class="number">5</span>];
|
||||
<span class="macro">assert_eq!</span>(b.len(), <span class="number">5</span>);
|
||||
|
||||
<span class="kw">let </span>c = <span class="macro">bits!</span>[u16, Lsb0; <span class="number">0</span>, <span class="number">1</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>];
|
||||
<span class="kw">let </span>d = <span class="macro">bits!</span>[<span class="kw">static </span>Cell<u16>, Msb0; <span class="number">1</span>; <span class="number">10</span>];
|
||||
<span class="kw">let </span>e = <span class="kw">unsafe </span>{ <span class="macro">bits!</span>[<span class="kw">static </span><span class="kw-2">mut </span>u32, LocalBits; <span class="number">0</span>; <span class="number">15</span>] };
|
||||
<span class="kw">let </span>f = <span class="macro">bits!</span>[RadiumU32, Msb0; <span class="number">1</span>; <span class="number">20</span>];</code></pre></div></div></details></section></div></main></body></html>
|
||||
11
common_base/bit_vec/prelude/macro.bitvec!.html
Normal file
11
common_base/bit_vec/prelude/macro.bitvec!.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=macro.bitvec.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="macro.bitvec.html">macro.bitvec.html</a>...</p>
|
||||
<script>location.replace("macro.bitvec.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
13
common_base/bit_vec/prelude/macro.bitvec.html
Normal file
13
common_base/bit_vec/prelude/macro.bitvec.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!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="Bit-Vector Constructor"><title>bitvec in common_base::bit_vec::prelude - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="common_base" data-themes="" data-resource-suffix="" data-rustdoc-version="1.92.0-nightly (fa3155a64 2025-09-30)" data-channel="nightly" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-828709d0.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-ce535bd0.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">bitvec</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../common_base/index.html">common_<wbr>base</a><span class="version">1.0.0-rc.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">bitvec</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#bit-vector-constructor" title="Bit-Vector Constructor">Bit-Vector Constructor</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In common_<wbr>base::<wbr>bit_<wbr>vec::<wbr>prelude</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">common_base</a>::<wbr><a href="../index.html">bit_vec</a>::<wbr><a href="index.html">prelude</a></div><h1>Macro <span class="macro">bitvec</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>macro_rules! bitvec {
|
||||
($store:ty, $order:ty; $val:expr; $len:expr) => { ... };
|
||||
(Cell<$store:ident>, $order:ident $($rest:tt)*) => { ... };
|
||||
($val:expr; $len:expr) => { ... };
|
||||
($($arg:tt)*) => { ... };
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><h2 id="bit-vector-constructor"><a class="doc-anchor" href="#bit-vector-constructor">§</a>Bit-Vector Constructor</h2>
|
||||
<p>This macro creates encoded <code>BitSlice</code> buffers at compile-time, and at run-time
|
||||
copies them directly into a new heap allocation.</p>
|
||||
<p>It forwards all of its arguments to <a href="macro.bits.html" title="macro common_base::bit_vec::prelude::bits"><code>bits!</code></a>, and calls
|
||||
<a href="struct.BitVec.html#method.from_bitslice" title="associated function common_base::bit_vec::prelude::BitVec::from_bitslice"><code>BitVec::from_bitslice</code></a> on the produced <code>&BitSlice</code> expression. While you can
|
||||
use the <code>bits!</code> modifiers, there is no point, as the produced bit-slice is lost
|
||||
before the macro exits.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
1
common_base/bit_vec/prelude/sidebar-items.js
Normal file
1
common_base/bit_vec/prelude/sidebar-items.js
Normal file
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"macro":["BitArr","bitarr","bitbox","bits","bitvec"],"struct":["BitArray","BitBox","BitPtr","BitPtrRange","BitRef","BitSlice","BitVec","LocalBits","Lsb0","Msb0"],"trait":["AsBits","AsMutBits","BitOrder","BitStore","_"]};
|
||||
2118
common_base/bit_vec/prelude/struct.BitArray.html
Normal file
2118
common_base/bit_vec/prelude/struct.BitArray.html
Normal file
File diff suppressed because one or more lines are too long
2231
common_base/bit_vec/prelude/struct.BitBox.html
Normal file
2231
common_base/bit_vec/prelude/struct.BitBox.html
Normal file
File diff suppressed because one or more lines are too long
705
common_base/bit_vec/prelude/struct.BitPtr.html
Normal file
705
common_base/bit_vec/prelude/struct.BitPtr.html
Normal file
File diff suppressed because one or more lines are too long
465
common_base/bit_vec/prelude/struct.BitPtrRange.html
Normal file
465
common_base/bit_vec/prelude/struct.BitPtrRange.html
Normal file
File diff suppressed because one or more lines are too long
297
common_base/bit_vec/prelude/struct.BitRef.html
Normal file
297
common_base/bit_vec/prelude/struct.BitRef.html
Normal file
File diff suppressed because one or more lines are too long
3497
common_base/bit_vec/prelude/struct.BitSlice.html
Normal file
3497
common_base/bit_vec/prelude/struct.BitSlice.html
Normal file
File diff suppressed because one or more lines are too long
2856
common_base/bit_vec/prelude/struct.BitVec.html
Normal file
2856
common_base/bit_vec/prelude/struct.BitVec.html
Normal file
File diff suppressed because one or more lines are too long
126
common_base/bit_vec/prelude/struct.LocalBits.html
Normal file
126
common_base/bit_vec/prelude/struct.LocalBits.html
Normal file
File diff suppressed because one or more lines are too long
126
common_base/bit_vec/prelude/struct.Lsb0.html
Normal file
126
common_base/bit_vec/prelude/struct.Lsb0.html
Normal file
File diff suppressed because one or more lines are too long
126
common_base/bit_vec/prelude/struct.Msb0.html
Normal file
126
common_base/bit_vec/prelude/struct.Msb0.html
Normal file
File diff suppressed because one or more lines are too long
33
common_base/bit_vec/prelude/trait.AsBits.html
Normal file
33
common_base/bit_vec/prelude/trait.AsBits.html
Normal file
@@ -0,0 +1,33 @@
|
||||
<!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="Immutable Bit View"><title>AsBits in common_base::bit_vec::prelude - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="common_base" data-themes="" data-resource-suffix="" data-rustdoc-version="1.92.0-nightly (fa3155a64 2025-09-30)" data-channel="nightly" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-828709d0.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-ce535bd0.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">AsBits</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../common_base/index.html">common_<wbr>base</a><span class="version">1.0.0-rc.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">AsBits</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#immutable-bit-view" title="Immutable Bit View">Immutable Bit View</a><ul><li><a href="#usage" title="Usage">Usage</a></li><li><a href="#notes" title="Notes">Notes</a></li></ul></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.as_bits" title="as_bits">as_bits</a></li><li><a href="#tymethod.try_as_bits" title="try_as_bits">try_as_bits</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In common_<wbr>base::<wbr>bit_<wbr>vec::<wbr>prelude</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">common_base</a>::<wbr><a href="../index.html">bit_vec</a>::<wbr><a href="index.html">prelude</a></div><h1>Trait <span class="trait">AsBits</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub trait AsBits<T><div class="where">where
|
||||
T: <a class="trait" href="trait.BitStore.html" title="trait common_base::bit_vec::prelude::BitStore">BitStore</a>,</div>{
|
||||
// Required methods
|
||||
fn <a href="#tymethod.as_bits" class="fn">as_bits</a><O>(&self) -> &<a class="struct" href="struct.BitSlice.html" title="struct common_base::bit_vec::prelude::BitSlice">BitSlice</a><T, O> <a href="#" class="tooltip" data-notable-ty="&BitSlice<T, O>">ⓘ</a>
|
||||
<span class="where">where O: <a class="trait" href="trait.BitOrder.html" title="trait common_base::bit_vec::prelude::BitOrder">BitOrder</a></span>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.try_as_bits" class="fn">try_as_bits</a><O>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><&<a class="struct" href="struct.BitSlice.html" title="struct common_base::bit_vec::prelude::BitSlice">BitSlice</a><T, O>, BitSpanError<T>>
|
||||
<span class="where">where O: <a class="trait" href="trait.BitOrder.html" title="trait common_base::bit_vec::prelude::BitOrder">BitOrder</a></span>;
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><h2 id="immutable-bit-view"><a class="doc-anchor" href="#immutable-bit-view">§</a>Immutable Bit View</h2>
|
||||
<p>This trait is an analogue to the <a href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef"><code>AsRef</code></a> trait, in that it enables any type to
|
||||
provide a view of an immutable bit-slice.</p>
|
||||
<p>It does not require an <code>AsRef<[T: BitStore]></code> implementation, but a blanket
|
||||
implementation for all <code>AsRef<[T: BitStore]></code> is provided. This allows you to
|
||||
choose whether to implement only one of <code>AsBits<T></code> or <code>AsRef<[T]></code>, and gain
|
||||
a bit-slice view through either choice.</p>
|
||||
<h3 id="usage"><a class="doc-anchor" href="#usage">§</a>Usage</h3>
|
||||
<p>The <code>.as_bits<_>()</code> method has the same usage patterns as
|
||||
<a href="trait._.html#tymethod.view_bits" title="method common_base::bit_vec::prelude::_::view_bits"><code>BitView::view_bits</code></a>.</p>
|
||||
<h3 id="notes"><a class="doc-anchor" href="#notes">§</a>Notes</h3>
|
||||
<p>You are not <em>forbidden</em> from creating multiple views with different element
|
||||
types to the same region, but doing so is likely to cause inconsistent and
|
||||
surprising behavior.</p>
|
||||
<p>Refrain from implementing this trait with more than one storage argument unless
|
||||
you are sure that you can uphold the memory region requirements of all of them,
|
||||
and are aware of the behavior conflicts that may arise.</p>
|
||||
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.as_bits" class="method"><h4 class="code-header">fn <a href="#tymethod.as_bits" class="fn">as_bits</a><O>(&self) -> &<a class="struct" href="struct.BitSlice.html" title="struct common_base::bit_vec::prelude::BitSlice">BitSlice</a><T, O> <a href="#" class="tooltip" data-notable-ty="&BitSlice<T, O>">ⓘ</a><div class="where">where
|
||||
O: <a class="trait" href="trait.BitOrder.html" title="trait common_base::bit_vec::prelude::BitOrder">BitOrder</a>,</div></h4></section></summary><div class="docblock"><p>Views <code>self</code> as an immutable bit-slice region with the <code>O</code> ordering.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.try_as_bits" class="method"><h4 class="code-header">fn <a href="#tymethod.try_as_bits" class="fn">try_as_bits</a><O>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><&<a class="struct" href="struct.BitSlice.html" title="struct common_base::bit_vec::prelude::BitSlice">BitSlice</a><T, O>, BitSpanError<T>><div class="where">where
|
||||
O: <a class="trait" href="trait.BitOrder.html" title="trait common_base::bit_vec::prelude::BitOrder">BitOrder</a>,</div></h4></section></summary><div class="docblock"><p>Attempts to view <code>self</code> as an immutable bit-slice region with the <code>O</code>
|
||||
ordering.</p>
|
||||
<p>This may return an error if <code>self</code> is too long to view as a bit-slice.</p>
|
||||
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-AsBits%3CT%3E-for-A" class="impl"><a href="#impl-AsBits%3CT%3E-for-A" class="anchor">§</a><h3 class="code-header">impl<A, T> <a class="trait" href="trait.AsBits.html" title="trait common_base::bit_vec::prelude::AsBits">AsBits</a><T> for A<div class="where">where
|
||||
A: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>>,
|
||||
T: <a class="trait" href="trait.BitStore.html" title="trait common_base::bit_vec::prelude::BitStore">BitStore</a>,</div></h3></section></div><script src="../../../trait.impl/bitvec/view/trait.AsBits.js" async></script><script type="text/json" id="notable-traits-data">{"&BitSlice<T, O>":"<h3>Notable traits for <code>&<a class=\"struct\" href=\"struct.BitSlice.html\" title=\"struct common_base::bit_vec::prelude::BitSlice\">BitSlice</a><T, O></code></h3><pre><code><div class=\"where\">impl<T, O> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for &<a class=\"struct\" href=\"struct.BitSlice.html\" title=\"struct common_base::bit_vec::prelude::BitSlice\">BitSlice</a><T, O><div class=\"where\">where\n T: <a class=\"trait\" href=\"trait.BitStore.html\" title=\"trait common_base::bit_vec::prelude::BitStore\">BitStore</a>,\n O: <a class=\"trait\" href=\"trait.BitOrder.html\" title=\"trait common_base::bit_vec::prelude::BitOrder\">BitOrder</a>,\n <a class=\"struct\" href=\"struct.BitSlice.html\" title=\"struct common_base::bit_vec::prelude::BitSlice\">BitSlice</a><T, O>: <a class=\"trait\" href=\"trait._.html\" title=\"trait common_base::bit_vec::prelude::_\">BitField</a>,</div></div>"}</script></section></div></main></body></html>
|
||||
35
common_base/bit_vec/prelude/trait.AsMutBits.html
Normal file
35
common_base/bit_vec/prelude/trait.AsMutBits.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<!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="Mutable Bit View"><title>AsMutBits in common_base::bit_vec::prelude - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="common_base" data-themes="" data-resource-suffix="" data-rustdoc-version="1.92.0-nightly (fa3155a64 2025-09-30)" data-channel="nightly" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-828709d0.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-ce535bd0.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">AsMutBits</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../common_base/index.html">common_<wbr>base</a><span class="version">1.0.0-rc.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">AsMut<wbr>Bits</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#mutable-bit-view" title="Mutable Bit View">Mutable Bit View</a><ul><li><a href="#usage" title="Usage">Usage</a></li><li><a href="#notes" title="Notes">Notes</a></li></ul></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.as_mut_bits" title="as_mut_bits">as_mut_bits</a></li><li><a href="#tymethod.try_as_mut_bits" title="try_as_mut_bits">try_as_mut_bits</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In common_<wbr>base::<wbr>bit_<wbr>vec::<wbr>prelude</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">common_base</a>::<wbr><a href="../index.html">bit_vec</a>::<wbr><a href="index.html">prelude</a></div><h1>Trait <span class="trait">AsMut<wbr>Bits</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub trait AsMutBits<T><div class="where">where
|
||||
T: <a class="trait" href="trait.BitStore.html" title="trait common_base::bit_vec::prelude::BitStore">BitStore</a>,</div>{
|
||||
// Required methods
|
||||
fn <a href="#tymethod.as_mut_bits" class="fn">as_mut_bits</a><O>(&mut self) -> &mut <a class="struct" href="struct.BitSlice.html" title="struct common_base::bit_vec::prelude::BitSlice">BitSlice</a><T, O> <a href="#" class="tooltip" data-notable-ty="&mut BitSlice<T, O>">ⓘ</a>
|
||||
<span class="where">where O: <a class="trait" href="trait.BitOrder.html" title="trait common_base::bit_vec::prelude::BitOrder">BitOrder</a></span>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.try_as_mut_bits" class="fn">try_as_mut_bits</a><O>(
|
||||
&mut self,
|
||||
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><&mut <a class="struct" href="struct.BitSlice.html" title="struct common_base::bit_vec::prelude::BitSlice">BitSlice</a><T, O>, BitSpanError<T>>
|
||||
<span class="where">where O: <a class="trait" href="trait.BitOrder.html" title="trait common_base::bit_vec::prelude::BitOrder">BitOrder</a></span>;
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><h2 id="mutable-bit-view"><a class="doc-anchor" href="#mutable-bit-view">§</a>Mutable Bit View</h2>
|
||||
<p>This trait is an analogue to the <a href="https://doc.rust-lang.org/nightly/core/convert/trait.AsMut.html" title="trait core::convert::AsMut"><code>AsMut</code></a> trait, in that it enables any type to
|
||||
provide a view of a mutable bit-slice.</p>
|
||||
<p>It does not require an <code>AsMut<[T: BitStore]></code> implementation, but a blanket
|
||||
implementation for all <code>AsMut<[T: BitStore]></code> is provided. This allows you to
|
||||
choose whether to implement only one of <code>AsMutBits<T></code> or <code>AsMut<[T]></code>, and gain
|
||||
a bit-slice view through either choice.</p>
|
||||
<h3 id="usage"><a class="doc-anchor" href="#usage">§</a>Usage</h3>
|
||||
<p>The <code>.as_mut_bits<_>()</code> method has the same usage patterns as
|
||||
<a href="trait._.html#tymethod.view_bits_mut" title="method common_base::bit_vec::prelude::_::view_bits_mut"><code>BitView::view_bits_mut</code></a>.</p>
|
||||
<h3 id="notes"><a class="doc-anchor" href="#notes">§</a>Notes</h3>
|
||||
<p>You are not <em>forbidden</em> from creating multiple views with different element
|
||||
types to the same region, but doing so is likely to cause inconsistent and
|
||||
surprising behavior.</p>
|
||||
<p>Refrain from implementing this trait with more than one storage argument unless
|
||||
you are sure that you can uphold the memory region requirements of all of them,
|
||||
and are aware of the behavior conflicts that may arise.</p>
|
||||
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.as_mut_bits" class="method"><h4 class="code-header">fn <a href="#tymethod.as_mut_bits" class="fn">as_mut_bits</a><O>(&mut self) -> &mut <a class="struct" href="struct.BitSlice.html" title="struct common_base::bit_vec::prelude::BitSlice">BitSlice</a><T, O> <a href="#" class="tooltip" data-notable-ty="&mut BitSlice<T, O>">ⓘ</a><div class="where">where
|
||||
O: <a class="trait" href="trait.BitOrder.html" title="trait common_base::bit_vec::prelude::BitOrder">BitOrder</a>,</div></h4></section></summary><div class="docblock"><p>Views <code>self</code> as a mutable bit-slice region with the <code>O</code> ordering.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.try_as_mut_bits" class="method"><h4 class="code-header">fn <a href="#tymethod.try_as_mut_bits" class="fn">try_as_mut_bits</a><O>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><&mut <a class="struct" href="struct.BitSlice.html" title="struct common_base::bit_vec::prelude::BitSlice">BitSlice</a><T, O>, BitSpanError<T>><div class="where">where
|
||||
O: <a class="trait" href="trait.BitOrder.html" title="trait common_base::bit_vec::prelude::BitOrder">BitOrder</a>,</div></h4></section></summary><div class="docblock"><p>Attempts to view <code>self</code> as a mutable bit-slice region with the <code>O</code>
|
||||
ordering.</p>
|
||||
<p>This may return an error if <code>self</code> is too long to view as a bit-slice.</p>
|
||||
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-AsMutBits%3CT%3E-for-A" class="impl"><a href="#impl-AsMutBits%3CT%3E-for-A" class="anchor">§</a><h3 class="code-header">impl<A, T> <a class="trait" href="trait.AsMutBits.html" title="trait common_base::bit_vec::prelude::AsMutBits">AsMutBits</a><T> for A<div class="where">where
|
||||
A: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsMut.html" title="trait core::convert::AsMut">AsMut</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[T]</a>>,
|
||||
T: <a class="trait" href="trait.BitStore.html" title="trait common_base::bit_vec::prelude::BitStore">BitStore</a>,</div></h3></section></div><script src="../../../trait.impl/bitvec/view/trait.AsMutBits.js" async></script><script type="text/json" id="notable-traits-data">{"&mut BitSlice<T, O>":"<h3>Notable traits for <code>&mut <a class=\"struct\" href=\"struct.BitSlice.html\" title=\"struct common_base::bit_vec::prelude::BitSlice\">BitSlice</a><T, O></code></h3><pre><code><div class=\"where\">impl<T, O> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/io/trait.Write.html\" title=\"trait std::io::Write\">Write</a> for &mut <a class=\"struct\" href=\"struct.BitSlice.html\" title=\"struct common_base::bit_vec::prelude::BitSlice\">BitSlice</a><T, O><div class=\"where\">where\n T: <a class=\"trait\" href=\"trait.BitStore.html\" title=\"trait common_base::bit_vec::prelude::BitStore\">BitStore</a>,\n O: <a class=\"trait\" href=\"trait.BitOrder.html\" title=\"trait common_base::bit_vec::prelude::BitOrder\">BitOrder</a>,\n <a class=\"struct\" href=\"struct.BitSlice.html\" title=\"struct common_base::bit_vec::prelude::BitSlice\">BitSlice</a><T, O>: <a class=\"trait\" href=\"trait._.html\" title=\"trait common_base::bit_vec::prelude::_\">BitField</a>,</div></div>"}</script></section></div></main></body></html>
|
||||
144
common_base/bit_vec/prelude/trait.BitOrder.html
Normal file
144
common_base/bit_vec/prelude/trait.BitOrder.html
Normal file
@@ -0,0 +1,144 @@
|
||||
<!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="In-Element Bit Ordering"><title>BitOrder in common_base::bit_vec::prelude - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="common_base" data-themes="" data-resource-suffix="" data-rustdoc-version="1.92.0-nightly (fa3155a64 2025-09-30)" data-channel="nightly" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-828709d0.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-ce535bd0.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">BitOrder</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../common_base/index.html">common_<wbr>base</a><span class="version">1.0.0-rc.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">BitOrder</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#in-element-bit-ordering" title="In-Element Bit Ordering">In-Element Bit Ordering</a><ul><li><a href="#usage" title="Usage">Usage</a></li><li><a href="#safety" title="Safety">Safety</a></li><li><a href="#implementation-rules" title="Implementation Rules">Implementation Rules</a></li><li><a href="#verification" title="Verification">Verification</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.at" title="at">at</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.mask" title="mask">mask</a></li><li><a href="#method.select" title="select">select</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In common_<wbr>base::<wbr>bit_<wbr>vec::<wbr>prelude</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">common_base</a>::<wbr><a href="../index.html">bit_vec</a>::<wbr><a href="index.html">prelude</a></div><h1>Trait <span class="trait">BitOrder</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub unsafe trait BitOrder: 'static {
|
||||
// Required method
|
||||
fn <a href="#tymethod.at" class="fn">at</a><R>(index: BitIdx<R>) -> BitPos<R>
|
||||
<span class="where">where R: BitRegister</span>;
|
||||
|
||||
// Provided methods
|
||||
fn <a href="#method.select" class="fn">select</a><R>(index: BitIdx<R>) -> BitSel<R>
|
||||
<span class="where">where R: BitRegister</span> { ... }
|
||||
<span class="item-spacer"></span> fn <a href="#method.mask" class="fn">mask</a><R>(
|
||||
from: impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><BitIdx<R>>>,
|
||||
upto: impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><BitEnd<R>>>,
|
||||
) -> BitMask<R>
|
||||
<span class="where">where R: BitRegister</span> { ... }
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><h2 id="in-element-bit-ordering"><a class="doc-anchor" href="#in-element-bit-ordering">§</a>In-Element Bit Ordering</h2>
|
||||
<p>This trait manages the translation of semantic bit indices into electrical
|
||||
positions within storage elements of a memory region.</p>
|
||||
<h3 id="usage"><a class="doc-anchor" href="#usage">§</a>Usage</h3>
|
||||
<p><code>bitvec</code> APIs operate on semantic index counters that exist in an abstract
|
||||
memory space independently of the real memory that underlies them. In order to
|
||||
affect real memory, <code>bitvec</code> must translate these indices into real values. The
|
||||
<a href="trait.BitOrder.html#tymethod.at" title="associated function bitvec::order::BitOrder::at::at"><code>at</code></a> function maps abstract index values into their corresponding real
|
||||
positions that can then be used to access memory.</p>
|
||||
<p>You will likely never call any of the trait functions yourself. They are used by
|
||||
<code>bitvec</code> internals to operate on memory regions; all you need to do is provide
|
||||
an implementation of this trait as a type parameter to <code>bitvec</code> data structures.</p>
|
||||
<h3 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h3>
|
||||
<p><code>BitOrder</code> is unsafe to implement because its translation of index to position
|
||||
cannot be forcibly checked by <code>bitvec</code> itself, and an improper implementation
|
||||
will lead to memory unsafety errors and unexpected collisions. The trait has
|
||||
strict requirements for each function. If these are not upheld, then the
|
||||
implementation is considered undefined at the library level and its use may
|
||||
produce incorrect or undefined behavior during compilation.</p>
|
||||
<p>You are responsible for running <a href="crate::order::verify_for_type"><code>verify_for_type</code></a> or <a href="crate::order::verify"><code>verify</code></a> in your test
|
||||
suite if you implement <code>BitOrder</code>.</p>
|
||||
<h3 id="implementation-rules"><a class="doc-anchor" href="#implementation-rules">§</a>Implementation Rules</h3>
|
||||
<p>Values of this type are never constructed or passed to <code>bitvec</code> functions. Your
|
||||
implementation does not need to be zero-sized, but it will never have access to
|
||||
an instance to view its state. It <em>may</em> refer to other global state, but per the
|
||||
rules of <code>at</code>, that state may not change while any <code>bitvec</code> data structures are
|
||||
alive.</p>
|
||||
<p>The only function you <em>need</em> to provide is <code>at</code>. Its requirements are listed in
|
||||
its trait documentation.</p>
|
||||
<p>You <em>may</em> also choose to provide implementations of <code>select</code> and <code>mask</code>. These
|
||||
have a default implementation that is correct, but may be unoptimized for your
|
||||
implementation. As such, you may replace them with a better version, but your
|
||||
implementation of these functions must be exactly equal to the default
|
||||
implementation for all possible inputs.</p>
|
||||
<p>This requirement is checked by the <code>verify_for_type</code> function.</p>
|
||||
<h3 id="verification"><a class="doc-anchor" href="#verification">§</a>Verification</h3>
|
||||
<p>The <code>verify_for_type</code> function verifies that a <code>BitOrder</code> implementation is
|
||||
correct for a single <code>BitStore</code> implementor, and the <code>verify</code> function runs
|
||||
<code>verify_for_type</code> on all unsigned integers that implement <code>BitStore</code> on a
|
||||
target. If you run these functions in your test suite, they will provide
|
||||
detailed information if your implementation is incorrect.</p>
|
||||
<h3 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h3>
|
||||
<p>Implementations are not required to remain contiguous over a register, and may
|
||||
have any mapping they wish as long as it is total and bijective. This example
|
||||
swizzles the high and low halves of each byte.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>bitvec::{
|
||||
order::BitOrder,
|
||||
index::{BitIdx, BitPos},
|
||||
mem::BitRegister,
|
||||
};
|
||||
|
||||
<span class="kw">pub struct </span>HiLo;
|
||||
|
||||
<span class="kw">unsafe impl </span>BitOrder <span class="kw">for </span>HiLo {
|
||||
<span class="kw">fn </span>at<R>(index: BitIdx<R>) -> BitPos<R>
|
||||
<span class="kw">where </span>R: BitRegister {
|
||||
<span class="kw">unsafe </span>{ BitPos::new_unchecked(index.into_inner() ^ <span class="number">4</span>) }
|
||||
}
|
||||
}
|
||||
|
||||
<span class="attr">#[test]
|
||||
#[cfg(test)]
|
||||
</span><span class="kw">fn </span>prove_hilo() {
|
||||
bitvec::order::verify::<HiLo>();
|
||||
}</code></pre></div>
|
||||
<p>Once a <code>BitOrder</code> implementation passes the test suite, it can be freely used as
|
||||
a type parameter in <code>bitvec</code> data structures. The translation takes place
|
||||
automatically, and you never need to look at this trait again.</p>
|
||||
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.at" class="method"><h4 class="code-header">fn <a href="#tymethod.at" class="fn">at</a><R>(index: BitIdx<R>) -> BitPos<R><div class="where">where
|
||||
R: BitRegister,</div></h4></section></summary><div class="docblock"><p>Translates a semantic bit index into a real bit position.</p>
|
||||
<p>This function is the basis of the trait, and must adhere to a number of
|
||||
requirements in order for an implementation to be correct.</p>
|
||||
<h6 id="type-parameters"><a class="doc-anchor" href="#type-parameters">§</a>Type Parameters</h6>
|
||||
<ul>
|
||||
<li><code>R</code>: The memory element type that the index and position govern.</li>
|
||||
</ul>
|
||||
<h6 id="parameters"><a class="doc-anchor" href="#parameters">§</a>Parameters</h6>
|
||||
<ul>
|
||||
<li><code>index</code>: A semantic bit-index within some <code>R</code> element.</li>
|
||||
</ul>
|
||||
<h6 id="returns"><a class="doc-anchor" href="#returns">§</a>Returns</h6>
|
||||
<p>The real position of the indexed bit within an <code>R</code> element. See the
|
||||
<code>BitPos</code> documentation for what these positions are considered to mean.</p>
|
||||
<h6 id="requirements"><a class="doc-anchor" href="#requirements">§</a>Requirements</h6>
|
||||
<p>This function must satisfy the following requirements for all possible
|
||||
input and output values, for all possible <code>R</code> type parameters:</p>
|
||||
<ul>
|
||||
<li>Totality: The implementation must be able to accept every input in
|
||||
<a href="crate::index::BitIdx::range_all"><code>BitIdx::<R>::range_all()</code></a>, and produce some <code>BitPos</code> value for
|
||||
each.</li>
|
||||
<li>Bijection: There must be an exactly one-to-one correspondence between
|
||||
input and output values. No input index may choose its output from a
|
||||
set of more than one position, and no output position may be produced
|
||||
by more than one input index.</li>
|
||||
<li>Purity: The translation from index to position must be consistent for
|
||||
the lifetime of <em>at least</em> all data structures in the program. This
|
||||
function <em>may</em> refer to global state, but that state <strong>must</strong> be
|
||||
immutable while any <code>bitvec</code> data structures exist, and must not be
|
||||
used to violate the totality or bijection requirements.</li>
|
||||
<li>Validity: The produced <code>BitPos</code> value must be within the valid range
|
||||
of its type. This is enforced by <a href="crate::index::BitPos::new"><code>BitPos::new</code></a>, but not by the
|
||||
unsafe constructor <a href="crate::index::BitPos::new_unchecked"><code>BitPos::new_unchecked</code></a>.</li>
|
||||
</ul>
|
||||
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.select" class="method"><h4 class="code-header">fn <a href="#method.select" class="fn">select</a><R>(index: BitIdx<R>) -> BitSel<R><div class="where">where
|
||||
R: BitRegister,</div></h4></section></summary><div class="docblock"><p>Produces a single-bit selection mask from a bit-index.</p>
|
||||
<p>This is an optional function: it is implemented as, and must always be
|
||||
exactly identical to, <code>BitOrder::at(index).select()</code>. If your ordering
|
||||
has a faster implementation, you may provide it, but it must be exactly
|
||||
numerically equivalent.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.mask" class="method"><h4 class="code-header">fn <a href="#method.mask" class="fn">mask</a><R>(
|
||||
from: impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><BitIdx<R>>>,
|
||||
upto: impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><BitEnd<R>>>,
|
||||
) -> BitMask<R><div class="where">where
|
||||
R: BitRegister,</div></h4></section></summary><div class="docblock"><p>Produces a multi-bit selection mask from a range of bit-indices.</p>
|
||||
<p>This is an optional function: it is implemented as, and must always be
|
||||
exactly identical to,
|
||||
<code>BitIdx::range(from, upto).map(BitOrder::select).sum()</code>. If your
|
||||
ordering has a faster implementation, you may provide it, but it must be
|
||||
exactly numerically equivalent.</p>
|
||||
<h6 id="parameters-1"><a class="doc-anchor" href="#parameters-1">§</a>Parameters</h6>
|
||||
<ul>
|
||||
<li><code>from</code>: The inclusive starting value of the indices being selected.
|
||||
Defaults to <a href="crate::index::BitIdx::MIN"><code>BitIdx::MIN</code></a>.</li>
|
||||
<li><code>upto</code>: The exclusive ending value of the indices being selected.
|
||||
Defaults to <a href="crate::index::BitEnd::MAX"><code>BitEnd::MAX</code></a>.</li>
|
||||
</ul>
|
||||
<h6 id="returns-1"><a class="doc-anchor" href="#returns-1">§</a>Returns</h6>
|
||||
<p>A selection mask with all bit-positions corresponding to <code>from .. upto</code>
|
||||
selected.</p>
|
||||
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-BitOrder-for-Lsb0" class="impl"><a href="#impl-BitOrder-for-Lsb0" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.BitOrder.html" title="trait common_base::bit_vec::prelude::BitOrder">BitOrder</a> for <a class="struct" href="struct.LocalBits.html" title="struct common_base::bit_vec::prelude::LocalBits">Lsb0</a></h3></section><section id="impl-BitOrder-for-Msb0" class="impl"><a href="#impl-BitOrder-for-Msb0" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.BitOrder.html" title="trait common_base::bit_vec::prelude::BitOrder">BitOrder</a> for <a class="struct" href="struct.Msb0.html" title="struct common_base::bit_vec::prelude::Msb0">Msb0</a></h3></section></div><script src="../../../trait.impl/bitvec/order/trait.BitOrder.js" data-ignore-extern-crates="bitvec" async></script></section></div></main></body></html>
|
||||
100
common_base/bit_vec/prelude/trait.BitStore.html
Normal file
100
common_base/bit_vec/prelude/trait.BitStore.html
Normal file
File diff suppressed because one or more lines are too long
19
common_base/bit_vec/prelude/trait._.html
Normal file
19
common_base/bit_vec/prelude/trait._.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<!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="Helper trait for scalars and arrays, but not slices."><title>_ in common_base::bit_vec::prelude - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="common_base" data-themes="" data-resource-suffix="" data-rustdoc-version="1.92.0-nightly (fa3155a64 2025-09-30)" data-channel="nightly" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-828709d0.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-ce535bd0.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">_</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../common_base/index.html">common_<wbr>base</a><span class="version">1.0.0-rc.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">_</a></h2><h3><a href="#required-associated-consts">Required Associated Constants</a></h3><ul class="block"><li><a href="#associatedconstant.ZERO" title="ZERO">ZERO</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.as_raw_mut_slice" title="as_raw_mut_slice">as_raw_mut_slice</a></li><li><a href="#tymethod.as_raw_slice" title="as_raw_slice">as_raw_slice</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.into_bitarray" title="into_bitarray">into_bitarray</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-BitViewSized-for-%5BT;+N%5D" title="[T; N]">[T; N]</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In common_<wbr>base::<wbr>bit_<wbr>vec::<wbr>prelude</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">common_base</a>::<wbr><a href="../index.html">bit_vec</a>::<wbr><a href="index.html">prelude</a></div><h1>Trait <span class="trait">_</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub trait _: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait._.html" title="trait common_base::bit_vec::prelude::_">BitView</a> {
|
||||
const <a href="#associatedconstant.ZERO" class="constant">ZERO</a>: Self;
|
||||
|
||||
// Required methods
|
||||
fn <a href="#tymethod.as_raw_slice" class="fn">as_raw_slice</a>(&self) -> &[Self::<a class="associatedtype" href="trait._.html#associatedtype.Store" title="type common_base::bit_vec::prelude::_::Store">Store</a>];
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.as_raw_mut_slice" class="fn">as_raw_mut_slice</a>(&mut self) -> &mut [Self::<a class="associatedtype" href="trait._.html#associatedtype.Store" title="type common_base::bit_vec::prelude::_::Store">Store</a>];
|
||||
|
||||
// Provided method
|
||||
fn <a href="#method.into_bitarray" class="fn">into_bitarray</a><O>(self) -> <a class="struct" href="struct.BitArray.html" title="struct common_base::bit_vec::prelude::BitArray">BitArray</a><Self, O>
|
||||
<span class="where">where O: <a class="trait" href="trait.BitOrder.html" title="trait common_base::bit_vec::prelude::BitOrder">BitOrder</a></span> { ... }
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Helper trait for scalars and arrays, but not slices.</p>
|
||||
</div></details><h2 id="required-associated-consts" class="section-header">Required Associated Constants<a href="#required-associated-consts" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedconstant.ZERO" class="method"><h4 class="code-header">const <a href="#associatedconstant.ZERO" class="constant">ZERO</a>: Self</h4></section></summary><div class="docblock"><p>The zero constant.</p>
|
||||
</div></details></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.as_raw_slice" class="method"><h4 class="code-header">fn <a href="#tymethod.as_raw_slice" class="fn">as_raw_slice</a>(&self) -> &[Self::<a class="associatedtype" href="trait._.html#associatedtype.Store" title="type common_base::bit_vec::prelude::_::Store">Store</a>]</h4></section></summary><div class="docblock"><p>Views the type as a slice of its elements.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.as_raw_mut_slice" class="method"><h4 class="code-header">fn <a href="#tymethod.as_raw_mut_slice" class="fn">as_raw_mut_slice</a>(&mut self) -> &mut [Self::<a class="associatedtype" href="trait._.html#associatedtype.Store" title="type common_base::bit_vec::prelude::_::Store">Store</a>]</h4></section></summary><div class="docblock"><p>Views the type as a mutable slice of its elements.</p>
|
||||
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.into_bitarray" class="method"><h4 class="code-header">fn <a href="#method.into_bitarray" class="fn">into_bitarray</a><O>(self) -> <a class="struct" href="struct.BitArray.html" title="struct common_base::bit_vec::prelude::BitArray">BitArray</a><Self, O><div class="where">where
|
||||
O: <a class="trait" href="trait.BitOrder.html" title="trait common_base::bit_vec::prelude::BitOrder">BitOrder</a>,</div></h4></section></summary><div class="docblock"><p>Wraps <code>self</code> in a <code>BitArray</code>.</p>
|
||||
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-BitViewSized-for-%5BT;+N%5D" class="impl"><a href="#impl-BitViewSized-for-%5BT;+N%5D" class="anchor">§</a><h3 class="code-header">impl<T, const N: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> <a class="trait" href="trait._.html" title="trait common_base::bit_vec::prelude::_">BitViewSized</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[T; N]</a><div class="where">where
|
||||
T: <a class="trait" href="trait.BitStore.html" title="trait common_base::bit_vec::prelude::BitStore">BitStore</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedconstant.ZERO-1" class="associatedconstant trait-impl"><a href="#associatedconstant.ZERO-1" class="anchor">§</a><h4 class="code-header">const <a class="constant">ZERO</a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[T; N]</a></h4></section><section id="method.as_raw_slice" class="method trait-impl"><a href="#method.as_raw_slice" class="anchor">§</a><h4 class="code-header">fn <a class="fn">as_raw_slice</a>(&self) -> &[<<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[T; N]</a> as <a class="trait" href="trait._.html" title="trait common_base::bit_vec::prelude::_">BitView</a>>::<a class="associatedtype" href="trait._.html#associatedtype.Store" title="type common_base::bit_vec::prelude::_::Store">Store</a>]</h4></section><section id="method.as_raw_mut_slice" class="method trait-impl"><a href="#method.as_raw_mut_slice" class="anchor">§</a><h4 class="code-header">fn <a class="fn">as_raw_mut_slice</a>(&mut self) -> &mut [<<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[T; N]</a> as <a class="trait" href="trait._.html" title="trait common_base::bit_vec::prelude::_">BitView</a>>::<a class="associatedtype" href="trait._.html#associatedtype.Store" title="type common_base::bit_vec::prelude::_::Store">Store</a>]</h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-BitViewSized-for-T" class="impl"><a href="#impl-BitViewSized-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="trait._.html" title="trait common_base::bit_vec::prelude::_">BitViewSized</a> for T<div class="where">where
|
||||
T: <a class="trait" href="trait.BitStore.html" title="trait common_base::bit_vec::prelude::BitStore">BitStore</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedconstant.ZERO-2" class="associatedconstant trait-impl"><a href="#associatedconstant.ZERO-2" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.ZERO" class="constant">ZERO</a>: T = <T as BitStore>::ZERO</h4></section></div></details></div><script src="../../../trait.impl/bitvec/view/trait.BitViewSized.js" data-ignore-extern-crates="std" async></script></section></div></main></body></html>
|
||||
1
common_base/bit_vec/sidebar-items.js
Normal file
1
common_base/bit_vec/sidebar-items.js
Normal file
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"mod":["prelude"],"type":["BitVec"]};
|
||||
1
common_base/bit_vec/type.BitVec.html
Normal file
1
common_base/bit_vec/type.BitVec.html
Normal file
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `BitVec` type in crate `common_base`."><title>BitVec in common_base::bit_vec - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="common_base" data-themes="" data-resource-suffix="" data-rustdoc-version="1.92.0-nightly (fa3155a64 2025-09-30)" data-channel="nightly" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-828709d0.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-ce535bd0.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">BitVec</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../common_base/index.html">common_<wbr>base</a><span class="version">1.0.0-rc.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">BitVec</a></h2><h3><a href="#aliased-type">Aliased Type</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In common_<wbr>base::<wbr>bit_<wbr>vec</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">common_base</a>::<wbr><a href="index.html">bit_vec</a></div><h1>Type Alias <span class="type">BitVec</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/common_base/bit_vec.rs.html#19">Source</a> </span></div><pre class="rust item-decl"><code>pub type BitVec = <a class="struct" href="prelude/struct.BitVec.html" title="struct common_base::bit_vec::prelude::BitVec">BitVec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>;</code></pre><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code><div class="code-attribute">#[repr(C)]</div>pub struct BitVec { <span class="comment">/* private fields */</span> }</code></pre><script src="../../type.impl/common_base/bit_vec/prelude/struct.BitVec.js" data-self-path="common_base::bit_vec::BitVec" async></script></section></div></main></body></html>
|
||||
Reference in New Issue
Block a user