Struct rlua::HookTriggers
source · 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: bool
Before a function call.
on_returns: bool
When Lua returns from a function.
every_line: bool
Before 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
§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