Static rglua::lua::lua_load[][src]

pub static lua_load: Lazy<extern "C" fn(l: LuaState, reader: LuaReader, data: *mut c_void, chunkname: LuaString) -> c_int>
Expand description

Loads a Lua chunk. If there are no errors, lua_load pushes the compiled chunk as a Lua function on top of the stack. Otherwise, it pushes an error message.

Parameters

  • l - Lua state,
  • reader - LuaReader function used to read the chunk.
  • data - Opaque value (userdata) passed to the reader function
  • chunkname - Name to identify the chunk, used in error messages / debugging.

Returns

Notes

  • This function only loads a chunk; it does not run it.
  • lua_load automatically detects whether the chunk is text or binary, and loads it accordingly.