variadic

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2021 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Uint64OrHash

type Uint64OrHash struct {
	// contains filtered or unexported fields
}

Uint64OrHash represents an optional interface type (int,hash).

func NewUint64OrHash

func NewUint64OrHash(value interface{}) (*Uint64OrHash, error)

NewUint64OrHash returns a new variadic.Uint64OrHash given an int, uint64, or Hash

func NewUint64OrHashFromBytes

func NewUint64OrHashFromBytes(data []byte) *Uint64OrHash

NewUint64OrHashFromBytes returns a new variadic.Uint64OrHash from an encoded variadic uint64 or hash

func (*Uint64OrHash) Decode

func (x *Uint64OrHash) Decode(r io.Reader) error

Decode will decode the Uint64OrHash into a hash or uint64

func (*Uint64OrHash) Encode

func (x *Uint64OrHash) Encode() ([]byte, error)

Encode will encode a uint64 or hash into the SCALE spec

func (*Uint64OrHash) Hash added in v0.3.0

func (x *Uint64OrHash) Hash() common.Hash

Hash returns the value as a common.Hash. it panics if the value is not a hash.

func (*Uint64OrHash) IsHash added in v0.3.0

func (x *Uint64OrHash) IsHash() bool

IsHash returns true if the value is a hash

func (*Uint64OrHash) IsUint64 added in v0.3.0

func (x *Uint64OrHash) IsUint64() bool

IsUint64 returns true if the value is a hash

func (*Uint64OrHash) Uint64 added in v0.3.0

func (x *Uint64OrHash) Uint64() uint64

Uint64 returns the value as a uint64. it panics if the value is not a hash.

func (*Uint64OrHash) Value

func (x *Uint64OrHash) Value() interface{}

Value returns the interface value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL