pub struct EventLoop {
script_chan: GenericSender<ScriptThreadMessage>,
id: ScriptEventLoopId,
background_hang_monitor_sender: Option<GenericSender<BackgroundHangMonitorControlMsg>>,
dont_send_or_sync: PhantomData<Rc<()>>,
}Expand description
Fields§
§script_chan: GenericSender<ScriptThreadMessage>§id: ScriptEventLoopId§background_hang_monitor_sender: Option<GenericSender<BackgroundHangMonitorControlMsg>>When running in another process, this is an IpcSender to the BackgroundHangMonitor
on the other side of the process boundary. When running in the same process, the
BackgroundHangMonitor is shared among all EventLoops so this will be None.
dont_send_or_sync: PhantomData<Rc<()>>Implementations§
Source§impl EventLoop
impl EventLoop
pub(crate) fn spawn<STF: ScriptThreadFactory, SWF: ServiceWorkerManagerFactory>( constellation: &mut Constellation<STF, SWF>, is_private: bool, ) -> Result<Rc<Self>, Error>
fn spawn_in_thread<STF: ScriptThreadFactory, SWF: ServiceWorkerManagerFactory>( constellation: &mut Constellation<STF, SWF>, initial_script_state: InitialScriptState, ) -> Self
fn spawn_in_process<STF: ScriptThreadFactory, SWF: ServiceWorkerManagerFactory>( constellation: &mut Constellation<STF, SWF>, initial_script_state: InitialScriptState, ) -> Result<Self, Error>
pub(crate) fn id(&self) -> ScriptEventLoopId
Sourcepub fn send(&self, msg: ScriptThreadMessage) -> Result<(), Error>
pub fn send(&self, msg: ScriptThreadMessage) -> Result<(), Error>
Send a message to the event loop.
Sourcepub(crate) fn send_message_to_background_hang_monitor(
&self,
message: &BackgroundHangMonitorControlMsg,
)
pub(crate) fn send_message_to_background_hang_monitor( &self, message: &BackgroundHangMonitorControlMsg, )
If this is EventLoop is in another process, send a message to its BackgroundHangMonitor,
otherwise do nothing.
Trait Implementations§
impl Eq for EventLoop
Auto Trait Implementations§
impl Freeze for EventLoop
impl !RefUnwindSafe for EventLoop
impl !Send for EventLoop
impl !Sync for EventLoop
impl Unpin for EventLoop
impl !UnwindSafe for EventLoop
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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>
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
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