Documentation ¶
Index ¶
- func AdvanceN[T any, It Iter[T]](it It, n int) It
- func ChanReader[T any](c chan T) *chanReader[T]
- func ChanWriter[T any](c chan T) *chanWriter[T]
- func Distance[T any, It Iter[T]](first, last It) int
- func IOWriter(w io.Writer, delimiter string) *ioWriter
- func IotaGenerator[T Numeric](x T) func() T
- func IotaReader[T Numeric, It iotaReader[T]](x T) It
- func RandomGenerator[T any](s []T, r *rand.Rand) func() T
- func RepeatGenerator[T any](x T) func() T
- func RepeatReader[T any](x T) repeatReader[T]
- type BackwardMovable
- type BidiIter
- type BidiReadWriter
- type BidiReader
- type BidiWriter
- type Chan
- type Comparable
- type Complex
- type Float
- type ForwardIter
- type ForwardMovable
- type ForwardReadWriter
- type ForwardReader
- type ForwardWriter
- type InputIter
- type Integer
- type Iter
- type Map
- type Numeric
- type Ordered
- type OutputIter
- type RandomIter
- type RandomReadWriter
- type RandomReader
- type RandomWriter
- type ReadWriter
- type Reader
- type Signed
- type Slice
- type Unsigned
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChanReader ¶
func ChanReader[T any](c chan T) *chanReader[T]
ChanReader returns an InputIter that reads from a channel.
func ChanWriter ¶
func ChanWriter[T any](c chan T) *chanWriter[T]
ChanWriter returns an OutIter that writes to a channel.
func IOWriter ¶
IOWriter returns an OutputIter that writes values to an io.Writer. It panics if meet any error.
func IotaGenerator ¶
func IotaGenerator[T Numeric](x T) func() T
IotaGenerator creates a Generator that returns [x, x+1, x+2...).
func IotaReader ¶
func IotaReader[T Numeric, It iotaReader[T]](x T) It
IotaReader creates an InputIter that returns [x, x+1, x+2...).
func RandomGenerator ¶
RandomGenerator creates a generator that returns random item of a slice.
func RepeatGenerator ¶
func RepeatGenerator[T any](x T) func() T
RepeatGenerator creates an Generator that returns [x, x, x...).
func RepeatReader ¶
func RepeatReader[T any](x T) repeatReader[T]
RepeatReader creates an InputIter that returns [x, x, x...).
Types ¶
type BackwardMovable ¶
BackwardMovable represents iterators that can move backward.
type BidiIter ¶
type BidiIter[T any, It Iter[T]] interface { ForwardIter[T, It] BackwardMovable[It] }
BidiIter is an iterator that moves both forward or backward.
type BidiReadWriter ¶
BidiReadWriter is an interface that groups BidiIter and ReadWriter.
type BidiReader ¶
BidiReader is an interface that groups BidiIter and Reader.
type BidiWriter ¶
BidiWriter is an interface that groups BidiIter and Writer.
type Chan ¶
type Chan[Elem any] interface { ~chan Elem }
Chan is a constraint that matches channels of any element type.
type Comparable ¶
Comparable represents an iterator that can be compared.
type Complex ¶
type Complex interface { ~complex64 | ~complex128 }
Complex is a constraint that permits any complex numeric type. If future releases of Go add new predeclared complex numeric types, this constraint will be modified to include them.
type Float ¶
Float is a constraint that permits any floating-point type. If future releases of Go add new predeclared floating-point types, this constraint will be modified to include them.
type ForwardIter ¶
type ForwardIter[T any, It Iter[T]] interface { ForwardMovable[It] Comparable[It] AllowMultiplePass() // a marker indicates it can be multiple passed. }
ForwardIter is an iterator that moves forward.
type ForwardMovable ¶
ForwardMovable represents iterators that can move forward.
type ForwardReadWriter ¶
type ForwardReadWriter[T any, It Iter[T]] interface { ForwardIter[T, It] ReadWriter[T] }
ForwardReadWriter is an interface that groups ForwardIter and ReadWriter.
type ForwardReader ¶
type ForwardReader[T any, It Iter[T]] interface { ForwardIter[T, It] Reader[T] }
ForwardReader is an interface that groups ForwardIter and Reader.
type ForwardWriter ¶
type ForwardWriter[T any, It Iter[T]] interface { ForwardIter[T, It] Writer[T] }
ForwardWriter is an interface that groups ForwardIter and Writer.
type InputIter ¶
type InputIter[T any, It Iter[T]] interface { Reader[T] ForwardMovable[It] Comparable[It] }
InputIter is a readable and forward movable iterator.
type Integer ¶
Integer is a constraint that permits any integer type. If future releases of Go add new predeclared integer types, this constraint will be modified to include them.
type Map ¶
type Map[Key comparable, Val any] interface { ~map[Key]Val }
Map is a constraint that matches maps of any element and value type.
type Ordered ¶
Ordered is a constraint that permits any ordered type: any type that supports the operators < <= >= >. If future releases of Go add new ordered types, this constraint will be modified to include them.
type OutputIter ¶
type OutputIter[T any] interface { Writer[T] }
OutputIter is a writable and ForwardMovable iterator.
It may not implement the incremental interface, in which case the increment logic is done in Write().
type RandomIter ¶
type RandomIter[T any, It Iter[T]] interface { BidiIter[T, It] AdvanceN(n int) It Distance(It) int Less(It) bool }
RandomIter is a random access iterator.
type RandomReadWriter ¶
type RandomReadWriter[T any, It Iter[T]] interface { RandomIter[T, It] ReadWriter[T] }
RandomReadWriter is an interface that groups RandomIter and ReadWriter.
type RandomReader ¶
type RandomReader[T any, It Iter[T]] interface { RandomIter[T, It] Reader[T] }
RandomReader is an interface that groups RandomIter and Reader.
type RandomWriter ¶
type RandomWriter[T any, It Iter[T]] interface { RandomIter[T, It] Writer[T] }
RandomWriter is an interface that groups RandomIter and Writer.
type ReadWriter ¶
ReadWriter is an interface that groups Reader and Writer.
type Signed ¶
Signed is a constraint that permits any signed integer type. If future releases of Go add new predeclared signed integer types, this constraint will be modified to include them.
type Slice ¶
type Slice[Elem any] interface { ~[]Elem }
Slice is a constraint that matches slices of any element type.