Expand description
§postscriptum
A multi-interpreted-language scripting engine for Rust, with Rhai and Python backends, working on both native and WASM targets. This crate is Bevy-free.
The core abstraction is the ScriptEngine trait: a stateful interpreter
that evaluates a script and returns the result as a string. Wrap it in a
ThreadSafeEngine to share it across threads, and expose Rust functions
to scripts through a FunctionBundle.
See the rhai module for a runnable example (requires the rhai feature).
Re-exports§
pub use error::Error;pub use error::ExprIssue;pub use error::ExprIssueKind;pub use error::LimitKind;pub use error::Result;pub use error::ValidationError;pub use function_bundle::FunctionBundle;pub use rhai::BoundedRhaiEngine;pub use rhai::CompiledExpr;pub use rhai::DEFAULT_MAX_ARRAY_SIZE;pub use rhai::DEFAULT_MAX_CALL_LEVELS;pub use rhai::DEFAULT_MAX_MAP_SIZE;pub use rhai::DEFAULT_MAX_OPERATIONS;pub use rhai::DEFAULT_MAX_STRING_SIZE;pub use rhai::from_dynamic_value;pub use rhai::to_dynamic_value;
Modules§
- error
- Error types for postscriptum. Error types for postscriptum.
- function_
bundle - A unified bundle of Rust functions callable from scripts.
- python
- The Python backend (native via
pyo3, WASM via Pyodide). - rhai
- The Rhai scripting backend.
Structs§
- Thread
Safe Engine - Wrapper that makes non-
Sendengines usable across threads.
Enums§
- Engine
Type - The set of scripting backends available.
Constants§
- DEFAULT_
MAX_ SOURCE_ LEN - Starting default for the source-length cap in bytes (Quartertone
bound): enforced host-side before compiling/evaluating on both
backends. Dynamically settable everywhere it matters (builder
field on
BoundedRhaiEngine, parameter on Python compile) — a starting value, not fixed policy.
Traits§
- Script
Engine - The core interface every scripting backend implements.
Functions§
- get_
engine - Create a bare engine of the given type (no registered functions).
- get_
engine_ with_ bundle - Create an engine of the given type with
bundle’s functions registered.