Enum tribool::Tribool
[−]
[src]
pub enum Tribool { True, False, Indeterminate, }
Three-state Boolean logic
Variants
True
Truth value
False
False value
Indeterminate
Unknown/Indeterminate value
Methods
impl Tribool
[src]
fn is_true(self) -> bool
Returns true
only if self
is True
fn is_false(self) -> bool
Returns true
only if self
is False
fn is_indeterminate(self) -> bool
Returns true
only if self
is Indeterminate
fn equals(self, rhs: Tribool) -> Tribool
Checks for equality of two Tribool
s,
returning Indeterminate
if either are indeterminate.
fn not_equals(self, rhs: Tribool) -> Tribool
Checks for inequality of two Tribool
s,
returning Indeterminate
if either are indeterminate.
fn kleene_implication(self, b: Tribool) -> Tribool
Material implication using Kleene Logic.
This is equivalent to NOT(A) OR B
.
fn lukasiewicz_implication(self, b: Tribool) -> Tribool
Material implication using Łukasiewicz Logic
The Łukasiewicz Ł3 has the same tables for AND, OR, and NOT as the Kleene logic used elsewhere, but differs in its definition of implication in that "unknown implies unknown" is true.
For more information, see the Wikipedia page and the section on Łukasiewicz Logic
Trait Implementations
impl Debug for Tribool
[src]
impl Clone for Tribool
[src]
fn clone(&self) -> Tribool
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for Tribool
[src]
impl Hash for Tribool
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Default for Tribool
[src]
impl FromStr for Tribool
[src]
type Err = ()
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Tribool, ()>
Parses a string s
to return a value of this type. Read more
impl Display for Tribool
[src]
fn fmt(&self, f: &mut Formatter) -> FmtResult
Formats the value using the given formatter. Read more
impl PartialEq<Self> for Tribool
[src]
fn eq(&self, rhs: &Tribool) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &Tribool) -> bool
This method tests for !=
.
impl Eq for Tribool
[src]
impl PartialEq<bool> for Tribool
[src]
fn eq(&self, rhs: &bool) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &bool) -> bool
This method tests for !=
.
impl PartialOrd<Self> for Tribool
[src]
fn partial_cmp(&self, rhs: &Tribool) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, rhs: &Tribool) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, rhs: &Tribool) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, rhs: &Tribool) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, rhs: &Tribool) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl PartialOrd<bool> for Tribool
[src]
fn partial_cmp(&self, rhs: &bool) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, rhs: &bool) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, rhs: &bool) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, rhs: &bool) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, rhs: &bool) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Not for Tribool
[src]
type Output = Tribool
The resulting type after applying the !
operator
fn not(self) -> Tribool
The method for the unary !
operator
impl BitAnd<Self> for Tribool
[src]
type Output = Tribool
The resulting type after applying the &
operator
fn bitand(self, rhs: Tribool) -> Tribool
The method for the &
operator
impl BitOr<Self> for Tribool
[src]
type Output = Tribool
The resulting type after applying the |
operator
fn bitor(self, rhs: Tribool) -> Tribool
The method for the |
operator
impl BitXor<Self> for Tribool
[src]
type Output = Tribool
The resulting type after applying the ^
operator
fn bitxor(self, rhs: Tribool) -> Tribool
The method for the ^
operator
impl BitAnd<bool> for Tribool
[src]
type Output = Tribool
The resulting type after applying the &
operator
fn bitand(self, rhs: bool) -> Tribool
The method for the &
operator
impl BitAndAssign<Self> for Tribool
[src]
fn bitand_assign(&mut self, rhs: Tribool)
The method for the &=
operator
impl BitAndAssign<bool> for Tribool
[src]
fn bitand_assign(&mut self, rhs: bool)
The method for the &=
operator
impl BitOr<bool> for Tribool
[src]
type Output = Tribool
The resulting type after applying the |
operator
fn bitor(self, rhs: bool) -> Tribool
The method for the |
operator
impl BitOrAssign<Self> for Tribool
[src]
fn bitor_assign(&mut self, rhs: Tribool)
The method for the |=
operator
impl BitOrAssign<bool> for Tribool
[src]
fn bitor_assign(&mut self, rhs: bool)
The method for the |=
operator
impl BitXor<bool> for Tribool
[src]
type Output = Tribool
The resulting type after applying the ^
operator
fn bitxor(self, rhs: bool) -> Tribool
The method for the ^
operator
impl BitXorAssign<Self> for Tribool
[src]
fn bitxor_assign(&mut self, rhs: Tribool)
The method for the ^=
operator
impl BitXorAssign<bool> for Tribool
[src]
fn bitxor_assign(&mut self, rhs: bool)
The method for the ^=
operator
impl From<bool> for Tribool
[src]
impl<'a> Not for &'a Tribool
[src]
type Output = <Tribool as Not>::Output
The resulting type after applying the !
operator
fn not(self) -> <Tribool as Not>::Output
The method for the unary !
operator
impl<'a> BitAnd<Tribool> for &'a Tribool
[src]
type Output = <Tribool as BitAnd<Tribool>>::Output
The resulting type after applying the &
operator
fn bitand(self, other: Tribool) -> <Tribool as BitAnd<Tribool>>::Output
The method for the &
operator
impl<'a> BitAnd<&'a Tribool> for Tribool
[src]
type Output = <Tribool as BitAnd<Tribool>>::Output
The resulting type after applying the &
operator
fn bitand(self, other: &'a Tribool) -> <Tribool as BitAnd<Tribool>>::Output
The method for the &
operator
impl<'a, 'b> BitAnd<&'a Tribool> for &'b Tribool
[src]
type Output = <Tribool as BitAnd<Tribool>>::Output
The resulting type after applying the &
operator
fn bitand(self, other: &'a Tribool) -> <Tribool as BitAnd<Tribool>>::Output
The method for the &
operator
impl<'a> BitOr<Tribool> for &'a Tribool
[src]
type Output = <Tribool as BitOr<Tribool>>::Output
The resulting type after applying the |
operator
fn bitor(self, other: Tribool) -> <Tribool as BitOr<Tribool>>::Output
The method for the |
operator
impl<'a> BitOr<&'a Tribool> for Tribool
[src]
type Output = <Tribool as BitOr<Tribool>>::Output
The resulting type after applying the |
operator
fn bitor(self, other: &'a Tribool) -> <Tribool as BitOr<Tribool>>::Output
The method for the |
operator
impl<'a, 'b> BitOr<&'a Tribool> for &'b Tribool
[src]
type Output = <Tribool as BitOr<Tribool>>::Output
The resulting type after applying the |
operator
fn bitor(self, other: &'a Tribool) -> <Tribool as BitOr<Tribool>>::Output
The method for the |
operator
impl<'a> BitXor<Tribool> for &'a Tribool
[src]
type Output = <Tribool as BitXor<Tribool>>::Output
The resulting type after applying the ^
operator
fn bitxor(self, other: Tribool) -> <Tribool as BitXor<Tribool>>::Output
The method for the ^
operator
impl<'a> BitXor<&'a Tribool> for Tribool
[src]
type Output = <Tribool as BitXor<Tribool>>::Output
The resulting type after applying the ^
operator
fn bitxor(self, other: &'a Tribool) -> <Tribool as BitXor<Tribool>>::Output
The method for the ^
operator
impl<'a, 'b> BitXor<&'a Tribool> for &'b Tribool
[src]
type Output = <Tribool as BitXor<Tribool>>::Output
The resulting type after applying the ^
operator
fn bitxor(self, other: &'a Tribool) -> <Tribool as BitXor<Tribool>>::Output
The method for the ^
operator
impl<'a> BitAnd<bool> for &'a Tribool
[src]
type Output = <Tribool as BitAnd<bool>>::Output
The resulting type after applying the &
operator
fn bitand(self, other: bool) -> <Tribool as BitAnd<bool>>::Output
The method for the &
operator
impl<'a> BitAnd<&'a bool> for Tribool
[src]
type Output = <Tribool as BitAnd<bool>>::Output
The resulting type after applying the &
operator
fn bitand(self, other: &'a bool) -> <Tribool as BitAnd<bool>>::Output
The method for the &
operator
impl<'a, 'b> BitAnd<&'a bool> for &'b Tribool
[src]
type Output = <Tribool as BitAnd<bool>>::Output
The resulting type after applying the &
operator
fn bitand(self, other: &'a bool) -> <Tribool as BitAnd<bool>>::Output
The method for the &
operator
impl<'a> BitOr<bool> for &'a Tribool
[src]
type Output = <Tribool as BitOr<bool>>::Output
The resulting type after applying the |
operator
fn bitor(self, other: bool) -> <Tribool as BitOr<bool>>::Output
The method for the |
operator
impl<'a> BitOr<&'a bool> for Tribool
[src]
type Output = <Tribool as BitOr<bool>>::Output
The resulting type after applying the |
operator
fn bitor(self, other: &'a bool) -> <Tribool as BitOr<bool>>::Output
The method for the |
operator
impl<'a, 'b> BitOr<&'a bool> for &'b Tribool
[src]
type Output = <Tribool as BitOr<bool>>::Output
The resulting type after applying the |
operator
fn bitor(self, other: &'a bool) -> <Tribool as BitOr<bool>>::Output
The method for the |
operator
impl<'a> BitXor<bool> for &'a Tribool
[src]
type Output = <Tribool as BitXor<bool>>::Output
The resulting type after applying the ^
operator
fn bitxor(self, other: bool) -> <Tribool as BitXor<bool>>::Output
The method for the ^
operator
impl<'a> BitXor<&'a bool> for Tribool
[src]
type Output = <Tribool as BitXor<bool>>::Output
The resulting type after applying the ^
operator
fn bitxor(self, other: &'a bool) -> <Tribool as BitXor<bool>>::Output
The method for the ^
operator