Documentation Language: Swift

Protocol

MTLStatement

Protocol for all MTL statements that can be executed within templates.

protocol MTLStatement : Hashable, Sendable

Overview

MTL statements form the building blocks of template bodies, defining both text generation operations and control flow constructs. Statements execute within an MTL execution context, which provides access to variables, models, indentation state, and text writers.

Overview

MTL supports several categories of statements:

Concurrency

Statement execution is coordinated through the @MainActor to ensure thread-safe access to shared execution context and writer state.

Topics

Instance Properties

V
multiLines

Indicates whether this statement spans multiple lines.

Instance Methods

F
execute(in:)

Executes the statement within the specified execution context.

Relationships

Inherits From

Conforming Types