pub struct HookTriggers {
pub on_calls: bool,
pub on_returns: bool,
pub every_line: bool,
pub every_nth_instruction: Option<u32>,
}Expand description
Determines when a hook function will be called by Lua.
Fields§
§on_calls: boolBefore a function call.
on_returns: boolWhen Lua returns from a function.
every_line: boolBefore executing a new line, or returning from a function call.
every_nth_instruction: Option<u32>After a certain number of VM instructions have been executed. When set to Some(count),
count is the number of VM instructions to execute before calling the hook.
§Performance
Setting this option to a low value can incur a very high overhead.
Implementations§
Source§impl HookTriggers
impl HookTriggers
Sourcepub const ON_CALLS: HookTriggers
pub const ON_CALLS: HookTriggers
An instance of HookTriggers with on_calls trigger set.
Sourcepub const ON_RETURNS: HookTriggers
pub const ON_RETURNS: HookTriggers
An instance of HookTriggers with on_returns trigger set.
Sourcepub const EVERY_LINE: HookTriggers
pub const EVERY_LINE: HookTriggers
An instance of HookTriggers with every_line trigger set.
Sourcepub const fn new() -> HookTriggers
pub const fn new() -> HookTriggers
Returns a new instance of HookTriggers with all triggers disabled.
Sourcepub const fn on_calls(self) -> HookTriggers
pub const fn on_calls(self) -> HookTriggers
Returns an instance of HookTriggers with on_calls trigger set.
Sourcepub const fn on_returns(self) -> HookTriggers
pub const fn on_returns(self) -> HookTriggers
Returns an instance of HookTriggers with on_returns trigger set.
Sourcepub const fn every_line(self) -> HookTriggers
pub const fn every_line(self) -> HookTriggers
Returns an instance of HookTriggers with every_line trigger set.
Sourcepub const fn every_nth_instruction(self, n: u32) -> HookTriggers
pub const fn every_nth_instruction(self, n: u32) -> HookTriggers
Returns an instance of HookTriggers with every_nth_instruction trigger set.
Trait Implementations§
Source§impl BitOr for HookTriggers
impl BitOr for HookTriggers
Source§type Output = HookTriggers
type Output = HookTriggers
| operator.Source§fn bitor(self, rhs: HookTriggers) -> <HookTriggers as BitOr>::Output
fn bitor(self, rhs: HookTriggers) -> <HookTriggers as BitOr>::Output
| operation. Read moreSource§impl BitOrAssign for HookTriggers
impl BitOrAssign for HookTriggers
Source§fn bitor_assign(&mut self, rhs: HookTriggers)
fn bitor_assign(&mut self, rhs: HookTriggers)
|= operation. Read moreSource§impl Clone for HookTriggers
impl Clone for HookTriggers
Source§fn clone(&self) -> HookTriggers
fn clone(&self) -> HookTriggers
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more