Struct deno_runtime::web_worker::WebWorker
source ·
[−]pub struct WebWorker {
pub js_runtime: JsRuntime,
pub name: String,
pub use_deno_namespace: bool,
pub worker_type: WebWorkerType,
pub main_module: ModuleSpecifier,
// some fields omitted
}
Expand description
This struct is an implementation of Worker
Web API
Each WebWorker
is either a child of MainWorker
or other
WebWorker
.
Fields
js_runtime: JsRuntime
name: String
use_deno_namespace: bool
worker_type: WebWorkerType
main_module: ModuleSpecifier
Implementations
pub fn bootstrap_from_options(
name: String,
permissions: Permissions,
main_module: ModuleSpecifier,
worker_id: WorkerId,
options: WebWorkerOptions
) -> (Self, SendableWebWorkerHandle)
pub fn from_options(
name: String,
permissions: Permissions,
main_module: ModuleSpecifier,
worker_id: WorkerId,
options: WebWorkerOptions
) -> (Self, SendableWebWorkerHandle)
pub async fn preload_module(
&mut self,
module_specifier: &ModuleSpecifier,
main: bool
) -> Result<ModuleId, AnyError>
pub async fn preload_module(
&mut self,
module_specifier: &ModuleSpecifier,
main: bool
) -> Result<ModuleId, AnyError>
Loads and instantiates specified JavaScript module as “main” or “side” module.
pub async fn execute_main_module(
&mut self,
module_specifier: &ModuleSpecifier
) -> Result<(), AnyError>
pub async fn execute_main_module(
&mut self,
module_specifier: &ModuleSpecifier
) -> Result<(), AnyError>
Loads, instantiates and executes specified JavaScript module.
Auto Trait Implementations
impl !RefUnwindSafe for WebWorker
impl !UnwindSafe for WebWorker
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more