Module std::bool

The bool module contains useful code to help work with boolean values.

A quick summary:

Trait implementations for bool

Implementations of the following traits:

Various functions to compare bools

All of the standard comparison functions one would expect: and, eq, or, and more.

Also, a few conversion functions: to_bit and to_str.

Finally, some inquiries into the nature of truth: is_true and is_false.

Functions

all_values

Iterates over all truth values, passing them to the given block.

and

Conjunction of two boolean values.

implies

Implication between two boolean values.

is_false

Is a given boolean value false?

is_true

Is a given boolean value true?

not

Negation of a boolean value.

or

Disjunction of two boolean values.

to_bit

Convert a bool to a u8.

xor

An 'exclusive or' of two boolean values.