Skip to main content

Module state_stub

Module state_stub 

Source
Expand description

Phase-B reconcile shim: re-exports the canonical LuaState from lua-vm and provides an extension trait holding every method the Phase-A stdlib translation used to call on the Phase-A stub.

TODO_ARCH(phase-b-reconcile): all extension-trait method bodies are todo!("phase-b-reconcile: <name>"). They must move to real implementations on lua_vm::state::LuaState itself; that work lives in lua-vm, not here. The shim exists only so stdlib code keeps compiling while the canonical LuaState API stabilises.

Where a trait method’s name collides with an inherent method on the canonical LuaState, Rust resolves to the inherent method. Most Phase-A call sites compile through the inherent method unchanged; the handful that depend on a different return shape (e.g. state.push(...)? against the canonical pub fn push(&mut self, val: LuaValue)) are patched at the call site.

Structs§

LuaDebug
Debug introspection record. C: lua_Debug.
LuaState
Per-thread Lua execution state.

Enums§

CompareOp
Comparison operations (eq, lt, le). C: LUA_OP*.

Traits§

LuaStateStubExt
Extension trait wiring every Phase-A stub method onto the canonical LuaState. Bodies are todo!("phase-b-reconcile: …"). When the canonical type already defines a method with the same name, Rust’s inherent-first resolution makes this trait method unreachable (the inherent one wins) — the trait is then only providing the missing methods. Conflicting call-sites whose shape no longer matches the inherent signature are patched in their respective stdlib modules.

Functions§

upvalue_index
Pseudo-index for the i-th upvalue of a C function. C: #define lua_upvalueindex(i)

Type Aliases§

LuaReader
Reader-callback type for lua_load. C: lua_Reader.
LuaWriter
Writer-callback type for lua_dump. C: lua_Writer.
lua_CFunction
Bare function callable from Lua. C: lua_CFunction.