[][src]Module type_freak::boolean

Trait level boolean algebra.

This module reuses True and False types from typenum. It provides common logic arithmetic boolean operators: Not, And, Or, Xor and Iff.

use typenum::{True, False};
use type_freak::boolean::*;

type L = True;
type R = False;

type R1 = Not<L>;          // False
type R2 = And<L, R>;       // False
type R3 = Or<L, R>;        // True
type R4 = Xor<L, R>;       // True
type R5 = Iff<L, R>;       // False
type R6 = Imply<L, R>;     // False
type R7 = NotImply<L, R>;  // True

fn get_value() -> bool {
    R1::BOOL  // Get constant value
}

Structs

AndComposePredicate

A Predicate that meets input pair (Lhs, Rhs) with Boolean type.

AndPredicate

A Predicate that meets input and Rhs with Boolean type.

IffComposePredicate

A Predicate that returns if pair of input types (Lhs, Rhs) have same Boolean value.

IffPredicate

A Predicate that returns of both input and Rhs have same Boolean values.

ImplyComposePredicate

A Predicate that computes if Lhs implies Rhs for input pair (Lhs, Rhs).

ImplyPredicate

A Predicate that returns if input implies to Rhs.

NotImplyComposePredicate

A Predicate that computes if Lhs is true while Rhs is false for input pair (Lhs, Rhs).

NotImplyPredicate

A Predicate that returns if input is true while Rhs is false.

NotPredicate

A Predicate that inverts Boolean types.

OrComposePredicate

A Predicate that joins input pair (Lhs, Rhs) with Boolean type.

OrPredicate

A Predicate that joins input and Rhs with Boolean type.

XorComposePredicate

A Predicate that computes exclusive-or on input pair (Lhs, Rhs).

XorPredicate

A Predicate that computes exclusive-or on input and Rhs with Boolean types.

Traits

Boolean

A trait that provides boolean constant value.

Type Definitions

And
AndCompose
Iff
IffCompose
Imply
ImplyCompose
Not
NotImply
NotImplyCompose
Or
OrCompose
Xor
XorCompose