Documentation ¶
Index ¶
- func ToSlice[T any](it Iterator[T]) []T
- type Empty
- type Iterator
- 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]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Iterator ¶
type Iterator[T any] interface { // Next attempts to move the iterator to the next element in the set. It // returns false once there are no more elements to return. Next() bool // Value returns the value of the current element. Value should only be called // after a call to Next which returned true. Value() T // Release any resources associated with the iterator. This must be called // after the iterator is no longer needed. Release() }
Iterator defines an interface for iterating over a set.
func Deduplicate ¶ added in v1.11.12
func Deduplicate[T comparable](it Iterator[T]) Iterator[T]
Deduplicate returns an iterator that skips the elements that have already been returned from [it].
func Filter ¶
Filter returns an iterator that skips the elements in [it] that return true from [filter].
func FromSlice ¶
FromSlice returns an iterator that contains [elements] in order. Doesn't sort by anything.
Click to show internal directories.
Click to hide internal directories.