API reference
GDHTMLTemplate
Immutable template parsed by GD.html.template. execute renders text, execute_bytes renders UTF-8 bytes, and the value can be shared across requests.
Methods
execute
execute(data: Dictionary) -> String, ErrReturn HTML with safely interpolated values.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
data | Dictionary | Required | Input data in the representation shown by the parameter type. |
Return value
String, Err
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
execute_bytes
execute_bytes(data: Dictionary) -> PackedByteArray, ErrReturn escaped HTML directly as UTF-8 bytes.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
data | Dictionary | Required | Input data in the representation shown by the parameter type. |
Return value
PackedByteArray, Err
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.