Mojo function
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: A borrowed iterator for the given iterable.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!