::core::

Primitive tri

Expand

LOW, HIGH or HIGHIMP

Implementations

impl tri
pub fn as_bool(self) -> bool

Casts a tri to a bool by reinterpreting its bit.

LOW and HIGH map to true and false respectively, but the result for HIGHIMP is undefined. In practice, in a simulator, it remains a high impedance value.

Examples

assert LOW.as_bool() == false;
assert HIGH.as_bool() == true;
pub fn to_bool(self) -> bool

Casts a tri to a bool by reinterpreting its bit.

LOW and HIGH map to true and false respectively, but the result for HIGHIMP is undefined. In practice, in a simulator, it remains a high impedance value.

Examples

assert LOW.to_bool() == false;
assert HIGH.to_bool() == true;