Expand description
A drop-in subset of the hlua 0.4 embedding API, backed by the pure-Rust
lua-rs VM instead of the C library.
The goal is source compatibility: a consumer that does
use lua_rs_hlua_shim as hlua; should compile and run against lua-rs without
touching its own code. The implemented surface is the part exercised by
authoscope — Lua, functionN, AnyLuaValue and friends, LuaFunction,
and StringInLua. It is intentionally not the whole hlua API.
Sandboxing note: lua-rs’s runtime opens the full standard library, whereas
hlua consumers typically open only string. This is acceptable for a
compatibility spike but widens the sandbox; restricting the opened libraries
is tracked as future work.
Structs§
- AnyLua
String - A byte string that may not be valid UTF-8, mirroring
hlua::AnyLuaString. - FnHandle
- The concrete
Lwe instantiateLuaFunctionwith: a live borrow of the VM plus the global name to call. - Lua
- A Lua state with the standard libraries installed.
- LuaError
- Error returned by
Lua::executeandLuaFunction::call_with_args. - LuaFunction
- A handle to a global Lua function, kept by name so it can be re-fetched and
called. Mirrors
hlua::LuaFunction<L>(single type parameter). - String
InLua - Mirror of
hlua::StringInLua<L>: owns the read string and derefs tostr.
Enums§
- AnyHashable
LuaValue - The hashable projection used for Lua table keys, mirroring
hlua::AnyHashableLuaValue. Numbers narrow toi32exactly as upstream. - AnyLua
Value - Any Lua value, mirroring
hlua::AnyLuaValuefield-for-field.
Traits§
- From
Exec - The result type produced by
Lua::execute. Only()is supported, which is allauthoscoperequires.
Functions§
- function0
- Wrap a Rust closure so it can be stored as a Lua global via
Lua::set. - function1
- Wrap a Rust closure so it can be stored as a Lua global via
Lua::set. - function2
- Wrap a Rust closure so it can be stored as a Lua global via
Lua::set. - function3
- Wrap a Rust closure so it can be stored as a Lua global via
Lua::set. - function4
- Wrap a Rust closure so it can be stored as a Lua global via
Lua::set. - function5
- Wrap a Rust closure so it can be stored as a Lua global via
Lua::set. - function6
- Wrap a Rust closure so it can be stored as a Lua global via
Lua::set.