Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Done = errors.New("iterator: no more items in iterator")
Done is returned when an iterator is read past its end.
Functions ¶
Types ¶
type IndexedValue ¶
type IndexedValue[T any] struct { // contains filtered or unexported fields }
IndexedValue represents a value from a collection or sequence, along with its associated index in that collection or sequence.
type Iterator ¶
type Iterator[T any] interface { // Next returns the next item in the iteration. // It returns a nil pointer and ErrIteratorOverread // if the iterator was read past its end. // Otherwise it returns a reference to the next item. Next() (*T, error) // HasNext returns true if the iteration has more elements. HasNext() bool }
Iterator is the interface that allows to sequentially access the elements of a collection or another entity that can be represented as a sequence of elements.
func FromChannel ¶
FromChannel returns a new Iterator for the given channel.
Click to show internal directories.
Click to hide internal directories.