Documentation ¶
Overview ¶
Package iterator provides functions to work with Neo iterators.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Key ¶
func Key(it Iterator) interface{}
Key returns iterator's key at current position. It's only valid to call after successful Next call. This function uses `Neo.Iterator.Key` syscall.
func Keys ¶
func Keys(it Iterator) enumerator.Enumerator
Keys returns Enumerator ranging over keys or the given Iterator. Note that this Enumerator is actually directly tied to the underlying Iterator, so that advancing it with Next will actually advance the Iterator too. This function uses `Neo.Iterator.Keys` syscall.
func Next ¶ added in v0.75.0
Next advances the iterator returning true if it is was successful (and you can use Key or Value) and false otherwise (and there are no more elements in this Iterator). This function uses `Neo.Iterator.Next` syscall.
func Value ¶ added in v0.75.0
func Value(it Iterator) interface{}
Value returns iterator's current value. It's only valid to call after successful Next call. This function uses `Neo.Iterator.Value` syscall.
func Values ¶
func Values(it Iterator) enumerator.Enumerator
Values returns Enumerator ranging over values or the given Iterator. Note that this Enumerator is actually directly tied to the underlying Iterator, so that advancing it with Next will actually advance the Iterator too. This function uses `Neo.Iterator.Values` syscall.
Types ¶
type Iterator ¶
type Iterator struct{}
Iterator represents a Neo iterator, it's an opaque data structure that can be properly created by Create or storage.Find. Unlike enumerators, 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.
func Concat ¶ added in v0.75.0
Concat concatenates two given iterators returning one that will range on a first and then continue with b. Iterator positions are not reset for a and b, so if any of them was already advanced by Next the resulting Iterator will point at this new position and never go back to previous key-value pairs. This function uses `Neo.Iterator.Concat` syscall.