#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
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_resume: boolTrigger the callback before a thread is resumed (via Thread::resume).
on_yield: boolTrigger the callback after a thread yields.
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)
Performs the
|= operation. Read moreSource§impl Clone for ThreadTriggers
impl Clone for ThreadTriggers
Source§fn clone(&self) -> ThreadTriggers
fn clone(&self) -> ThreadTriggers
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ThreadTriggers
impl Debug for ThreadTriggers
Source§impl Default for ThreadTriggers
impl Default for ThreadTriggers
Source§fn default() -> ThreadTriggers
fn default() -> ThreadTriggers
Returns the “default value” for a type. Read more
impl Copy for 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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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