Struct deno_runtime::web_worker::WebWorkerInternalHandle
source · pub struct WebWorkerInternalHandle {
pub port: Rc<MessagePort>,
pub cancel: Rc<CancelHandle>,
pub name: String,
pub worker_type: WebWorkerType,
/* private fields */
}
Fields§
§port: Rc<MessagePort>
§cancel: Rc<CancelHandle>
§name: String
§worker_type: WebWorkerType
Implementations§
source§impl WebWorkerInternalHandle
impl WebWorkerInternalHandle
sourcepub fn post_event(&self, event: WorkerControlEvent) -> Result<(), AnyError>
pub fn post_event(&self, event: WorkerControlEvent) -> Result<(), AnyError>
Post WorkerEvent to parent as a worker
sourcepub fn is_terminated(&self) -> bool
pub fn is_terminated(&self) -> bool
Check if this worker is terminated or being terminated
sourcepub fn terminate_if_needed(&mut self) -> bool
pub fn terminate_if_needed(&mut self) -> bool
Check if this worker must terminate (because the termination signal is
set), and terminates it if so. Returns whether the worker is terminated or
being terminated, as with Self::is_terminated()
.
Trait Implementations§
source§impl Clone for WebWorkerInternalHandle
impl Clone for WebWorkerInternalHandle
source§fn clone(&self) -> WebWorkerInternalHandle
fn clone(&self) -> WebWorkerInternalHandle
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more