Mojo trait
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.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!