FieldOffsets
Mojo struct 🡭
FieldOffsets
Section titled “FieldOffsets”@memory_onlystruct FieldOffsets[MAX: Int = 64]Stack-allocated flat array of (start, end) byte pairs for up to MAX fields.
Layout: [start0, end0, start1, end1, …] — avoids a separate count field at the cost of doubling the index arithmetic, which is branch-free.
Parameters
Section titled “Parameters”- MAX (
Int)
Implemented traits
Section titled “Implemented traits”AnyType, Copyable, ImplicitlyDestructible, Movable, Sized
Methods
Section titled “Methods”__init__
Section titled “__init__”def __init__(out self)Args:
- self (
Self)
Returns:
Self
__len__
Section titled “__len__”def __len__(self) -> IntArgs:
- self (
Self)
Returns:
Int
def start(self, i: Int) -> IntArgs:
- self (
Self) - i (
Int)
Returns:
Int
def end(self, i: Int) -> IntArgs:
- self (
Self) - i (
Int)
Returns:
Int