iterator

package
v0.0.0-...-886a677 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsIterator

func IsIterator(item stackitem.Item) bool

IsIterator returns whether stackitem implements iterator interface.

func Next

func Next(ic *interop.Context) error

Next advances the iterator, pushes true on success and false otherwise.

func Value

func Value(ic *interop.Context) error

Value returns current iterator value and depends on iterator type: For slices the result is just value. For maps the result is key-value pair packed in a struct.

func Values

func Values(item stackitem.Item, max int) []stackitem.Item

Values returns an array of up to `max` iterator values. The provided iterator can safely be reused to retrieve the rest of its values in the subsequent calls to Values and to ValuesTruncated.

func ValuesTruncated

func ValuesTruncated(item stackitem.Item, max int) ([]stackitem.Item, bool)

ValuesTruncated returns an array of up to `max` iterator values. The second return parameter denotes whether iterator is truncated, i.e. has more values. The provided iterator CAN NOT be reused in the subsequent calls to Values and to ValuesTruncated.

Types

This section is empty.

Jump to

Keyboard shortcuts

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