Function td_rlua::userdata::push_lightuserdata [] [src]

pub fn push_lightuserdata<'a, T, F>(
    data: &'a mut T,
    lua: *mut lua_State,
    metatable: F
) -> i32 where
    F: FnMut(LuaTable),
    T: 'a + Any

Pushes an object as a user data.

In Lua, a user data is anything that is not recognized by Lua. When the script attempts to copy a user data, instead only a reference to the data is copied.

The way a Lua script can use the user data depends on the content of the metatable, which is a Lua table linked to the object.

Arguments

  • metatable: Function that fills the metatable of the object.