Skip to main content

Crate dellingr

Crate dellingr 

Source
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§

error
Error types returned by the VM and parser. Surfaced through Result.

Structs§

Anchor
A retainable handle to a Lua value, valid until released.
CostAnalysis
Static cost analysis of a Lua script.
DefaultCallbacks
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::load to execute.
ScopeCost
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§

HostCallbacks
Trait for host-provided callbacks.

Functions§

analyze_cost
Analyze the cost of a Lua script without executing it.

Type Aliases§

Result
Custom result type for evaluating Lua.
RustFunc
Signature for a host-provided Rust function callable from Lua.