Skip to main content

Mojo function

peekable

peekable(ref iterable: T) -> _PeekableIterator[T.IteratorType[iterable_is_mut, iterable_is_origin]]

Returns a peekable iterator that can use the peek method to look ahead at the next element without advancing the iterator.

Args:

  • iterable (T): The iterable to create a peekable iterator from.

Returns:

_PeekableIterator: A peekable iterator.

Was this page helpful?