Documentation
¶
Index ¶
- func Each[T any](it iterkit.Iterator[T], fn EachFunc[T])
- func EachIndex[T any](it iterkit.Iterator[T], fn EachIndexFunc[T])
- func Filter[T any](it iterkit.Iterator[T], cb FilterFunc[T]) iterkit.Iterator[T]
- func Map[T, V any](it iterkit.Iterator[T], fn MapFn[T, V]) iterkit.Iterator[V]
- func Range[T constraints.Signed](stop T, optFuncs ...OptionFunc) iterkit.Iterator[T]
- func Runes(v string) iterkit.Iterator[rune]
- func Slice[T any](it iterkit.Iterator[T]) (out []T)
- func String(it iterkit.Iterator[rune]) string
- type EachFunc
- type EachIndexFunc
- type FilterFunc
- type FilterIter
- type MapFn
- type MapIterator
- type Option
- type OptionFunc
- type RangeIter
- type RangeOptions
- type StringIter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EachIndex ¶
func EachIndex[T any](it iterkit.Iterator[T], fn EachIndexFunc[T])
EachIndex walks through the iterator given in it and calls fn for every single entry together with its index.
func Filter ¶
Filter returns an Iterator yielding items from the given iterator for which the given FilterFunc function returns true.
func Map ¶
Map returns an iterator that applies MapFn function to every item of iterkit.Iterator iterable, yielding the results.
func Range ¶
func Range[T constraints.Signed](stop T, optFuncs ...OptionFunc) iterkit.Iterator[T]
Range returns an iterator yielding [start, stop)
Types ¶
type EachIndexFunc ¶
type FilterFunc ¶
type FilterIter ¶
type FilterIter[T any] struct { // contains filtered or unexported fields }
func (*FilterIter[T]) Next ¶
func (f *FilterIter[T]) Next() bool
func (FilterIter[T]) Value ¶
func (f FilterIter[T]) Value() T
type MapIterator ¶
type MapIterator[T, V any] struct { // contains filtered or unexported fields }
func (*MapIterator[T, V]) Next ¶
func (m *MapIterator[T, V]) Next() bool
func (*MapIterator[T, V]) Value ¶
func (m *MapIterator[T, V]) Value() V
type OptionFunc ¶
type OptionFunc func(opts *RangeOptions)
func WithStart ¶
func WithStart(v int) OptionFunc
func WithStep ¶
func WithStep(v int) OptionFunc
type RangeIter ¶
type RangeIter[T constraints.Signed] struct { // contains filtered or unexported fields }
type RangeOptions ¶
type RangeOptions struct {
// contains filtered or unexported fields
}
type StringIter ¶
type StringIter struct {
// contains filtered or unexported fields
}
func (*StringIter) Next ¶
func (s *StringIter) Next() bool
func (*StringIter) Value ¶
func (s *StringIter) Value() rune
Click to show internal directories.
Click to hide internal directories.