Debian Codegraph @

debian/rust-vendor/bitvec/doc/slice.md

raw
1 # Bit-Addressable Memory Regions
2
3 This module defines the [`BitSlice`] region, which forms the primary export item
4 of the crate. It is a region of memory that addresses each bit individually, and
5 is analogous to the slice language item. See `BitSlice`’s documentation for
6 information on its use.
7
8 The other data structures `bitvec` offers are built atop `BitSlice`, and follow
9 the development conventions outlined in this module. Because the API surface for
10 `bitvec` data structures is so large, they are broken into a number of common
11 submodules:
12
13 - `slice` defines the `BitSlice` data structure, its inherent methods
14 that are original to `bitvec`, as well as some free functions.
15 - `slice::api` defines ports of the `impl<T> [T]` inherent blocks from
16 `core::slice`.
17 - `slice::iter` contains all the logic used to iterate across `BitSlices`,
18 including ports of `core::slice` iterators.
19 - `slice::ops` contains implementations of `core::ops` traits that power
20 operator sigils.
21 - `slice::traits` contains all the other trait implementations.
22 - `slice::tests` contains unit tests for `BitSlice` inherent methods.
23
24 Additionally, `slice` has a submodule unique to it: `specialization` contains
25 override functions that provide faster behavior on known `BitOrder`
26 implementations. Since the other data structures `Deref` to it, they do not need
27 to implement bit-order specializations of their own.
28
29 All ports of language or standard-library items have an `## Original` section in
30 their documentation that links to the item they are porting, and possibly an
31 `## API Differences` that explains why the `bitvec` item is not a drop-in
32 replacement.
33
34 [`BitSlice`]: self::BitSlice