Documentation ¶
Overview ¶
Package funcit allows for functional sources of items to be used with iterators.
Iterator functions:
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NextFnT ¶
type NextFnT func() bool
NextFnT advances the iterator to the first/next item, returning true if successful meaning there is an item available to be fetched and false otherwise.
type PullFnT ¶
PullFnT represents a function that returns a single value and a boolean value indicating whenever calling the function will yield more values or not.
type PullIterator ¶
type PullIterator[T any] struct { // contains filtered or unexported fields }
PullIterator represents an iterator which calls a function until it returns no more items.
func (*PullIterator[T]) Next ¶
func (it *PullIterator[T]) Next() (ok bool)
func (*PullIterator[T]) Value ¶
func (it *PullIterator[T]) Value() T
type StateIterator ¶
type StateIterator[T any] struct { // contains filtered or unexported fields }
StateIterator represents an iterator which calls a given next function to test whenever there is another item available and yields the values returned from a provided value retrieval function.
func (StateIterator[T]) Next ¶
func (it StateIterator[T]) Next() bool
func (StateIterator[T]) Value ¶
func (it StateIterator[T]) Value() T