pub struct QuickJsRealmAdapter {
    pub id: String,
    pub context: *mut JSContext,
    /* private fields */
}

Fields

id: Stringcontext: *mut JSContext

Implementations

get the id of a QuickJsContext from a JSContext

Safety

when passing a context ptr please be sure that the corresponding QuickJsContext is still active

call a function by namespace and name

evaluate a script

Safety

when passing a context ptr please be sure that the corresponding QuickJsContext is still active

evaluate a Module

Safety

when passing a context ptr please be sure that the corresponding QuickJsContext is still active

throw an internal error to quickjs and create a new ex obj

throw an Error in the runtime and init an Exception JSValue to return

Safety

when passing a context ptr please be sure that the corresponding QuickJsContext is still active

Get the last exception from the runtime, and if present, convert it to a JsError.

Get the last exception from the runtime, and if present, convert it to a JsError.

Safety

When passing a context pointer please make sure the corresponding QuickJsContext is still valid

Safety

When passing a context pointer please make sure the corresponding QuickJsContext is still valid

Trait Implementations

Executes the destructor for this type. Read more

resolve this JsPromiseAdapter

reject this JsPromiseAdapter

get the JsValueAdapter for this Promise

get the id of this Realm

get a Weak reference to the JsRuntimeFacadeInner this can be used to e.g. add a job to that JsRuntimeFacadeInner for resolving promises async Read more

get the name of the current module or script for modules loaded via the HttpModuleLoader these will have a https:// prefix modules loaded via the FileSystemModuleLoader will have a file:// prefix Read more

eval a script please only use this for debugging/testing purposes although most JS engines will return values as if really calling a eval() method some may not (e.g. StarLight requires a return statement) Read more

install a JsProxy into this Realm

instantiate a JsProxy instance value based on an instance_id this instance_id will be passed to the JsProxy’s member methods Read more

instantiate a JsProxy instance value an instance_id will be generated and returned this instance_id will be passed to the JsProxy’s member methods Read more

dispatch an event to a JsProxy instance

dispatch a static event to a JsProxy

install a function into this realm

install a function into this realm based on a closure

evaluate a module

get the global object

get a namespace obj, when not present parts will be created

invoke a function by name

invoke a member function of an object by name

invoke a Funtion

create a new Function

delete a property of an Object

set a property of an Object

get a property of an Object

create a new Object

invoke a constructor Function to create new Object

get all property names of an Object

traverse all properties of an Object

traverse all properties of an Object with a FnMut

get an element of an Array

set an element of an Array

get the length of an Array

create a new Array

traverse all objects in an Array

traverse all objects in an Array

create a null value

create an undefined value

create a Number value based on an i32

create a String value

create a Boolean value

create a Number value based on an f64

create a new Promise this returns JsPromiseAdapter which can be turned into a JsValueAdapter but can also be used to fulfill the promise Read more

add reactions to an existing Promise object

cache a JsPromiseAdapter so it can be accessed later based on an id, while cached the JsPromiseAdapter object will not be garbage collected

Consume a JsPromiseAdapter (remove from cache)

cache a Object so it can be accessed later based on an id, while cached the Object will not be garbage collected

remove an Object from the cache

use an Object in the cache

get and remove an Object from the cache

check if a JsValueAdapter is an instance of another JsValueAdapter

turn any JsValueAdapter into a JSON string

parse a JSON string into a JsValueAdapter

create a new typed array

create a new typed array

convert a JSValueAdapter to a Send able JSValueFacade you’ll need this to pass values out of the JSRuntimeAdapter’s worker thread the other way around you’ll need from_js_value_facade to move values into the worker thread Read more

convert a JSValueFacade into a JSValueAdapter you need this to move values into the worker thread from a different thread (JSValueAdapter cannot leave the worker thread) Read more

push an element into an Array

create a new Promise with a Future which will run async and then resolve or reject the promise the mapper is used to convert the result of the future into a JSValueAdapter Read more

create a new Promise with a FnOnce producer which will run async and then resolve or reject the promise the mapper is used to convert the result of the future into a JSValueAdapter Read more

check if a JsValueAdapter is an instance of a constructor by name 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

Performs the conversion.

Performs the conversion.

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.