low-luajit 0.2.0

Low level but safe bindings to the LuaJIT C API with no dependencies and no-std support to create Lua modules using Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use low_luajit::{AmountReturned, LuaState};

extern "C-unwind" fn test(lua: LuaState) -> AmountReturned {
	lua.opt(|lua, arg_n| println!("{}", lua.get_top() - arg_n), 1, ());

	lua.return_boolean(true)
}

#[unsafe(no_mangle)]
extern "C-unwind" fn luaopen_test(mut lua: LuaState) -> AmountReturned {
	lua.push_cfunction(test);
	lua.return_any(1)
}