Expand description
A Lua VM designed for game scripting with cost budgets and host callbacks.
§Features
- Cost budgets: Control script execution with configurable operation costs
- Host callbacks: Redirect print output and handle errors
- Stack traces: Detailed error messages with source locations
§Example
use dellingr::{State, ArgCount, RetCount};
let mut state = State::new();
state.load_string("print('Hello!')").unwrap();
state.call(ArgCount::Fixed(0), RetCount::Fixed(0)).unwrap();Modules§
Structs§
- Anchor
- A retainable handle to a Lua value, valid until released.
- Cost
Analysis - Static cost analysis of a Lua script.
- Default
Callbacks - Default callbacks that print to stdout.
- Engine
- A factory for compiling Lua source and creating new
States. - Program
- A compiled, executable Lua program. Cheap to clone (refcounted) and safe
to share across threads. Load with
State::loadto execute. - Scope
Cost - Cost breakdown for a single scope (function or main chunk).
- State
- The main interface into the Lua VM.
Enums§
- ArgCount
- Argument count for function calls.
- LuaType
- The runtime type of a Lua value, as exposed to host code via
State. - RetCount
- Return count for function calls and returns.
Traits§
- Host
Callbacks - Trait for host-provided callbacks.
Functions§
- analyze_
cost - Analyze the cost of a Lua script without executing it.