[−][src]Enum boolean::Boolean
Enum with two possible values: True
or False
which represent the logical
values true
and false
respectively.
Variants
Implementations
impl Boolean
[src]
pub fn new(value: bool) -> Self
[src]
Creates a Boolean
based on the given primitive bool
.
If the value is true
, it will return Boolean::True
and
if the value isfalse
will return Boolean::False
pub fn and<R: Into<Self>>(self, rhs: R) -> Self
[src]
The logical and
operation.
Truth table:
self | rhs | output |
---|---|---|
True | True | True |
True | False | False |
False | True | False |
False | False | False |
pub fn or<R: Into<Self>>(self, rhs: R) -> Self
[src]
The logical or
operation.
Truth table:
self | rhs | output |
---|---|---|
True | True | True |
True | False | True |
False | True | True |
False | False | False |
pub fn not(self) -> Self
[src]
pub fn implication<R: Into<Self>>(self, rhs: R) -> Self
[src]
The logical [implication
] operation.
Truth table:
self | rhs | output |
---|---|---|
True | True | True |
True | False | False |
False | True | True |
False | False | True |
pub fn xor<R: Into<Self>>(self, rhs: R) -> Self
[src]
The logical xor
operation.
Truth table:
self | rhs | output |
---|---|---|
True | True | False |
True | False | True |
False | True | True |
False | False | False |
pub fn equivalence<R: Into<Self>>(self, rhs: R) -> Self
[src]
The logical equivalence
operation.
Truth table:
self | rhs | output |
---|---|---|
True | True | True |
True | False | False |
False | True | False |
False | False | True |
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<Boolean> for Boolean
[src]
type Output = Self
The resulting type after applying the &
operator.
fn bitand(self, rhs: Self) -> Self::Output
[src]
impl BitAndAssign<Boolean> for Boolean
[src]
fn bitand_assign(&mut self, rhs: Self)
[src]
impl BitOr<Boolean> for Boolean
[src]
type Output = Self
The resulting type after applying the |
operator.
fn bitor(self, rhs: Self) -> Self::Output
[src]
impl BitOrAssign<Boolean> for Boolean
[src]
fn bitor_assign(&mut self, rhs: Self)
[src]
impl BitXor<Boolean> for Boolean
[src]
type Output = Self
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: Self) -> Self::Output
[src]
impl BitXorAssign<Boolean> for Boolean
[src]
fn bitxor_assign(&mut self, rhs: Self)
[src]
impl Clone for Boolean
[src]
fn clone(&self) -> Boolean
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Boolean
[src]
impl Debug for Boolean
[src]
impl Default for Boolean
[src]
impl Eq for Boolean
[src]
impl<'_> From<&'_ Boolean> for bool
[src]
impl<'_> From<&'_ mut Boolean> for bool
[src]
impl From<Boolean> for bool
[src]
impl From<bool> for Boolean
[src]
impl FromStr for Boolean
[src]
type Err = BooleanError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
Important: if the crate has the alloc crate is available and the 'has_alloc' feature is enabled, it allows for a "true" or "false" value with any casing (e.g. "True" or "trUE" are equivalent to "true"). If the feature 'has_alloc' is set to false, only the values "true", "True", "TRUE", "false", "False" and "FALSE" will be accepted as valid inputs.
impl Not for Boolean
[src]
type Output = Self
The resulting type after applying the !
operator.
fn not(self) -> Self::Output
[src]
impl Ord for Boolean
[src]
fn cmp(&self, other: &Boolean) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Boolean> for Boolean
[src]
impl PartialOrd<Boolean> for Boolean
[src]
fn partial_cmp(&self, other: &Boolean) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for Boolean
[src]
impl StructuralPartialEq for Boolean
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,