Enum ruststep::primitive::Logical [−][src]
pub enum Logical {
False,
Unknown,
True,
}
Expand description
LOGICAL
type
use ruststep::primitive::Logical;
// Default
assert_eq!(Logical::default(), Logical::Unknown);
// From<bool>
assert_eq!(Logical::True, true.into());
assert_eq!(Logical::False, false.into());
// From<Option<bool>>
assert_eq!(Logical::True, Some(true).into());
assert_eq!(Logical::False, Some(false).into());
assert_eq!(Logical::Unknown, None.into());
// Not
assert_eq!(Logical::True, !Logical::False);
assert_eq!(Logical::False, !Logical::True);
assert_eq!(Logical::Unknown, !Logical::Unknown);
// BitAnd
assert_eq!(Logical::True & Logical::True, Logical::True);
assert_eq!(Logical::True & Logical::Unknown, Logical::Unknown);
assert_eq!(Logical::True & Logical::False, Logical::False);
assert_eq!(Logical::False & Logical::True, Logical::False);
assert_eq!(Logical::False & Logical::Unknown, Logical::False);
assert_eq!(Logical::False & Logical::False, Logical::False);
assert_eq!(Logical::Unknown & Logical::True, Logical::Unknown);
assert_eq!(Logical::Unknown & Logical::Unknown, Logical::Unknown);
assert_eq!(Logical::Unknown & Logical::False, Logical::False);
// BitOr
assert_eq!(Logical::True | Logical::True, Logical::True);
assert_eq!(Logical::True | Logical::Unknown, Logical::True);
assert_eq!(Logical::True | Logical::False, Logical::True);
assert_eq!(Logical::False | Logical::True, Logical::True);
assert_eq!(Logical::False | Logical::Unknown, Logical::Unknown);
assert_eq!(Logical::False | Logical::False, Logical::False);
assert_eq!(Logical::Unknown | Logical::True, Logical::True);
assert_eq!(Logical::Unknown | Logical::Unknown, Logical::Unknown);
assert_eq!(Logical::Unknown | Logical::False, Logical::Unknown);
// BitXor
assert_eq!(Logical::True ^ Logical::True, Logical::False);
assert_eq!(Logical::True ^ Logical::Unknown, Logical::Unknown);
assert_eq!(Logical::True ^ Logical::False, Logical::True);
assert_eq!(Logical::False ^ Logical::True, Logical::True);
assert_eq!(Logical::False ^ Logical::Unknown, Logical::Unknown);
assert_eq!(Logical::False ^ Logical::False, Logical::False);
assert_eq!(Logical::Unknown ^ Logical::True, Logical::Unknown);
assert_eq!(Logical::Unknown ^ Logical::Unknown, Logical::Unknown);
assert_eq!(Logical::Unknown ^ Logical::False, Logical::Unknown);
Variants
Trait Implementations
Deserialize this value from the given Serde deserializer. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Logical
impl UnwindSafe for Logical
Blanket Implementations
Mutably borrows from an owned value. Read more