Struct script::dom::worklet::WorkletThreadRole
source · struct WorkletThreadRole {
receiver: Receiver<WorkletData>,
sender: Sender<WorkletData>,
is_hot_backup: bool,
is_cold_backup: bool,
}
Expand description
A role that a worklet thread can be playing.
These roles are used as tokens or capabilities, we track unique ownership using Rust’s types, and use atomic swapping to exchange them between worklet threads. This ensures that each thread pool has exactly one primary, one hot backup and one cold backup.
Fields§
§receiver: Receiver<WorkletData>
§sender: Sender<WorkletData>
§is_hot_backup: bool
§is_cold_backup: bool
Implementations§
source§impl WorkletThreadRole
impl WorkletThreadRole
fn new(is_hot_backup: bool, is_cold_backup: bool) -> WorkletThreadRole
Auto Trait Implementations§
impl RefUnwindSafe for WorkletThreadRole
impl Send for WorkletThreadRole
impl Sync for WorkletThreadRole
impl Unpin for WorkletThreadRole
impl UnwindSafe for WorkletThreadRole
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> 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> MaybeBoxed<Box<T, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert