Function lua_topointer

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

Returns the pointer of the value at the given index.

The “pointer of the value” is defined differently for different types:

  • For userdata, it returns the pointer to the userdata.
  • For light userdata, it returns the pointer that the light userdata contains.
  • For strings, tables, functions, threads, and buffers, it returns the pointer to the value’s data on the heap. The contents of this pointer are undefined.

For all other types, this function will return null.