Function lua_ref

Source
pub unsafe extern "C-unwind" fn lua_ref(
    L: *mut lua_State,
    idx: c_int,
) -> c_int
Expand description

Creates a reference to the value at the given index.

This function returns an integer reference to the value at the given index that can be used to push the value onto the stack later. While the value is referenced, it will not be collected by the garbage collector.

References can be pushed onto a stack using lua_getref and must be released using lua_unref.