pub struct LogicObs {
pub short: bool,
pub rhs_true: bool,
pub rhs_false: bool,
pub rhs_started: bool,
}Expand description
What the tests observed at a && b / a || b.
Fields§
§short: boolThe left operand decided alone (false for &&, true for ||).
rhs_true: bool§rhs_false: bool§rhs_started: boolThe right operand was started. Where it gave no value (a panic, a ?, a
return) this is all there is to see of the expression having been executed.
Implementations§
Source§impl LogicObs
impl LogicObs
pub fn from_bits(bits: u8) -> LogicObs
pub fn merge(&mut self, other: &LogicObs)
pub fn reached(&self) -> bool
Sourcepub fn constant_value(&self, and: bool) -> Option<bool>
pub fn constant_value(&self, and: bool) -> Option<bool>
The value of the whole expression, if it was the same in every observation.
Sourcepub fn swap_never_changes_value(&self, and: bool) -> bool
pub fn swap_never_changes_value(&self, and: bool) -> bool
Every observed evaluation produced a boolean value where a && b == a || b
(all (false, false) for ||, or all (true, true) for &&).
When the right operand only started without producing a value (panic / early exit),
swapping the operator skips that evaluation, so this returns false.
Trait Implementations§
impl Copy for LogicObs
impl Eq for LogicObs
impl StructuralPartialEq for LogicObs
Auto Trait Implementations§
impl Forget for LogicObs
impl Freeze for LogicObs
impl Move for LogicObs
impl RefUnwindSafe for LogicObs
impl Send for LogicObs
impl Sync for LogicObs
impl Unpin for LogicObs
impl UnsafeUnpin for LogicObs
impl UnwindSafe for LogicObs
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.