IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo struct

EntryBuilder

struct EntryBuilder[N: Int, phase: Phase]

Appends ScheduleEntry values into a fixed-size array.

Encapsulates the repeated entries[t] = ScheduleEntry(...); t += 1 pattern, auto-tracking the write position and phase.

Fields​

  • ​entries (InlineArray[ScheduleEntry, N]):
  • ​pos (Int):

Implemented traits​

AnyType, ImplicitlyDeletable

Methods​

__init__​

def __init__(out self, pos: Int = 0)

Constructs an empty builder at the given write position.

def __init__(out self, entries: InlineArray[ScheduleEntry, N], pos: Int = 0)

Wrap an existing entries array (e.g. from a caller).

emit​

def emit(mut self, op: OpDesc, prefetch: Bool = False)

Append one entry and advance the position.

emit_if​

def emit_if(mut self, op: OpDesc, prefetch: Bool = False)

Emit only if op is present (not the NONE sentinel).

emit_flag​

def emit_flag(mut self, op: OpDesc, flag: Bool)

Emit only if flag is True.