A Rusty wrapper for Lua. Will clone and compile Lua, then link to it.
Right now a basic version is working, but many data types haven't been implemented.
Include in your app using
llua = {git="https://github.com/ericrobolson/LucidLua"}
With error handling:
llua = {git="https://github.com/ericrobolson/LucidLua", features=["std"]}
use llua::*;
const CODE: &'static str = "
function my_func()
print(\"Hello from lua!\")
end
";
fn main() -> Result<(), Error> {
let mut m = Lua::new();
m.activate(Library::all())?;
m.interpret(CODE)?;
let result: [Data; 0] = m.call("my_func", [])?;
let expected: [Data; 0] = [];
assert_eq!(expected, result);
Ok(())
}
cargo run --example global_get
will run an example showing how to get a globalcargo run --example global_set
will run an example showing how to set a globalcargo run --example interpret
will run an example showing how to interpret codecargo run --example lua_calls_rust
will run an example showing how to call Rust code from Luacargo run --example rust_calls_lua_args
will run an example showing how to call Lua code from Rust with argumentscargo run --example rust_calls_lua
will run an example showing how to call Lua code from Rust with no arguments
- Implement rest of data
- Remove todos + panics