pub struct Assume {
pub alignment: bool,
pub lifetimes: bool,
pub safety: bool,
pub validity: bool,
}
transmutability
)Expand description
What transmutation safety conditions shall the compiler assume that you are checking?
Fields§
§alignment: bool
transmutability
)When true
, the compiler assumes that you are ensuring (either dynamically or statically) that
destination referents do not have stricter alignment requirements than source referents.
lifetimes: bool
transmutability
)When true
, the compiler assume that you are ensuring that lifetimes are not extended in a manner
that violates Rust’s memory model.
safety: bool
transmutability
)When true
, the compiler assumes that you have ensured that it is safe for you to violate the
type and field privacy of the destination type (and sometimes of the source type, too).
validity: bool
transmutability
)When true
, the compiler assumes that you are ensuring that the source type is actually a valid
instance of the destination type.
Implementations§
source§impl Assume
impl Assume
sourcepub const NOTHING: Assume = Self{ alignment: false, lifetimes: false, safety: false, validity: false,}
🔬This is a nightly-only experimental API. (transmutability
)
pub const NOTHING: Assume = Self{ alignment: false, lifetimes: false, safety: false, validity: false,}
transmutability
)Do not assume that you have ensured any safety properties are met.
sourcepub const ALIGNMENT: Assume = Self{ alignment: true, ..Self::NOTHING}
🔬This is a nightly-only experimental API. (transmutability
)
pub const ALIGNMENT: Assume = Self{ alignment: true, ..Self::NOTHING}
transmutability
)Assume only that alignment conditions are met.
sourcepub const LIFETIMES: Assume = Self{ lifetimes: true, ..Self::NOTHING}
🔬This is a nightly-only experimental API. (transmutability
)
pub const LIFETIMES: Assume = Self{ lifetimes: true, ..Self::NOTHING}
transmutability
)Assume only that lifetime conditions are met.
sourcepub const SAFETY: Assume = Self{ safety: true, ..Self::NOTHING}
🔬This is a nightly-only experimental API. (transmutability
)
pub const SAFETY: Assume = Self{ safety: true, ..Self::NOTHING}
transmutability
)Assume only that safety conditions are met.
sourcepub const VALIDITY: Assume = Self{ validity: true, ..Self::NOTHING}
🔬This is a nightly-only experimental API. (transmutability
)
pub const VALIDITY: Assume = Self{ validity: true, ..Self::NOTHING}
transmutability
)Assume only that dynamically-satisfiable validity conditions are met.
Trait Implementations§
source§impl PartialEq<Assume> for Assume
impl PartialEq<Assume> for Assume
impl ConstParamTy for Assume
impl Copy for Assume
impl Eq for Assume
impl StructuralEq for Assume
impl StructuralPartialEq for Assume
Auto Trait Implementations§
impl RefUnwindSafe for Assume
impl Send for Assume
impl Sync for Assume
impl Unpin for Assume
impl UnwindSafe for Assume
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.