[−][src]Enum bool::Bool
Enum with two possible values: True
or False
which represent the logical
values true
and false
respectively.
Variants
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:
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<Bool> for Bool
[src]
type Output = Self
The resulting type after applying the &
operator.
fn bitand(self, rhs: Self) -> Self::Output
[src]
impl BitAndAssign<Bool> for Bool
[src]
fn bitand_assign(&mut self, rhs: Self)
[src]
impl BitOr<Bool> for Bool
[src]
type Output = Self
The resulting type after applying the |
operator.
fn bitor(self, rhs: Self) -> Self::Output
[src]
impl BitOrAssign<Bool> for Bool
[src]
fn bitor_assign(&mut self, rhs: Self)
[src]
impl BitXor<Bool> for Bool
[src]
type Output = Self
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: Self) -> Self::Output
[src]
impl BitXorAssign<Bool> for Bool
[src]
fn bitxor_assign(&mut self, rhs: Self)
[src]
impl Clone for Bool
[src]
fn clone(&self) -> Bool
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Bool
[src]
impl Debug for Bool
[src]
impl Default for Bool
[src]
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.
fn not(self) -> Self::Output
[src]
impl Ord for Bool
[src]
fn cmp(&self, other: &Bool) -> 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<Bool> for Bool
[src]
impl PartialOrd<Bool> for Bool
[src]
fn partial_cmp(&self, other: &Bool) -> 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 Bool
[src]
impl StructuralPartialEq for Bool
[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, 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>,