Module casbin::rhai[][src]

Modules

packages

Module containing all built-in packages available to Rhai, plus facilities to define custom packages.

plugin

Module defining macros for developing plugins.

serde

(SERDE) Serialization and deserialization support for serde. Exported under the serde feature only.

Macros

combine_with_exported_module

Macro to combine a plugin module into an existing module.

def_package

Macro that makes it easy to define a package (which is basically a shared module) and register functions into it.

exported_module

Macro to generate a Rhai Module from a plugin module defined via #[export_module].

register_exported_fn

Macro to register a plugin function (defined via #[export_fn]) into an Engine.

set_exported_fn

Macro to register a plugin function into a Rhai Module.

set_exported_global_fn

Macro to register a plugin function into a Rhai Module and expose it globally.

Structs

AST

Compiled AST (abstract syntax tree) of a Rhai script.

Dynamic

Dynamic type containing any value.

Engine

Rhai main scripting engine.

EvalContext

Context of a script evaluation process.

Expression

An expression sub-tree in an AST.

FnPtr

A general function pointer, which may carry additional (i.e. curried) argument values to be passed onto a function during a call.

ImmutableString

The system immutable string type.

Module

A module which may contain variables, sub-modules, external Rust functions, and/or script-defined functions.

NativeCallContext

Context of a native Rust function call.

ParseError

Error when parsing a script.

Position

A location (line number + character position) in the input script.

Scope

Type containing information about the current scope. Useful for keeping state between Engine evaluation runs.

Shared

A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.

Enums

EvalAltResult

Evaluation result.

FnAccess

A type representing the access mode of a function.

FnNamespace

A type representing the namespace of a function.

LexError

(INTERNALS) Error encountered when tokenizing the script text. Exported under the internals feature only.

ParseErrorType

Type of error encountered when parsing a script.

Constants

OP_CONTAINS

Standard method function for containment testing.

OP_EQUALS

Standard equality comparison operator.

Traits

RegisterFnDeprecated

A trait to enable registering Rust functions. This trait is no longer needed and will be removed in the future.

RegisterNativeFunction

Trait to register custom Rust functions.

RegisterResultFnDeprecated

A trait to enable registering Rust functions. This trait is no longer needed and will be removed in the future.

Type Definitions

Array

Variable-sized array of Dynamic values.

INT

The system integer type. It is defined as i32 since the only_i32 feature is used.

Identifier

An identifier in Rhai. SmartString is used because most identifiers are ASCII and short, fewer than 23 characters, so they can be stored inline.

Map

Hash map of Dynamic values with ImmutableString keys.

Attribute Macros

export_fn

Attribute, when put on a Rust function, turns it into a plugin function.

export_module

Attribute, when put on a Rust module, turns it into a plugin module.