pub(crate) trait WorkerEventLoopMethods {
type WorkerMsg: QueuedTaskConversion + Send;
type ControlMsg;
type Event;
// Required methods
fn task_queue(&self) -> &TaskQueue<Self::WorkerMsg>;
fn handle_event(&self, event: Self::Event, cx: &mut JSContext) -> bool;
fn handle_worker_post_event(
&self,
worker: &Trusted<Worker>,
) -> Option<AutoWorkerReset<'_>>;
fn from_control_msg(msg: Self::ControlMsg) -> Self::Event;
fn from_worker_msg(msg: Self::WorkerMsg) -> Self::Event;
fn from_devtools_msg(msg: DevtoolScriptControlMsg) -> Self::Event;
fn from_timer_msg() -> Self::Event;
fn control_receiver(&self) -> &Receiver<Self::ControlMsg>;
// Provided methods
fn from_animation_frame_tick_msg(
_msg: WorkerAnimationFrameTick,
) -> Option<Self::Event> { ... }
fn animation_frame_tick_receiver(
&self,
) -> Option<&RoutedReceiver<WorkerAnimationFrameTick>> { ... }
}Required Associated Types§
Required Methods§
fn task_queue(&self) -> &TaskQueue<Self::WorkerMsg>
fn handle_event(&self, event: Self::Event, cx: &mut JSContext) -> bool
fn handle_worker_post_event( &self, worker: &Trusted<Worker>, ) -> Option<AutoWorkerReset<'_>>
fn from_control_msg(msg: Self::ControlMsg) -> Self::Event
fn from_worker_msg(msg: Self::WorkerMsg) -> Self::Event
fn from_devtools_msg(msg: DevtoolScriptControlMsg) -> Self::Event
fn from_timer_msg() -> Self::Event
fn control_receiver(&self) -> &Receiver<Self::ControlMsg>
Provided Methods§
fn from_animation_frame_tick_msg( _msg: WorkerAnimationFrameTick, ) -> Option<Self::Event>
fn animation_frame_tick_receiver( &self, ) -> Option<&RoutedReceiver<WorkerAnimationFrameTick>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.