pub unsafe extern "C-unwind" fn luaL_ref(
l: *mut lua_State,
t: c_int,
) -> c_intExpand description
Creates and returns a reference, in the table at index t, for the
object at the top of the stack (and pops the object).
[-1, +0, m]
A reference is a unique integer key. As long as you do not manually add
integer keys into table t, luaL_ref ensures the uniqueness of the key
it returns. You can retrieve an object referred by reference r by
calling lua_rawgeti(l, t, r). Function luaL_unref frees a
reference and its associated object.
If the object at the top of the stack is nil, luaL_ref returns the
constant LUA_REFNIL. The constant LUA_NOREF is guaranteed to be
different from any reference returned by luaL_ref.