[][src]Trait luajit::types::LuaObject

pub trait LuaObject {
    fn name() -> *const i8;
fn lua_fns() -> Vec<luaL_Reg>; }

Structs can implement this trait to enable easy interaction with the Lua stack. Any struct implementing this trait can be pushed to the Lua stack as userdata.

Required methods

fn name() -> *const i8

The string returned by this method will serve as the name of this type's metatable in the Lua registry. A good value is the name of the type LuaObject is being implemented for.

The c_str! macro can be used to declare C string constants.

fn lua_fns() -> Vec<luaL_Reg>

Return a list of all Lua functions on this struct. They will be registered in the metatable automatically.

Loading content...

Implementors

Loading content...