pub struct Context { /* private fields */ }
Expand description

A single execution context with its own global variables and stack.

Can share objects with other contexts of the same runtime.

Implementations

Creates a base context with only the required functions registered. If additional functions are required use Context::custom, Context::builder or Context::full.

Creates a context with only the required intrinsics registered. If additional functions are required use Context::custom, Context::builder or Context::full.

Creates a context with all standart available intrinsics registered. If precise controll is required of which functions are available use Context::custom or Context::builder.

Create a context builder for creating a context with a specific set of intrinsics

Returns the associated runtime

A entry point for manipulating and using javascript objects and scripts. The api is structured this way to avoid repeated locking the runtime when ever any function is called. This way the runtime is locked once before executing the callback. Furthermore, this way it is impossible to use values from different runtimes in this context which would otherwise be undefined behaviour.

This is the only way to get a Ctx object.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Executes the destructor for this type. Read more

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.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

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.