| 1 |
# Bit View Adapters |
| 2 |
|
| 3 |
This module provides extension traits that view ordinary memory as |
| 4 |
bit-addressable. |
| 5 |
|
| 6 |
The [`&BitSlice`][0] type is a reference view over memory managed elsewhere. The |
| 7 |
inherent constructors are awkward to call, as they require function syntax and |
| 8 |
a redundant type argument (the `T: BitStore` parameter is already known by the |
| 9 |
data being viewed). As an alternative, the [`BitView`] trait provides methods |
| 10 |
on `BitStore` scalars and arrays that are more convenient to create `BitSlice` |
| 11 |
reference views. |
| 12 |
|
| 13 |
Additionally, [`BitViewSized`], [`AsBits`], and [`AsMutBits`] inform the type |
| 14 |
system about types that can be used as [`BitArray`] storage, immutably viewed as |
| 15 |
bits, or mutably viewed as bits, respectively. |
| 16 |
|
| 17 |
[0]: crate::slice::BitSlice |
| 18 |
[`AsBits`]: self::AsBits |
| 19 |
[`AsMutBits`]: self::AsMutBits |
| 20 |
[`BitArray`]: crate::array::BitArray |
| 21 |
[`BitView`]: self::BitView |
| 22 |
[`BitViewSized`]: self::BitViewSized |