#[repr(u8)]
pub enum LogicMatrix {
Show 16 variants False = 0, And = 1, AndNot = 2, P = 3, NotAnd = 4, Q = 5, Xor = 6, Or = 7, Nor = 8, Xnor = 9, NotQ = 10, OrNot = 11, NotP = 12, NotOr = 13, Nand = 14, True = 15,
}
Expand description

Variants of all logical operators.

Variants§

§

False = 0

  1. always false
§

And = 1

  1. p and q ∧
§

AndNot = 2

  1. p and not q >
§

P = 3

  1. p ⊣
§

NotAnd = 4

  1. not p and q <
§

Q = 5

  1. q ⊢
§

Xor = 6

  1. xor ≠
§

Or = 7

  1. p or q ∨
§

Nor = 8

  1. not p and not q ⍱
§

Xnor = 9

  1. p == q
§

NotQ = 10

  1. not q ~⊢
§

OrNot = 11

  1. p or not q ≥
§

NotP = 12

  1. not p ~⊣
§

NotOr = 13

  1. not p or q ≤
§

Nand = 14

  1. not p or not q ⍲
§

True = 15

  1. always true

Implementations§

source§

impl LogicMatrix

source

pub fn perform_logic(&self, p: bool, q: bool) -> bool

Use as a binary operator

source

pub fn perform_byte(&self, p: u8, q: u8) -> u8

Use on byte, bit by bit

source

pub fn as_str(&self) -> &'static str

Convert to string if is a binary operator

Trait Implementations§

source§

impl Clone for LogicMatrix

source§

fn clone(&self) -> LogicMatrix

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LogicMatrix

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<LogicMatrix> for ValkyrieOperator

source§

fn from(logic: LogicMatrix) -> Self

Converts to this type from the input type.
source§

impl Hash for LogicMatrix

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for LogicMatrix

source§

fn cmp(&self, other: &LogicMatrix) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for LogicMatrix

source§

fn eq(&self, other: &LogicMatrix) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for LogicMatrix

source§

fn partial_cmp(&self, other: &LogicMatrix) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for LogicMatrix

source§

impl Eq for LogicMatrix

source§

impl StructuralPartialEq for LogicMatrix

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.