Debian Codegraph @

debian/rust-vendor/bitvec/doc/access/BitSafe.md

raw
1 # Read-Only Semivolatile Handle
2
3 This trait describes views of memory that are not permitted to modify the value
4 they reference, but must tolerate external modification to that value.
5 Implementors must tolerate shared-mutability behaviors, but are not allowed to
6 expose shared mutation APIs. They are permitted to modify the referent only
7 under `&mut` exclusive references.
8
9 This behavior enables an important aspect of the `bitvec` memory model when
10 working with memory elements that multiple [`&mut BitSlice`][0] references
11 touch: each `BitSlice` needs to be able to give the caller a view of the memory
12 element, but they also need to prevent modification of bits outside of their
13 span. This trait enables callers to view raw underlying memory without
14 improperly modifying memory that *other* `&mut BitSlice`s expect to be stable.
15
16 [0]: crate::slice::BitSlice