Skip to content

ChainIterator Reference

A ChainIterator chains two iterators together. It inherits from Iterator.

Creates an iterator to combine with another iterator.

var iterator = ArrayIterator([0, 1, 2]);
var other_iterator = ArrayIterator([3, 4, 5]);
var combined_iterators = ChainIterator(iterator, other_iterator);

first: Iterator - The first iterator in the chain.

second: Iterator - The second iterator in the chain.

All methods are inherited from the Iterator class. See the Iterator reference for documentation.

var iterator = ArrayIterator([0, 1, 2]);
var other_iterator = ArrayIterator([3, 4, 5]);
var combined_iterators = ChainIterator(iterator, other_iterator).for_each(println);
// 0
// 1
// 2
// 3
// 4
// 5