Struct mlua::HookTriggers
source · [−]pub struct HookTriggers {
pub on_calls: bool,
pub on_returns: bool,
pub every_line: bool,
pub every_nth_instruction: Option<u32>,
}
luau
only.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
sourceimpl HookTriggers
impl HookTriggers
sourcepub fn on_returns() -> Self
pub fn on_returns() -> Self
Returns a new instance of HookTriggers
with on_returns
trigger set.
sourcepub fn every_line() -> Self
pub fn every_line() -> Self
Returns a new instance of HookTriggers
with every_line
trigger set.
sourcepub fn every_nth_instruction(n: u32) -> Self
pub fn every_nth_instruction(n: u32) -> Self
Returns a new instance of HookTriggers
with every_nth_instruction
trigger set.
Trait Implementations
sourceimpl BitOr<HookTriggers> for HookTriggers
impl BitOr<HookTriggers> for HookTriggers
sourceimpl BitOrAssign<HookTriggers> for HookTriggers
impl BitOrAssign<HookTriggers> for HookTriggers
sourcefn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the |=
operation. Read more
sourceimpl Clone for HookTriggers
impl Clone for HookTriggers
sourcefn clone(&self) -> HookTriggers
fn clone(&self) -> HookTriggers
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for HookTriggers
impl Debug for HookTriggers
sourceimpl Default for HookTriggers
impl Default for HookTriggers
sourcefn default() -> HookTriggers
fn default() -> HookTriggers
Returns the “default value” for a type. Read more
impl Copy for HookTriggers
Auto Trait Implementations
impl RefUnwindSafe for HookTriggers
impl Send for HookTriggers
impl Sync for HookTriggers
impl Unpin for HookTriggers
impl UnwindSafe for HookTriggers
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more