Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Primary API

The relevant types live under rhai::grain namespace.

use rhai::grain::{Compiler, Program, Vm};
MethodDescription
Compiler::new | Compiler::compiletranspile an AST into Rhai Grain bytecodes.
Program::write | Program::readserialize and reload a chunk of Rhai Grain bytecodes.
Program::write_strippedremove diagnostics from the Rhai Grain bytecodes.
Program::residual_count | Program::first_unsupportedreport features not yet supported.
Vm::eval | Vm::eval_with_scoperun a script transpiled into Rhai Grain bytecodes.
Vm::eval_with_callbackrun a script transpiled into Rhai Grain bytecodes with wrappers for script-defined functions.
Vm::fault_traceretrieve the trace after an error.
Sidecar::resolvemap fault traces back to source locations.