Documentation
¶
Index ¶
- func Push[V any](seq iter.Seq[V], f ...func(V) bool) bool
- func Push2[K, V any](seq iter.Seq2[K, V], f ...func(K, V) bool) bool
- func TeeSeq[V any](seq iter.Seq[V], pusher func(v V) bool) iter.Seq[V]
- func TeeSeq2[K, V any](seq iter.Seq2[K, V], pusher func(K, V) bool) iter.Seq2[K, V]
- type Pipe
- type Pipe2
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TeeSeq ¶
TeeSeq is iter.Seq equivalent of io.TeeReader.
TeeSeq returns a iter.Seq that pushes to pusher what it reads from seq. Yielding values from the returned iterator performs push before the inner loop receives the value. The iterator is not stateful; you may want to wrap it with iterable.Resumable. If pusher returns false, the iterator stops iteration without yielding value.
Experimental: not tested and might be changed any time.
func TeeSeq2 ¶
TeeSeq2 is iter.Seq2 equivalent of io.TeeReader.
TeeSeq2 returns a iter.Seq2 that pushes to pusher what it reads from seq. Yielding key-value pairs from the returned iterator performs push before the inner loop receives the pair. The iterator is not stateful; you may want to wrap it with iterable.Resumable2. If pusher returns false, the iterator stops iteration without yielding pair.
Experimental: not tested and might be changed any time.
Types ¶
type Pipe ¶
type Pipe[V any] struct { // contains filtered or unexported fields }
Experimental: not tested and might be changed any time.
func TeeSeqPipe ¶
TeeSeqPipe tees values from seq to *Pipe. see doc comments for TeeSeq. Yielding values from returned *iterable.Resumable also performs push to *Pipe.
Experimental: not tested and might be changed any time.
type Pipe2 ¶
type Pipe2[K, V any] struct { // contains filtered or unexported fields }
Experimental: not tested and might be changed any time.
func TeeSeqPipe2 ¶
func TeeSeqPipe2[K, V any](bufSize int, seq iter.Seq2[K, V]) (*Pipe2[K, V], *iterable.Resumable2[K, V])
TeeSeqPipe2 tees key-value pairs from seq to *Pipe2. see doc comments for TeeSeq2. Yielding pairs from returned *iterable.Resumable2 also performs push to *Pipe2.
Experimental: not tested and might be changed any time.