pub enum Effect {
Pure,
MayRead,
MayThrow,
MayWrite,
Unknown,
}Variants§
Pure
无可观察效果、结果确定。可自由移动/重求值。
MayRead
只读(局部变量等)。与纯读之间可重排;被写依赖阻断。
MayThrow
可能抛异常 / 读堆内存(字段、数组)等。
MayWrite
可能写内存。
Unknown
完全未知(未知调用等)。一律视为不可简化。
Implementations§
Trait Implementations§
impl Copy for Effect
impl Eq for Effect
Source§impl Ord for Effect
impl Ord for Effect
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Effect
impl PartialOrd for Effect
impl StructuralPartialEq for Effect
Auto Trait Implementations§
impl Freeze for Effect
impl RefUnwindSafe for Effect
impl Send for Effect
impl Sync for Effect
impl Unpin for Effect
impl UnsafeUnpin for Effect
impl UnwindSafe for Effect
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
Mutably borrows from an owned value. Read more