For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).
iter
iter(var iterable: T) -> T.IteratorOwnedType
Constructs an owned iterator from an iterable.
Args:
- iterable (
T): The iterable to construct the iterator from.
Returns:
T.IteratorOwnedType: An owned iterator for the given iterable.
iter[IterableType: Iterable](ref iterable: IterableType) -> IterableType.IteratorType[iterable_is_mut, origin_of(iterable), origin_of(iterable)]
Constructs a borrowed iterator from an iterable.
Parameters:
- IterableType (
Iterable): The type of the iterable.
Args:
- iterable (
IterableType): The iterable to construct the iterator from.
Returns:
IterableType.IteratorType[iterable_is_mut, origin_of(iterable), origin_of(iterable)]: A borrowed iterator for the given iterable.