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).
once
def once[T: Movable, //](var element: T, /) -> _Once[T]
Creates an iterator that yields an element exactly once.
Parameters:
- T (
Movable): The type of the element to be yielded exactly once.
Args:
- element (
T): The element to be yielded exactly once.
Returns:
_Once[T]: An iterator that yields the specified element exactly once.