Struct mlua::HookTriggers[][src]

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

Returns a new instance of HookTriggers with on_calls trigger set.

Returns a new instance of HookTriggers with on_returns trigger set.

Returns a new instance of HookTriggers with every_line trigger set.

Returns a new instance of HookTriggers with every_nth_instruction trigger set.

Trait Implementations

The resulting type after applying the | operator.

Performs the | operation. Read more

Performs the |= operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.