Skip to main content

DynLibLoadHook

Type Alias DynLibLoadHook 

Source
pub type DynLibLoadHook = fn(state: &mut LuaState, path: &[u8], see_global: bool) -> Result<DynLibId, LuaError>;
Expand description

Function-pointer signature for loading a dynamic library, installed on GlobalState::dynlib_load_hook by the embedder.

libloading/dlopen/LoadLibraryEx are FFI calls and require unsafe, which is banned in lua-stdlib. lua-cli installs a libloading-backed implementation. None causes package.loadlib to return the C-Lua "absent" failure shape, matching the fallback platform stub.

see_global mirrors C-Lua’s seeglb (POSIX RTLD_GLOBAL): set when the caller invokes package.loadlib(path, "*").