Run NodesReferenceutils

iterator

Package iterator

import "github.com/luxfi/node/utils/iterator"

Functions

ToSlice

func ToSlice[T any](it Iterator[T]) []T

ToSlice returns a slice that contains all of the elements from [it] in order. [it] will be released before returning.

Types

Empty

Empty is an iterator with no elements.

func (Empty[_]) Next() bool
func (Empty[_]) Release()
func (Empty[T]) Value() T

Iterator

Iterator defines an interface for iterating over a set.

func Deduplicate[T comparable](it Iterator[T]) Iterator[T]
func Filter[T any](it Iterator[T], filter func(T) bool) Iterator[T]
func FromSlice[T any](elements ...T) Iterator[T]
func FromTree[T any](btree *btree.BTreeG[T]) Iterator[T]
func Merge[T any](less btree.LessFunc[T], iterators ...Iterator[T]) Iterator[T]