rlua 0.20.1

High level bindings to Lua 5.x
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use rlua::{Lua, Result, RluaCompat};

fn main() -> Result<()> {
    let lua = Lua::new();
    lua.context(|lua_ctx| {
        // add `some_directory` to the package path
        lua_ctx
            .load("package.path = package.path .. ';./examples/some_directory/?.lua'")
            .exec()?;

        // require a module located in the newly added directory
        lua_ctx.load("require'new_module'").exec()?;

        Ok::<_, rlua::Error>(())
    })?;

    Ok(())
}