IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: Nightly
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).

Indexer

The Indexer trait is used for types that can index into a collection or pointer. The type returned is the underlying __mlir_type.index, enabling types like SIMD to not have to be converted to an Int first.

Implemented traits

AnyType, ImplicitlyDestructible

Required methods

__mlir_index__

__mlir_index__(self: _Self) -> __mlir_type.index

Convert to index.

Returns:

__mlir_type.index: The corresponding __mlir_type.index value.