Documentation ¶
Index ¶
- Variables
- func AsBufferedChannel[IT Iterator[T], T any](iter IT, size int) <-chan T
- func AsChannel[IT Iterator[T], T any](iter IT) <-chan T
- func Count[IT Iterator[T], T any](iter IT) int
- func Fold[IT Iterator[T], T any, U any](iter IT, initial U, fn func(U, T) U) U
- func ForEach[IT Iterator[T], T any](iter IT, fn func(T))
- func ForEachContext[IT Iterator[T], T any](ctx context.Context, iter IT, fn func(context.Context, T))
- func PumpToChannel[IT Iterator[T], T any](ctx context.Context, iter IT, ch chan<- T)
- func Reduce[IT Iterator[T], T any, U any](iter IT, reducer func(Iterator[T]) U) U
- func ToMap[IT Iterator[KeyValue[K, V]], K comparable, V any](iter IT) map[K]V
- func ToSlice[T any](iter Iterator[T]) []T
- func ToSliceWithCapacity[IT Iterator[T], T any](iter IT, capacity int) []T
- type Comparator
- type Iterable
- type Iterator
- func Buffer[T any](iter Iterator[T], size int) Iterator[Iterator[T]]
- func Buffered[T any](iter Iterator[T], size int) Iterator[T]
- func Cancellable[T any](ctx context.Context, iter Iterator[T]) Iterator[T]
- func Concat[IT Iterator[T], T any](iterators ...IT) Iterator[T]
- func Filter[IT Iterator[T], T any](iter IT, fn func(T) bool) Iterator[T]
- func FilterIsInstance[T, U any](iter Iterator[T]) Iterator[U]
- func FlatMap[IT Iterator[T], T, U any](iter IT, fn func(T) Iterator[U]) Iterator[U]
- func FromChannel[T any](ch <-chan T) Iterator[T]
- func FromMap[K comparable, V any](m map[K]V) Iterator[KeyValue[K, V]]
- func FromSlice[T any](slice []T) Iterator[T]
- func Map[IT Iterator[T], T, U any](iter IT, fn func(T) U) Iterator[U]
- func NewIterator[T any](fn func() (T, bool)) Iterator[T]
- func OnEach[T any](iter Iterator[T], fn func(T)) Iterator[T]
- func Safe[IT Iterator[T], T any](iter IT) Iterator[Result[T]]
- func Scan[IT Iterator[T], T any, U any](iter IT, initial U, fn func(U, T) U) Iterator[U]
- func SortWith[T any](src Iterator[T], comparator Comparator[T]) Iterator[T]
- type KeyValue
- type ListIterator
- type MutableListIterator
- type Reducer
- type Result
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrStopIteration = errors.New("stop iteration")
Functions ¶
func AsBufferedChannel ¶
func ForEachContext ¶
func PumpToChannel ¶
func ToSliceWithCapacity ¶
Types ¶
type Comparator ¶
type KeyValue ¶
type KeyValue[K comparable, V any] struct { K K V V }
type MutableListIterator ¶
type MutableListIterator[T any] interface { ListIterator[T] InsertBefore(v T) InsertAfter(v T) Set(v T) Remove() }
Click to show internal directories.
Click to hide internal directories.