Debian Codegraph @

debian/rust-vendor/bitvec/doc/ptr/range.md

raw
1 # Bit-Pointer Ranges
2
3 This module defines ports of the `Range` type family to work with `BitPtr`s.
4 Rust’s own ranges have unstable internal details that make them awkward to use
5 within the standard library, and essentially impossible outside it, with
6 anything other than the numeric fundamentals.
7
8 In particular, `bitvec` uses a half-open range of `BitPtr`s to represent
9 C++-style dual-pointer memory regions (such as `BitSlice` iterators). Rust’s own
10 slice iterators also do this, but because `*T` does not implement the [`Step`]
11 trait, the standard library duplicates some work done by `Range` types in the
12 slice iterators just to be able to alter the views.
13
14 As such, `Range<BitPtr<_, _, _>>` has the same functionality as
15 `Range<*const _>`: almost none. As this is undesirable, this module defines
16 equivalent types that implement the full desired behavior of a pointer range.
17 These are primarily used as crate internals, but may also be of interest to
18 users.
19
20 [`Step`]: core::iter::Step