| 1 |
# Bit-Pointer Range |
| 2 |
|
| 3 |
This type is equivalent in purpose, but superior in functionality, to |
| 4 |
`Range<BitPtr<M, T, O>>`. If the standard library stabilizes [`Step`], the trait |
| 5 |
used to drive `Range` operations, then this type will likely be destroyed in |
| 6 |
favor of an `impl Step for BitPtr` block and use of standard ranges. |
| 7 |
|
| 8 |
Like [`Range`], this is a half-open set where the low bit-pointer selects the |
| 9 |
first live bit in a span and the high bit-pointer selects the first dead bit |
| 10 |
*after* the span. |
| 11 |
|
| 12 |
This type is not capable of inspecting provenance, and has no requirement of its |
| 13 |
own that both bit-pointers be derived from the same provenance region. It is |
| 14 |
safe to construct and use with any pair of bit-pointers; however, the |
| 15 |
bit-pointers it *produces* are, necessarily, `unsafe` to use. |
| 16 |
|
| 17 |
## Original |
| 18 |
|
| 19 |
[`Range<*bool>`][`Range`] |
| 20 |
|
| 21 |
## Memory Representation |
| 22 |
|
| 23 |
[`BitPtr`] is required to be `repr(packed)` in order to satisfy the [`BitRef`] |
| 24 |
size optimizations. In order to stay minimally sized itself, this type has no |
| 25 |
alignment requirement, and reading either bit-pointer *may* incur a misalignment |
| 26 |
penalty. Reads are always safe and valid; they may merely be slow. |
| 27 |
|
| 28 |
## Type Parameters |
| 29 |
|
| 30 |
This takes the same type parameters as `BitPtr`, as it is simply a pair of |
| 31 |
bit-pointers with range semantics. |
| 32 |
|
| 33 |
[`BitPtr`]: crate::ptr::BitPtr |
| 34 |
[`BitRef`]: crate::ptr::BitRef |
| 35 |
[`Range`]: core::ops::Range |
| 36 |
[`Step`]: core::iter::Step |