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.compare
Section titled “True.compare”impl Comparable
fn compare(a: True, b: True): Ordering
impl Comparable.compare
True.to_string
Section titled “True.to_string”impl Display
fn to_string(value: True): String
impl Display.to_string
True.equal?
Section titled “True.equal?”impl Equatable
fn equal?(a: True, b: True): Bool
impl Equatable.equal?
True.hash
Section titled “True.hash”impl Hashable
fn hash(value: True): Int
impl Hashable.hash
True.inspect
Section titled “True.inspect”impl Debug
fn inspect(value: True): String
impl Debug.inspect
type False
Section titled “type False”type False
Singleton type representing the boolean false value; a variant of Bool.
False.compare
Section titled “False.compare”impl Comparable
fn compare(a: False, b: False): Ordering
impl Comparable.compare
False.to_string
Section titled “False.to_string”impl Display
fn to_string(value: False): String
impl Display.to_string
False.equal?
Section titled “False.equal?”impl Equatable
fn equal?(a: False, b: False): Bool
impl Equatable.equal?
False.hash
Section titled “False.hash”impl Hashable
fn hash(value: False): Int
impl Hashable.hash
False.inspect
Section titled “False.inspect”impl Debug
fn inspect(value: False): String
impl Debug.inspect
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.compare
Section titled “Bool.compare”impl Comparable
fn compare(a: Bool, b: Bool): Ordering
impl Comparable.compare
Bool.to_string
Section titled “Bool.to_string”impl Display
fn to_string(value: Bool): String
impl Display.to_string
Bool.equal?
Section titled “Bool.equal?”impl Equatable
fn equal?(a: Bool, b: Bool): Bool
impl Equatable.equal?
Bool.hash
Section titled “Bool.hash”impl Hashable
fn hash(value: Bool): Int
impl Hashable.hash
Bool.inspect
Section titled “Bool.inspect”impl Debug
fn inspect(value: Bool): String
impl Debug.inspect