readcol

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Wrapper

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

Wrapper is a wrapper around a cols.Collection that provides read-only access to it.

func From

func From[T any](collection cols.Collection[T]) Wrapper[T]

From creates a new Wrapper around the given cols.Collection.

func (Wrapper[T]) Clone

func (w Wrapper[T]) Clone() Wrapper[T]

Clone returns a copy of a Wrapper with the same underlying cols.Collection.

func (Wrapper[T]) FindIndex

func (w Wrapper[T]) FindIndex(predicate predication.Predicate[T]) (int, bool)

FindIndex returns the index of the first element that satisfies the given predicate. If no element satisfies the predicate, 0 and false are returned.

func (Wrapper[T]) Get

func (w Wrapper[T]) Get(index int) T

Get returns the element at the given index.

func (Wrapper[T]) Iterator

func (w Wrapper[T]) Iterator() iter.Iterator[T]

Iterator returns an iter.Iterator over the elements.

func (Wrapper[T]) Size

func (w Wrapper[T]) Size() int

Size returns the number of elements.

func (Wrapper[T]) Stream

func (w Wrapper[T]) Stream(yield func(T) bool)

Stream streams the elements of the collection.

Jump to

Keyboard shortcuts

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