[][src]Module casbin::rhai

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.

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.

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.

Traits

RegisterFn

Trait to register custom functions with the Engine.

RegisterResultFn

Trait to register fallible custom functions returning Result<Dynamic, Box<EvalAltResult>> with the Engine.

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.

Map

Hash map of Dynamic values with ImmutableString keys.

Shared

Immutable reference-counted container.

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.