Get the next item from the stream, advancing the cursor.
Get the next item from the stream, advancing the cursor.
an Option containing the next item, or None
if the iterator is exhausted.
Get the count of the number of items consumed so far.
Get the count of the number of items consumed so far.
the count
IteratorStreamplaces a simple stream on top of an iterator, returningOption-wrapped instances from the underlying iterator. When the stream is exhausted, theIteratorstream returnsNone. Differences from a plainIteratorinclude:- An
IteratorStreamwill not throw an exception if you try to read past the end of it. Instead, it will just keep returningNone.Example of use with a string: