Module invariant

Module invariant 

Source
Expand description

The parameterized invariants of a [Ptr][super::Ptr].

Invariants are encoded as (Aliasing, Alignment, Validity) triples implementing the Invariants trait.

Enums§

Aligned
The referent is aligned: for Ptr<T>, the referent’s address is a multiple of the T’s alignment.
AsInitialized
The byte ranges initialized in T are also initialized in the referent of a Ptr<T>.
BecauseExclusive 👻
Unsynchronized reads are permitted because only one live Ptr or reference may exist to the referent bytes at a time.
BecauseImmutable 👻
Unsynchronized reads are permitted because no live Ptrs or references permit interior mutation.
Exclusive
The Ptr<'a, T> adheres to the aliasing rules of a &'a mut T.
Initialized
The byte ranges in the referent are fully initialized. In other words, if the referent is N bytes long, then it contains a bit-valid [u8; N].
Shared
The Ptr<'a, T> adheres to the aliasing rules of a &'a T.
Unaligned
It is unknown whether the pointer is aligned.
Uninit
Any bit pattern is allowed in the Ptr’s referent, including uninitialized bytes.
Valid
The referent of a Ptr<T> is valid for T, upholding bit validity and any library safety invariants.

Traits§

Aliasing
The aliasing invariant of a [Ptr][super::Ptr].
Alignment
The alignment invariant of a [Ptr][super::Ptr].
CastableFrom
Safety
Invariants
The invariants of a [Ptr][super::Ptr].
Read
Ptr referents that permit unsynchronized read operations.
Reference
An Aliasing invariant which is either Shared or Exclusive.
Validity
The validity invariant of a [Ptr][super::Ptr].