struct Bool

Overview

Bool has only two possible values: true and false. They are constructed using these literals:

true  # A Bool that is true
false # A Bool that is false

See Bool literals in the language reference.

Defined in:

ssz/codec.cr
ssz/hash_tree_root.cr

Constant Summary

TRUE_HASH_TREE_ROOT = Bytes.new(SSZ::BYTES_PER_CHUNK) do |i| i == 0 ? 1_u8 : 0_u8 end

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Object

ssz_basic? : Bool ssz_basic?, ssz_encode(io : IO)
ssz_encode : Bytes
ssz_encode
, ssz_fixed? : Bool ssz_fixed?, ssz_size : Int32 ssz_size, ssz_variable? : Bool ssz_variable?

Class methods inherited from class Object

ssz_basic? : Bool ssz_basic?, ssz_decode(io : IO, size : Int32 = 0)
ssz_decode(bytes : Bytes)
ssz_decode
, ssz_fixed? : Bool ssz_fixed?, ssz_variable? : Bool ssz_variable?

Constructor Detail

def self.ssz_basic? : Bool #

[View source]
def self.ssz_variable? : Bool #

[View source]

Class Method Detail

def self.ssz_decode(bytes : Bytes) #

[View source]
def self.ssz_decode(io : IO, size : Int32 = 0) #

[View source]

Instance Method Detail

def hash_tree_root : Bytes #

[View source]
def ssz_basic? : Bool #

[View source]
def ssz_encode(io : IO) #

[View source]
def ssz_encode : Bytes #

[View source]
def ssz_size : Int32 #

[View source]
def ssz_variable? : Bool #

[View source]