pub struct LuaHookTriggers {
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
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 moreSource§impl Debug for HookTriggers
impl Debug for HookTriggers
Source§impl Default for HookTriggers
impl Default for HookTriggers
Source§fn default() -> HookTriggers
fn default() -> HookTriggers
impl Copy for HookTriggers
Auto Trait Implementations§
impl Freeze for HookTriggers
impl RefUnwindSafe for HookTriggers
impl Send for HookTriggers
impl Sync for HookTriggers
impl Unpin for HookTriggers
impl UnwindSafe for HookTriggers
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self
using default()
.
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoNamespace for Twhere
T: 'static + ?Sized,
impl<T> IntoNamespace for Twhere
T: 'static + ?Sized,
Source§fn into_namespace() -> Namespace
fn into_namespace() -> Namespace
Namespace