Documentation ¶
Overview ¶
Package iterators define storage iterator interfaces and some utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EmptyIterator ¶
type EmptyIterator[T any] struct{}
EmptyIterator returns zero elements.
func (*EmptyIterator[T]) Err ¶
func (i *EmptyIterator[T]) Err() error
Err returns an error caused during iteration, if any.
func (*EmptyIterator[T]) Next ¶
func (i *EmptyIterator[T]) Next(*T) bool
Next returns true, if there is element and fills t.
type Iterator ¶
type Iterator[T any] interface { // Next returns true, if there is element and fills t. Next(t *T) bool // Err returns an error caused during iteration, if any. Err() error // Close closes iterator. Close() error }
Iterator is an storage iterator interface.
type SliceIterator ¶
type SliceIterator[T any] struct { // contains filtered or unexported fields }
SliceIterator is a slice iterator.
func Slice ¶
func Slice[T any](vals []T) *SliceIterator[T]
Slice creates new SliceIterator from given values.
func (*SliceIterator[T]) Err ¶
func (i *SliceIterator[T]) Err() error
Err returns an error caused during iteration, if any.
func (*SliceIterator[T]) Next ¶
func (i *SliceIterator[T]) Next(t *T) bool
Next returns true, if there is element and fills t.
Click to show internal directories.
Click to hide internal directories.