pub struct WebWorker {
    pub js_runtime: JsRuntime,
    pub name: String,
    pub worker_type: WebWorkerType,
    pub main_module: ModuleSpecifier,
    /* private fields */
}
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§worker_type: WebWorkerType§main_module: ModuleSpecifier

Implementations§

Loads and instantiates specified JavaScript module as “main” module.

Loads and instantiates specified JavaScript module as “side” module.

Loads, instantiates and executes specified JavaScript module.

This method assumes that worker can’t be terminated when executing side module code.

Loads, instantiates and executes specified JavaScript module.

This module will have “import.meta.main” equal to true.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
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