pub struct Debug<'lua> { /* private fields */ }
Expand description
Contains information about currently executing Lua code.
The Debug
structure is provided as a parameter to the hook function set with
Lua::set_hook
. You may call the methods on this structure to retrieve information about the
Lua code executing at the time that the hook function was called. Further information can be
found in the Lua documentation.
Implementations§
Source§impl<'lua> Debug<'lua>
impl<'lua> Debug<'lua>
Sourcepub fn event(&self) -> DebugEvent
pub fn event(&self) -> DebugEvent
Returns the specific event that triggered the hook.
For Lua 5.1 DebugEvent::TailCall
is used for return events to indicate a return
from a function that did a tail call.
Sourcepub fn names(&self) -> DebugNames<'_>
pub fn names(&self) -> DebugNames<'_>
Corresponds to the n
what mask.
Sourcepub fn source(&self) -> DebugSource<'_>
pub fn source(&self) -> DebugSource<'_>
Corresponds to the S
what mask.
Sourcepub fn is_tail_call(&self) -> bool
pub fn is_tail_call(&self) -> bool
Corresponds to the t
what mask. Returns true if the hook is in a function tail call, false
otherwise.
Sourcepub fn stack(&self) -> DebugStack
pub fn stack(&self) -> DebugStack
Corresponds to the u
what mask.
Auto Trait Implementations§
impl<'lua> !Freeze for Debug<'lua>
impl<'lua> !RefUnwindSafe for Debug<'lua>
impl<'lua> !Send for Debug<'lua>
impl<'lua> !Sync for Debug<'lua>
impl<'lua> Unpin for Debug<'lua>
impl<'lua> !UnwindSafe for Debug<'lua>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more