Skip to content

std::bool

Import with import std::bool.

type True

Singleton type representing the boolean true value; a variant of Bool.

impl Debug for True

fn inspect(value: True) -> String

impl Debug.inspect

impl Comparable for True

fn compare(a: True, b: True) -> Ordering

impl Comparable.compare

impl Display for True

fn to_string(value: True) -> String

impl Display.to_string

impl Equatable for True

fn equal(a: True, b: True) -> Bool

impl Equatable.equal

impl Hashable for True

fn hash(value: True) -> Int

impl Hashable.hash

type False

Singleton type representing the boolean false value; a variant of Bool.

impl Debug for False

fn inspect(value: False) -> String

impl Debug.inspect

impl Comparable for False

fn compare(a: False, b: False) -> Ordering

impl Comparable.compare

impl Display for False

fn to_string(value: False) -> String

impl Display.to_string

impl Equatable for False

fn equal(a: False, b: False) -> Bool

impl Equatable.equal

impl Hashable for False

fn hash(value: False) -> Int

impl Hashable.hash

enum Bool
    embeds False
    embeds True
end

Boolean enum with True and False variants.

assert True == True
refute True == False

impl Debug for Bool

fn inspect(b: Bool) -> String

impl Debug.inspect

True or False, the same text as Display: a Bool’s literal is its user-facing form.

assert Debug.inspect(True) == "True"
assert Debug.inspect(False) == Display.to_string(False)

impl Comparable for Bool

fn compare(a: Bool, b: Bool) -> Ordering

impl Comparable.compare

impl Display for Bool

fn to_string(value: Bool) -> String

impl Display.to_string

impl Equatable for Bool

fn equal(a: Bool, b: Bool) -> Bool

impl Equatable.equal

impl Hashable for Bool

fn hash(value: Bool) -> Int

impl Hashable.hash