Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAtEnd = errors.New("iterator is at the end")
Error to indicate the iterator is at the end of it's sequence.
View Source
var ErrInvalidRangeValue = errors.New("range iterator can not be constructed with values less than 0")
Error to indicate the value passed into the Range iterator is invalid.
View Source
var ErrNotInBounds = errors.New("index is outside of iterator bounds")
Error to indicate that the bound iterator is attempting to have an element accessed that is out of it's bounds.
Functions ¶
Types ¶
type ArrayIterator ¶
type ArrayIterator[T any] struct { // contains filtered or unexported fields }
func Array ¶
func Array[T any](data []T) *ArrayIterator[T]
func (ArrayIterator[T]) At ¶
func (i ArrayIterator[T]) At(index int) T
func (ArrayIterator[T]) Current ¶
func (i ArrayIterator[T]) Current() T
func (ArrayIterator[T]) Len ¶
func (i ArrayIterator[T]) Len() int
func (*ArrayIterator[T]) Next ¶
func (i *ArrayIterator[T]) Next() (item T, err error)
func (*ArrayIterator[T]) Reset ¶
func (i *ArrayIterator[T]) Reset()
type BoundIterator ¶
type RangeIterator ¶ added in v1.0.2
type RangeIterator struct {
// contains filtered or unexported fields
}
func Range ¶ added in v1.0.2
func Range(size int) *RangeIterator
func (RangeIterator) At ¶ added in v1.0.2
func (ri RangeIterator) At(index int) int
func (RangeIterator) Current ¶ added in v1.0.2
func (ri RangeIterator) Current() int
func (RangeIterator) Len ¶ added in v1.0.2
func (ri RangeIterator) Len() int
func (*RangeIterator) Next ¶ added in v1.0.2
func (ri *RangeIterator) Next() (item int, err error)
func (*RangeIterator) Reset ¶ added in v1.0.2
func (ri *RangeIterator) Reset()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.