package iterator

import "github.com/hashicorp/nomad/helper/iterator"

Index

Functions

func Len

func Len(iter Iterator) int

Len consumes the iterator and returns the number of elements found.

IMPORTANT: this method consumes the iterator, so it should not be used after Len() returns.

Types

type Iterator

type Iterator interface {
	// Next returns the next element or nil if there are none left.
	Next() any
}

Iterator represents an object that can iterate over a set of values one at a time.

Source Files

iterator.go

Version
v1.10.0 (latest)
Published
Apr 9, 2025
Platform
linux/amd64
Last checked
20 minutes ago

Tools for package owners.