#[lua_function]
Expand description
Creates a valid function to be passed down to lua. Note this function will not be registered automatically for you, you must use luaL_register or functions like lua_pushcfunction. This may change in the future or allow for something like #[lua_function(name = “foo”, auto = true)]
§Examples
use rglua::prelude::*;
#[lua_function]
fn write(state: LuaState) -> Result<i32, std::io::Error> {
printgm!(state, "Hello, lua!");
std::fs::write("foo.txt", "bar")?;
Ok(0)
}