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
[src]
Returns true
only if self
is True
fn is_false(self) -> bool
[src]
Returns true
only if self
is False
fn is_indeterminate(self) -> bool
[src]
Returns true
only if self
is Indeterminate
fn equals(self, rhs: Tribool) -> Tribool
[src]
Checks for equality of two Tribool
s,
returning Indeterminate
if either are indeterminate.
fn not_equals(self, rhs: Tribool) -> Tribool
[src]
Checks for inequality of two Tribool
s,
returning Indeterminate
if either are indeterminate.
fn kleene_implication(self, b: Tribool) -> Tribool
[src]
Material implication using Kleene Logic.
This is equivalent to NOT(A) OR B
.
fn lukasiewicz_implication(self, b: Tribool) -> Tribool
[src]
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
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
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)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
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, ()>
[src]
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
[src]
Formats the value using the given formatter. Read more
impl<B: Into<Tribool> + Copy> PartialEq<B> for Tribool
[src]
fn eq(&self, rhs: &B) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &B) -> bool
[src]
This method tests for !=
.
impl<B: Into<Tribool> + Copy> PartialOrd<B> for Tribool
[src]
fn partial_cmp(&self, rhs: &B) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, rhs: &B) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, rhs: &B) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, rhs: &B) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, rhs: &B) -> bool
[src]
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
[src]
Performs the unary !
operation.
impl<B: Into<Tribool>> BitAnd<B> for Tribool
[src]
type Output = Tribool
The resulting type after applying the &
operator.
fn bitand(self, rhs: B) -> Tribool
[src]
Performs the &
operation.
impl<B: Into<Tribool>> BitOr<B> for Tribool
[src]
type Output = Tribool
The resulting type after applying the |
operator.
fn bitor(self, rhs: B) -> Tribool
[src]
Performs the |
operation.
impl<B: Into<Tribool>> BitXor<B> for Tribool
[src]
type Output = Tribool
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: B) -> Tribool
[src]
Performs the ^
operation.
impl<B: Into<Tribool>> BitAndAssign<B> for Tribool
[src]
fn bitand_assign(&mut self, rhs: B)
[src]
Performs the &=
operation.
impl<B: Into<Tribool>> BitOrAssign<B> for Tribool
[src]
fn bitor_assign(&mut self, rhs: B)
[src]
Performs the |=
operation.
impl<B: Into<Tribool>> BitXorAssign<B> for Tribool
[src]
fn bitxor_assign(&mut self, rhs: B)
[src]
Performs the ^=
operation.
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
[src]
Performs the unary !
operation.
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
[src]
Performs the &
operation.
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
[src]
Performs the &
operation.
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
[src]
Performs the &
operation.
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
[src]
Performs the |
operation.
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
[src]
Performs the |
operation.
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
[src]
Performs the |
operation.
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
[src]
Performs the ^
operation.
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
[src]
Performs the ^
operation.
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
[src]
Performs the ^
operation.
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
[src]
Performs the &
operation.
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
[src]
Performs the &
operation.
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
[src]
Performs the &
operation.
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
[src]
Performs the |
operation.
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
[src]
Performs the |
operation.
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
[src]
Performs the |
operation.
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
[src]
Performs the ^
operation.
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
[src]
Performs the ^
operation.