IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /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. /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 (Array[ScheduleEntry, N]):
  • pos (Int):

Implemented traits

AnyType, Deinitable, Movable

Methods

__init__

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

Constructs an empty builder at the given write position.

def __init__(out self, var entries: Array[ScheduleEntry, N], pos: Int = 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.