Documentation Language: Swift

Structure

MTLVariable

Represents a variable or parameter declaration in MTL.

struct MTLVariable

Overview

Variables are used to define template parameters, query parameters, macro parameters, and loop iteration variables. They specify both the variable name for binding and the expected type for validation.

Example Usage

// Template parameter
let modelParam = MTLVariable(name: "model", type: "Model")

// Query parameter
let nameParam = MTLVariable(name: "name", type: "String")

// Loop variable
let itemVar = MTLVariable(name: "item", type: "Element")

Topics

Initializers

?
init(name:type:)

Creates a new MTL variable.

Instance Properties

V
name

The name of the variable.

V
type

The type of the variable.

Default Implementations

Relationships

Conforms To