iterator

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package iterator provides a built-in implementation of an ideomatic generic iterator

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type T0

type T0 string

T0 is a generic type variable placeholder of an iterator element. It will not appear in the generated code

type T0GeneratorFunc

type T0GeneratorFunc func(generator chan<- T0) error

T0GeneratorFunc is a function that should generate elements and send them to a given channel

func T0SliceGenerator

func T0SliceGenerator(src []T0) T0GeneratorFunc

T0SliceGenerator generates elements from a given slice

type T0Iter

type T0Iter interface {
	// Err returns error if it happened during generation
	Err() error

	// Next returns next element from iterator
	Next() <-chan T0
}

T0Iter implements iterator over T0 type elements

func Generate

func Generate(f T0GeneratorFunc) T0Iter

Generate creates Iterator from generator func

Jump to

Keyboard shortcuts

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