pub struct MainWorker {
    pub js_runtime: JsRuntime,
    /* private fields */
}
Expand description

This worker is created and used by almost all subcommands in Deno executable.

It provides ops available in the Deno namespace.

All WebWorkers created during program execution are descendants of this worker.

Fields

js_runtime: JsRuntime

Implementations

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

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

Executes specified JavaScript module.

Loads, instantiates and executes specified JavaScript module.

Loads, instantiates and executes specified JavaScript module.

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

Create new inspector session. This function panics if Worker was not configured to create inspector.

A utility function that runs provided future concurrently with the event loop.

Useful when using a local inspector session.

Return exit code set by the executed code (either in main worker or one of child web workers).

Dispatches “load” event to the JavaScript runtime.

Does not poll event loop, and thus not await any of the “load” event handlers.

Dispatches “unload” event to the JavaScript runtime.

Does not poll event loop, and thus not await any of the “unload” event handlers.

Dispatches “beforeunload” event to the JavaScript runtime. Returns a boolean indicating if the event was prevented and thus event loop should continue running.

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