constptr 0.1.0

NonNull without mutability
Documentation
1
2
3
4
5
6
7
8
# ConstPtr

Rusts `std::ptr::NonNull` wraps a `*mut` pointer. Sometimes this has implications that are not
desired. `ConstPtr` wraps `NullPtr` but removes the mutable and uninit API's. As consequence
it can only be constructed to point to a valid object (although it may become dangling when
the object becomes destroyed). This simplifies handling lifetime erased references because a
`&reference` implicitly coerces to a `*const pointer` and adds some safety net as in one can't
accidentally get a mutable reference to something that should been const.