Skip to main content

Module host

Module host 

Source
Expand description

Host bridge — exposes Rust functions and objects to the scripting VM.

ScriptHost wraps a Vm and provides a clean API for:

  • Registering host functions callable from scripts
  • Binding host objects as script tables
  • Executing scripts and retrieving results
  • Event-driven scripting (hooks / callbacks)

Structs§

EventBus
Simple event system for triggering script callbacks.
ScriptComponent
A script component: holds a pre-compiled chunk + per-instance table.
ScriptHost
High-level scripting host. Owns the VM and provides ergonomic registration APIs.

Traits§

ScriptObject
A Rust-owned object exposed to scripts via a table interface.

Functions§

object_to_table
Wrap a ScriptObject as a script table. Changes to the table are NOT reflected back to the Rust object — use bind_object for two-way binding.

Type Aliases§

HostFunction
A Rust function callable from scripts.