tuple

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsIndexOutOfBoundsError

func IsIndexOutOfBoundsError(err error) bool

IsIndexOutOfBoundsError returns true if input error is type of "IndexOutOfBounds".

Types

type Tuple

type Tuple interface {
	// First returns the first element in the Tuple.
	First() (reactor.Any, error)
	// Second returns the second element in the Tuple.
	Second() (reactor.Any, error)
	// Last returns the last element in the Tuple.
	Last() (reactor.Any, error)
	// Get returns the N element in the Tuple with given index.
	Get(index int) (reactor.Any, error)
	// Len returns the length of Tuple.
	Len() int
	// ForEach execute callback for each element in the Tuple.
	// If ok returns false, current loop will be broken.
	ForEach(callback func(v reactor.Any, e error) (ok bool))
	// ForEachWithIndex execute callback for each element and index in the Tuple.
	// If ok returns false, current loop will be broken.
	ForEachWithIndex(callback func(v reactor.Any, e error, index int) (ok bool))
}

Tuple is a container of multi elements.

func NewTuple

func NewTuple(items ...*reactor.Item) Tuple

NewTuple returns a new Tuple.

Jump to

Keyboard shortcuts

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