chanit

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package chanit allows for native Go channels to be used with iterators.

Iterator functions:

  • In - yields items retrieved from a native Go channel

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func In added in v0.7.0

func In[T any](ch <-chan T) itkit.Iterator[T]

In provides an Iterator which yields items retrieved from the given Go channel until the channel is closed.

Types

type ChannelIterator

type ChannelIterator[T any] struct {
	// contains filtered or unexported fields
}

ChannelIterator represents an iterator which yields items retrieved from a Go channel until the channel is closed.

func (*ChannelIterator[T]) Next

func (it *ChannelIterator[T]) Next() (ok bool)

func (*ChannelIterator[T]) Value

func (it *ChannelIterator[T]) Value() T

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL