hlua 0.4.3

Zero-cost high-level wrapper for Lua
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
extern crate hlua;

// To see the generated assembly, run:
// cargo rustc --release --example rust_function -- --emit=asm

fn main() {
    let mut lua = hlua::Lua::new();

    lua.set("foo", hlua::function1(|val: i32| val * 5));

    let val: i32 = lua.execute(r#"return foo(8)"#).unwrap();
    assert_eq!(val, 40);
}