On this page
Struct std::mem::Assume
pub struct Assume {
pub alignment: bool,
pub lifetimes: bool,
pub safety: bool,
pub validity: bool,
}
transmutability
#99571)
What transmutation safety conditions shall the compiler assume that you are checking?
Fields
alignment: bool
transmutability
#99571)
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
#99571)
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
#99571)
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
#99571)
When true
, the compiler assumes that you are ensuring that the source type is actually a valid instance of the destination type.
Implementations
impl Assume
pub const NOTHING: Assume = _
transmutability
#99571)
Do not assume that you have ensured any safety properties are met.
pub const ALIGNMENT: Assume = _
transmutability
#99571)
Assume only that alignment conditions are met.
pub const LIFETIMES: Assume = _
transmutability
#99571)
Assume only that lifetime conditions are met.
pub const SAFETY: Assume = _
transmutability
#99571)
Assume only that safety conditions are met.
pub const VALIDITY: Assume = _
transmutability
#99571)
Assume only that dynamically-satisfiable validity conditions are met.
pub const fn and(self, other_assumptions: Assume) -> Assume
transmutability
#99571)
Assume both self
and other_assumptions
.
pub const fn but_not(self, other_assumptions: Assume) -> Assume
transmutability
#99571)
Assume self
, excepting other_assumptions
.
Trait Implementations
impl Add for Assume
type Output = Assume
+
operator.
fn add(self, other_assumptions: Assume) -> Assume
+
operation. Read more
impl Clone for Assume
fn clone(&self) -> Assume
fn clone_from(&mut self, source: &Self)
source
. Read more
impl Debug for Assume
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
impl PartialEq for Assume
fn eq(&self, other: &Assume) -> bool
self
and other
values to be equal, and is used by ==
.
fn ne(&self, other: &Rhs) -> bool
!=
. The default implementation is almost always sufficient, and should not be overridden without very good reason.
impl Sub for Assume
type Output = Assume
-
operator.
fn sub(self, other_assumptions: Assume) -> Assume
-
operation. Read more
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
impl<T> Any for T
where
T: 'static + ?Sized,
impl<T> Borrow<T> for T
where
T: ?Sized,
impl<T> BorrowMut<T> for T
where
T: ?Sized,
impl<T> From<T> for T
fn from(t: T) -> T
Returns the argument unchanged.
impl<T, U> Into<U> for T
where
U: From<T>,
fn into(self) -> U
Calls U::from(self)
.
That is, this conversion is whatever the implementation of From<T> for U
chooses to do.
impl<T> ToOwned for T
where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)
impl<T, U> TryFrom<U> for T
where
U: Into<T>,
type Error = Infallible
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for T
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/mem/struct.Assume.html