Function lua_setmetatable

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

Sets the metatable of the value at the given index to the value at the top of the stack.

The metatable of tables and userdata can be set using this, but also the metatable of any other primitive type can be set.

This function will set the metatable of the value at the given index to the value at the top of the stack, and pop the value from the stack.

This function will always return 1.