#[non_exhaustive]pub struct ThreadTriggers {
pub on_create: bool,
pub on_resume: bool,
pub on_yield: bool,
}Expand description
Controls which thread lifecycle events trigger the callback.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.on_create: boolTrigger the callback when a new thread is created.
On Luau this fires for every thread creation, on other Lua versions only for threads created
via Lua::create_thread.
on_resume: boolTrigger the callback before a thread is resumed via Thread::resume (or an async resume
driven by mlua). It does not fire for a coroutine.resume performed inside Lua code.
on_yield: boolTrigger the callback after a thread yields back to a Thread::resume driven by mlua.
It does not fire for a yield consumed by a coroutine.resume inside Lua code.
Implementations§
Source§impl ThreadTriggers
impl ThreadTriggers
Sourcepub const ON_CREATE: Self
pub const ON_CREATE: Self
An instance of ThreadTriggers with on_create trigger set.
Sourcepub const ON_RESUME: Self
pub const ON_RESUME: Self
An instance of ThreadTriggers with on_resume trigger set.
Sourcepub const ON_YIELD: Self
pub const ON_YIELD: Self
An instance of ThreadTriggers with on_yield trigger set.
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Returns a new instance of ThreadTriggers with all triggers disabled.
Sourcepub const fn on_create(self) -> Self
pub const fn on_create(self) -> Self
Returns an instance of ThreadTriggers with on_create trigger set.
Trait Implementations§
Source§impl BitOr for ThreadTriggers
impl BitOr for ThreadTriggers
Source§impl BitOrAssign for ThreadTriggers
impl BitOrAssign for ThreadTriggers
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|= operation. Read moreSource§impl Clone for ThreadTriggers
impl Clone for ThreadTriggers
Source§fn clone(&self) -> ThreadTriggers
fn clone(&self) -> ThreadTriggers
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ThreadTriggers
Source§impl Debug for ThreadTriggers
impl Debug for ThreadTriggers
Source§impl Default for ThreadTriggers
impl Default for ThreadTriggers
Source§fn default() -> ThreadTriggers
fn default() -> ThreadTriggers
Auto Trait Implementations§
impl Freeze for ThreadTriggers
impl RefUnwindSafe for ThreadTriggers
impl Send for ThreadTriggers
impl Sync for ThreadTriggers
impl Unpin for ThreadTriggers
impl UnsafeUnpin for ThreadTriggers
impl UnwindSafe for ThreadTriggers
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> 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 more