pub struct Assume {
pub alignment: bool,
pub lifetimes: bool,
pub safety: bool,
pub validity: bool,
}
🔬This is a nightly-only experimental API. (
transmutability
#99571)Expand description
编译器应假定 你 正在检查哪些转换安全条件?
Fields§
§alignment: bool
🔬This is a nightly-only experimental API. (
transmutability
#99571)当 true
时,编译器假定 你 确保 (动态或静态) 目标引用对象没有比源引用对象更严格的对齐要求。
lifetimes: bool
🔬This is a nightly-only experimental API. (
transmutability
#99571)当 true
时,编译器假设 你 确保生命周期不会以违反 Rust 内存模型的方式扩展。
safety: bool
🔬This is a nightly-only experimental API. (
transmutability
#99571)当 true
时,编译器假定 你 已确保您可以安全地违反目标类型 (有时也是源类型) 的类型和字段隐私。
validity: bool
🔬This is a nightly-only experimental API. (
transmutability
#99571)当 true
时,编译器假定 你 确保源类型实际上是目标类型的有效实例。
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
#99571)
pub const NOTHING: Assume = Self{ alignment: false, lifetimes: false, safety: false, validity: false,}
transmutability
#99571)不要假设您已确保满足任何安全属性。
sourcepub const ALIGNMENT: Assume = Self{ alignment: true, ..Self::NOTHING}
🔬This is a nightly-only experimental API. (transmutability
#99571)
pub const ALIGNMENT: Assume = Self{ alignment: true, ..Self::NOTHING}
transmutability
#99571)仅假设满足对齐条件。
sourcepub const LIFETIMES: Assume = Self{ lifetimes: true, ..Self::NOTHING}
🔬This is a nightly-only experimental API. (transmutability
#99571)
pub const LIFETIMES: Assume = Self{ lifetimes: true, ..Self::NOTHING}
transmutability
#99571)假设仅满足生命周期条件。
sourcepub const SAFETY: Assume = Self{ safety: true, ..Self::NOTHING}
🔬This is a nightly-only experimental API. (transmutability
#99571)
pub const SAFETY: Assume = Self{ safety: true, ..Self::NOTHING}
transmutability
#99571)仅假设满足安全条件。
sourcepub const VALIDITY: Assume = Self{ validity: true, ..Self::NOTHING}
🔬This is a nightly-only experimental API. (transmutability
#99571)
pub const VALIDITY: Assume = Self{ validity: true, ..Self::NOTHING}
transmutability
#99571)仅假设满足动态可满足的有效性条件。
Trait Implementations§
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> 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
从拥有的值中借用。 Read more