Skip to main content

Module engine

Module engine 

Source
Available on crate feature rhai only.
Expand description

Rhai scripting engine (engine::Script) and its registered helpers. Rhai scripting engine.

Script is the entry point. Script::new_bare builds a rhai::Engine preloaded with generic helpers (base64/json, sha256, url/basenames, yaml, semver, chrono, …) and optional feature-gated ones (fs, shell, password, crypto, k8s, oci, s3, http).

The engine also injects assert and import_run / import_template shims so scripts can optionally import other modules without failing when they are absent.

Structs§

AST
Compiled AST (abstract syntax tree) of a Rhai script.
Dynamic
Dynamic type containing any value.
Engine
Rhai main scripting engine.
FileModuleResolver
A module resolution service that loads module script files from the file system.
ImmutableString
The system immutable string type.
Module
A module which may contain variables, sub-modules, external Rust functions, and/or script-defined functions.
ModuleResolversCollection
Module resolution service that holds a collection of module resolvers, to be searched in sequential order.
ParseError
Error when parsing a script.
Scope
Type containing information about the current scope. Useful for keeping state between Engine evaluation runs.
Script
Rhai engine + evaluation scope.

Enums§

ASTNode
(internals) An AST node, consisting of either an Expr or a Stmt. Exported under the internals feature only.
Expr
(internals) An expression sub-tree. Exported under the internals feature only.
Stmt
(internals) A statement. Exported under the internals feature only.

Functions§

base64_decode
to_dynamic
Serialize a Rust type that implements serde::Serialize into a Dynamic.
url_encode

Type Aliases§

ArrayNon-no_index
Variable-sized array of Dynamic values.
MapNon-no_object
A dictionary of Dynamic values with string keys.