std/bool
Import with import std/bool.
Exports
Section titled “Exports”type True
Section titled “type True”type True
Singleton type representing the boolean true value; a variant of Bool.
True.inspect
Section titled “True.inspect”fn inspect(value: True): String
impl Debug.inspect
True.compare
Section titled “True.compare”fn compare(a: True, b: True): Ordering
impl Comparable.compare
True.to_string
Section titled “True.to_string”fn to_string(value: True): String
impl Display.to_string
True.equal?
Section titled “True.equal?”fn equal?(a: True, b: True): Bool
impl Equatable.equal?
True.hash
Section titled “True.hash”fn hash(value: True): Int
impl Hashable.hash
type False
Section titled “type False”type False
Singleton type representing the boolean false value; a variant of Bool.
False.inspect
Section titled “False.inspect”fn inspect(value: False): String
impl Debug.inspect
False.compare
Section titled “False.compare”fn compare(a: False, b: False): Ordering
impl Comparable.compare
False.to_string
Section titled “False.to_string”fn to_string(value: False): String
impl Display.to_string
False.equal?
Section titled “False.equal?”fn equal?(a: False, b: False): Bool
impl Equatable.equal?
False.hash
Section titled “False.hash”fn hash(value: False): Int
impl Hashable.hash
enum Bool
Section titled “enum Bool”enum Bool { embeds False embeds True }
Boolean enum with True and False variants.
Interactive Tests
assert True == True
refute True == False
Bool.inspect
Section titled “Bool.inspect”fn inspect(value: Bool): String
impl Debug.inspect
Bool.compare
Section titled “Bool.compare”fn compare(a: Bool, b: Bool): Ordering
impl Comparable.compare
Bool.to_string
Section titled “Bool.to_string”fn to_string(value: Bool): String
impl Display.to_string
Bool.equal?
Section titled “Bool.equal?”fn equal?(a: Bool, b: Bool): Bool
impl Equatable.equal?
Bool.hash
Section titled “Bool.hash”fn hash(value: Bool): Int
impl Hashable.hash