Skip to content

Commit

Permalink
mockup how to get a function stuff into Lua
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Jun 15, 2024
1 parent 5ee07b7 commit 38cc27c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rusile/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,12 @@ use mlua::prelude::*;
#[mlua::lua_module]
fn rusile(lua: &Lua) -> LuaResult<LuaTable> {
let exports = lua.create_table().unwrap();
let foo: LuaFunction = lua.create_function(foo).unwrap();
exports.set("foo", foo)?;
Ok(exports)
}

fn foo<'a>(_lua: &'a Lua, (): ()) -> LuaResult<()> {
eprintln!("e print from rusile not rustle");
Ok(())
}

0 comments on commit 38cc27c

Please sign in to comment.