iterator

package
v0.0.0-...-24f81a7 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 1 Imported by: 28

Documentation

Overview

Package iterator provides functions to work with Neo iterators.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Next

func Next(it Iterator) bool

Next advances the iterator returning true if it was successful (and you can use Value to get value for slices or key-value pair for maps) and false otherwise (and there are no more elements in this Iterator). This function uses `System.Iterator.Next` syscall.

func Value

func Value(it Iterator) any

Value returns iterator's current value. It's only valid to call after a successful Next call. This function uses `System.Iterator.Value` syscall. For slices, the result is just value. For maps, the result can be cast to a slice of 2 elements: a key and a value. For storage iterators, refer to `storage.FindFlags` documentation.

Types

type Iterator

type Iterator struct{}

Iterator represents a Neo iterator, it's an opaque data structure that can be properly created by storage.Find. Iterators range over key-value pairs, so it's convenient to use them for maps. This structure is similar in function to Neo .net framework's Iterator.

Jump to

Keyboard shortcuts

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