[][src]Enum bool::Bool

pub enum Bool {
    False,
    True,
}

Enum with two possible values: True or False which represent the logical values true and false respectively.

Variants

False
True

Methods

impl Bool[src]

pub fn new(value: bool) -> Self[src]

Creates a Bool dependent on the given primitive bool. If the value is true, it will return Bool::True and if the value isfalse will return Bool::False

pub fn and<R: Into<Self>>(self, rhs: R) -> Self[src]

The logical and operation.

Truth table:

selfrhsoutput
TrueTrueTrue
TrueFalseFalse
FalseTrueFalse
FalseFalseFalse

pub fn or<R: Into<Self>>(self, rhs: R) -> Self[src]

The logical or operation.

Truth table:

selfrhsoutput
TrueTrueTrue
TrueFalseTrue
FalseTrueTrue
FalseFalseFalse

pub fn not(self) -> Self[src]

The logical not operation.

Truth table:

selfoutput
TrueFalse
FalseTrue

pub fn implication<R: Into<Self>>(self, rhs: R) -> Self[src]

The logical [implication] operation.

Truth table:

selfrhsoutput
TrueTrueTrue
TrueFalseFalse
FalseTrueTrue
FalseFalseTrue

pub fn xor<R: Into<Self>>(self, rhs: R) -> Self[src]

The logical xor operation.

Truth table:

selfrhsoutput
TrueTrueFalse
TrueFalseTrue
FalseTrueTrue
FalseFalseFalse

pub fn equivalence<R: Into<Self>>(self, rhs: R) -> Self[src]

The logical equivalence operation.

Truth table:

selfrhsoutput
TrueTrueTrue
TrueFalseFalse
FalseTrueFalse
FalseFalseTrue

pub fn is_true(self) -> bool[src]

pub fn is_false(self) -> bool[src]

pub fn then_some<T>(self, then: T) -> Option<T>[src]

pub fn then<T>(self, f: impl FnOnce() -> T) -> Option<T>[src]

Trait Implementations

impl BitAnd<Bool> for Bool[src]

type Output = Self

The resulting type after applying the & operator.

impl BitAndAssign<Bool> for Bool[src]

impl BitOr<Bool> for Bool[src]

type Output = Self

The resulting type after applying the | operator.

impl BitOrAssign<Bool> for Bool[src]

impl BitXor<Bool> for Bool[src]

type Output = Self

The resulting type after applying the ^ operator.

impl BitXorAssign<Bool> for Bool[src]

impl Clone for Bool[src]

impl Copy for Bool[src]

impl Debug for Bool[src]

impl Default for Bool[src]

The default for Bool is False.

impl Eq for Bool[src]

impl<'_> From<&'_ Bool> for bool[src]

impl<'_> From<&'_ mut Bool> for bool[src]

impl From<Bool> for bool[src]

impl From<bool> for Bool[src]

impl Not for Bool[src]

type Output = Self

The resulting type after applying the ! operator.

impl Ord for Bool[src]

impl PartialEq<Bool> for Bool[src]

impl PartialOrd<Bool> for Bool[src]

impl StructuralEq for Bool[src]

impl StructuralPartialEq for Bool[src]

Auto Trait Implementations

impl Send for Bool

impl Sync for Bool

impl Unpin for Bool

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.