pub type Hook = extern "C-unwind" fn(lua: LuaState, info: &mut DebugInfo);Expand description
Debugging function that is called by specified HookEvents.
See LuaState::set_hook for more information on how to enable an Hook.
There can only be one Hook enabled at a time.
When called, info can be used to retrieve the HookEvent that called the hook (see DebugInfo::event).
If HookEvent::Line is the event that called the Hook, DebugInfo::current_line will also be set.
To get more information about the function that was running at the time,
LuaState::get_info can be called using info without needing to specify a function using LuaState::get_stack.
While the current Hook is running, it cannot be called again.
Which means it is possible to call other functions from within the hook itself without issues.
Just like CFunction, this type is technically a subset of lua_Hook, as it only allows safe functions.
Different methods will use either lua_Hook or Hook based on if they work with only safe functions or not.