Skip to main content

Mojo trait

Iterable

The Iterable trait describes a type that can be turned into an iterator.

Implemented traits

AnyType

comptime members

IteratorType

comptime IteratorType

Required methods

__iter__

__iter__(ref self: _Self) -> _Self.IteratorType[self_is_mut, origin_of(self), origin_of(self)]

Returns an iterator over the elements of this iterable.

Returns:

_Self.IteratorType: An iterator over the elements.

Was this page helpful?