pub struct QuickJsRealmAdapter {
pub id: String,
pub context: *mut JSContext,
/* private fields */
}Fields
id: Stringcontext: *mut JSContextImplementations
sourceimpl QuickJsRealmAdapter
impl QuickJsRealmAdapter
sourcepub unsafe fn get_id(context: *mut JSContext) -> &'static str
pub unsafe fn get_id(context: *mut JSContext) -> &'static str
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
sourcepub fn call_function(
&self,
namespace: Vec<&str>,
func_name: &str,
arguments: Vec<JSValueRef>
) -> Result<JSValueRef, JsError>
pub fn call_function(
&self,
namespace: Vec<&str>,
func_name: &str,
arguments: Vec<JSValueRef>
) -> Result<JSValueRef, JsError>
call a function by namespace and name
sourcepub unsafe fn eval_ctx(
context: *mut JSContext,
script: Script
) -> Result<JSValueRef, JsError>
pub unsafe fn eval_ctx(
context: *mut JSContext,
script: Script
) -> Result<JSValueRef, JsError>
Safety
when passing a context ptr please be sure that the corresponding QuickJsContext is still active
sourcepub fn eval_module(&self, script: Script) -> Result<JSValueRef, JsError>
pub fn eval_module(&self, script: Script) -> Result<JSValueRef, JsError>
evaluate a Module
sourcepub unsafe fn eval_module_ctx(
context: *mut JSContext,
script: Script
) -> Result<JSValueRef, JsError>
pub unsafe fn eval_module_ctx(
context: *mut JSContext,
script: Script
) -> Result<JSValueRef, JsError>
Safety
when passing a context ptr please be sure that the corresponding QuickJsContext is still active
sourcepub fn report_ex(&self, err: &str) -> JSValue
pub fn report_ex(&self, err: &str) -> JSValue
throw an internal error to quickjs and create a new ex obj
sourcepub unsafe fn report_ex_ctx(context: *mut JSContext, err: &str) -> JSValue
pub unsafe fn report_ex_ctx(context: *mut JSContext, err: &str) -> JSValue
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
sourcepub fn get_exception_ctx(&self) -> Option<JsError>
pub fn get_exception_ctx(&self) -> Option<JsError>
Get the last exception from the runtime, and if present, convert it to a JsError.
sourcepub unsafe fn get_exception(context: *mut JSContext) -> Option<JsError>
pub unsafe fn get_exception(context: *mut JSContext) -> Option<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
pub fn cache_object(&self, obj: JSValueRef) -> i32
pub fn remove_cached_obj_if_present(&self, id: i32)
pub fn consume_cached_obj(&self, id: i32) -> JSValueRef
pub fn with_cached_obj<C, R>(&self, id: i32, consumer: C) -> R where
C: FnOnce(JSValueRef) -> R,
sourcepub unsafe fn with_context<C, R>(context: *mut JSContext, consumer: C) -> R where
C: FnOnce(&QuickJsRealmAdapter) -> R,
pub unsafe fn with_context<C, R>(context: *mut JSContext, consumer: C) -> R where
C: FnOnce(&QuickJsRealmAdapter) -> R,
Safety
When passing a context pointer please make sure the corresponding QuickJsContext is still valid
Trait Implementations
sourceimpl Drop for QuickJsRealmAdapter
impl Drop for QuickJsRealmAdapter
sourceimpl JsPromiseAdapter<QuickJsRealmAdapter> for PromiseRef
impl JsPromiseAdapter<QuickJsRealmAdapter> for PromiseRef
sourcefn js_promise_resolve(
&self,
context: &QuickJsRealmAdapter,
resolution: &JSValueRef
) -> Result<(), JsError>
fn js_promise_resolve(
&self,
context: &QuickJsRealmAdapter,
resolution: &JSValueRef
) -> Result<(), JsError>
resolve this JsPromiseAdapter
sourcefn js_promise_reject(
&self,
context: &QuickJsRealmAdapter,
rejection: &JSValueRef
) -> Result<(), JsError>
fn js_promise_reject(
&self,
context: &QuickJsRealmAdapter,
rejection: &JSValueRef
) -> Result<(), JsError>
reject this JsPromiseAdapter
sourcefn js_promise_get_value(&self, _realm: &QuickJsRealmAdapter) -> JSValueRef
fn js_promise_get_value(&self, _realm: &QuickJsRealmAdapter) -> JSValueRef
get the JsValueAdapter for this Promise
sourceimpl JsRealmAdapter for QuickJsRealmAdapter
impl JsRealmAdapter for QuickJsRealmAdapter
type JsRuntimeAdapterType = QuickJsRuntimeAdapter
type JsValueAdapterType = JSValueRef
sourcefn js_get_realm_id(&self) -> &str
fn js_get_realm_id(&self) -> &str
get the id of this Realm
sourcefn js_get_runtime_facade_inner(&self) -> Weak<QuickjsRuntimeFacadeInner>
fn js_get_runtime_facade_inner(&self) -> Weak<QuickjsRuntimeFacadeInner>
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
sourcefn js_get_script_or_module_name(&self) -> Result<String, JsError>
fn js_get_script_or_module_name(&self) -> Result<String, JsError>
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
sourcefn js_eval(&self, script: Script) -> Result<JSValueRef, JsError>
fn js_eval(&self, script: Script) -> Result<JSValueRef, JsError>
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
sourcefn js_proxy_install(
&self,
proxy: JsProxy<QuickJsRealmAdapter>,
add_global_var: bool
) -> Result<JSValueRef, JsError>
fn js_proxy_install(
&self,
proxy: JsProxy<QuickJsRealmAdapter>,
add_global_var: bool
) -> Result<JSValueRef, JsError>
install a JsProxy into this Realm
sourcefn js_proxy_instantiate_with_id(
&self,
namespace: &[&str],
class_name: &str,
instance_id: usize
) -> Result<Self::JsValueAdapterType, JsError>
fn js_proxy_instantiate_with_id(
&self,
namespace: &[&str],
class_name: &str,
instance_id: usize
) -> Result<Self::JsValueAdapterType, JsError>
instantiate a JsProxy instance value based on an instance_id this instance_id will be passed to the JsProxy’s member methods Read more
sourcefn js_proxy_instantiate(
&self,
namespace: &[&str],
class_name: &str,
arguments: &[JSValueRef]
) -> Result<(JsProxyInstanceId, JSValueRef), JsError>
fn js_proxy_instantiate(
&self,
namespace: &[&str],
class_name: &str,
arguments: &[JSValueRef]
) -> Result<(JsProxyInstanceId, JSValueRef), JsError>
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
sourcefn js_proxy_dispatch_event(
&self,
namespace: &[&str],
class_name: &str,
proxy_instance_id: &usize,
event_id: &str,
event_obj: &JSValueRef
) -> Result<bool, JsError>
fn js_proxy_dispatch_event(
&self,
namespace: &[&str],
class_name: &str,
proxy_instance_id: &usize,
event_id: &str,
event_obj: &JSValueRef
) -> Result<bool, JsError>
dispatch an event to a JsProxy instance
sourcefn js_proxy_dispatch_static_event(
&self,
namespace: &[&str],
class_name: &str,
event_id: &str,
event_obj: &Self::JsValueAdapterType
) -> Result<bool, JsError>
fn js_proxy_dispatch_static_event(
&self,
namespace: &[&str],
class_name: &str,
event_id: &str,
event_obj: &Self::JsValueAdapterType
) -> Result<bool, JsError>
dispatch a static event to a JsProxy
sourcefn js_install_function(
&self,
namespace: &[&str],
name: &str,
js_function: fn(_: &QuickJsRuntimeAdapter, _: &Self, _: &JSValueRef, _: &[JSValueRef]) -> Result<JSValueRef, JsError>,
arg_count: u32
) -> Result<(), JsError>
fn js_install_function(
&self,
namespace: &[&str],
name: &str,
js_function: fn(_: &QuickJsRuntimeAdapter, _: &Self, _: &JSValueRef, _: &[JSValueRef]) -> Result<JSValueRef, JsError>,
arg_count: u32
) -> Result<(), JsError>
install a function into this realm
sourcefn js_install_closure<F: Fn(&QuickJsRuntimeAdapter, &Self, &JSValueRef, &[JSValueRef]) -> Result<JSValueRef, JsError> + 'static>(
&self,
namespace: &[&str],
name: &str,
js_function: F,
arg_count: u32
) -> Result<(), JsError>
fn js_install_closure<F: Fn(&QuickJsRuntimeAdapter, &Self, &JSValueRef, &[JSValueRef]) -> Result<JSValueRef, JsError> + 'static>(
&self,
namespace: &[&str],
name: &str,
js_function: F,
arg_count: u32
) -> Result<(), JsError>
install a function into this realm based on a closure
sourcefn js_eval_module(&self, script: Script) -> Result<JSValueRef, JsError>
fn js_eval_module(&self, script: Script) -> Result<JSValueRef, JsError>
evaluate a module
sourcefn js_get_global(&self) -> Result<Self::JsValueAdapterType, JsError>
fn js_get_global(&self) -> Result<Self::JsValueAdapterType, JsError>
get the global object
sourcefn js_get_namespace(&self, namespace: &[&str]) -> Result<JSValueRef, JsError>
fn js_get_namespace(&self, namespace: &[&str]) -> Result<JSValueRef, JsError>
get a namespace obj, when not present parts will be created
sourcefn js_function_invoke_by_name(
&self,
namespace: &[&str],
method_name: &str,
args: &[JSValueRef]
) -> Result<JSValueRef, JsError>
fn js_function_invoke_by_name(
&self,
namespace: &[&str],
method_name: &str,
args: &[JSValueRef]
) -> Result<JSValueRef, JsError>
invoke a function by name
sourcefn js_function_invoke_member_by_name(
&self,
this_obj: &JSValueRef,
method_name: &str,
args: &[JSValueRef]
) -> Result<JSValueRef, JsError>
fn js_function_invoke_member_by_name(
&self,
this_obj: &JSValueRef,
method_name: &str,
args: &[JSValueRef]
) -> Result<JSValueRef, JsError>
invoke a member function of an object by name
sourcefn js_function_invoke(
&self,
this_obj: Option<&JSValueRef>,
function_obj: &JSValueRef,
args: &[&JSValueRef]
) -> Result<JSValueRef, JsError>
fn js_function_invoke(
&self,
this_obj: Option<&JSValueRef>,
function_obj: &JSValueRef,
args: &[&JSValueRef]
) -> Result<JSValueRef, JsError>
invoke a Funtion
sourcefn js_function_create<F: Fn(&Self, &JSValueRef, &[JSValueRef]) -> Result<JSValueRef, JsError> + 'static>(
&self,
name: &str,
js_function: F,
arg_count: u32
) -> Result<JSValueRef, JsError>
fn js_function_create<F: Fn(&Self, &JSValueRef, &[JSValueRef]) -> Result<JSValueRef, JsError> + 'static>(
&self,
name: &str,
js_function: F,
arg_count: u32
) -> Result<JSValueRef, JsError>
create a new Function
fn js_error_create(
&self,
name: &str,
message: &str,
stack: &str
) -> Result<Self::JsValueAdapterType, JsError>
sourcefn js_object_delete_property(
&self,
object: &JSValueRef,
property_name: &str
) -> Result<(), JsError>
fn js_object_delete_property(
&self,
object: &JSValueRef,
property_name: &str
) -> Result<(), JsError>
delete a property of an Object
sourcefn js_object_set_property(
&self,
object: &JSValueRef,
property_name: &str,
property: &JSValueRef
) -> Result<(), JsError>
fn js_object_set_property(
&self,
object: &JSValueRef,
property_name: &str,
property: &JSValueRef
) -> Result<(), JsError>
set a property of an Object
sourcefn js_object_get_property(
&self,
object: &JSValueRef,
property_name: &str
) -> Result<JSValueRef, JsError>
fn js_object_get_property(
&self,
object: &JSValueRef,
property_name: &str
) -> Result<JSValueRef, JsError>
get a property of an Object
sourcefn js_object_create(&self) -> Result<JSValueRef, JsError>
fn js_object_create(&self) -> Result<JSValueRef, JsError>
create a new Object
sourcefn js_object_construct(
&self,
constructor: &JSValueRef,
args: &[&JSValueRef]
) -> Result<JSValueRef, JsError>
fn js_object_construct(
&self,
constructor: &JSValueRef,
args: &[&JSValueRef]
) -> Result<JSValueRef, JsError>
invoke a constructor Function to create new Object
sourcefn js_object_get_properties(
&self,
object: &JSValueRef
) -> Result<Vec<String>, JsError>
fn js_object_get_properties(
&self,
object: &JSValueRef
) -> Result<Vec<String>, JsError>
get all property names of an Object
sourcefn js_object_traverse<F, R>(
&self,
object: &JSValueRef,
visitor: F
) -> Result<Vec<R>, JsError> where
F: Fn(&str, &JSValueRef) -> Result<R, JsError>,
fn js_object_traverse<F, R>(
&self,
object: &JSValueRef,
visitor: F
) -> Result<Vec<R>, JsError> where
F: Fn(&str, &JSValueRef) -> Result<R, JsError>,
traverse all properties of an Object
sourcefn js_object_traverse_mut<F>(
&self,
object: &Self::JsValueAdapterType,
visitor: F
) -> Result<(), JsError> where
F: FnMut(&str, &Self::JsValueAdapterType) -> Result<(), JsError>,
fn js_object_traverse_mut<F>(
&self,
object: &Self::JsValueAdapterType,
visitor: F
) -> Result<(), JsError> where
F: FnMut(&str, &Self::JsValueAdapterType) -> Result<(), JsError>,
traverse all properties of an Object with a FnMut
sourcefn js_array_get_element(
&self,
array: &JSValueRef,
index: u32
) -> Result<JSValueRef, JsError>
fn js_array_get_element(
&self,
array: &JSValueRef,
index: u32
) -> Result<JSValueRef, JsError>
get an element of an Array
sourcefn js_array_set_element(
&self,
array: &JSValueRef,
index: u32,
element: &JSValueRef
) -> Result<(), JsError>
fn js_array_set_element(
&self,
array: &JSValueRef,
index: u32,
element: &JSValueRef
) -> Result<(), JsError>
set an element of an Array
sourcefn js_array_get_length(&self, array: &JSValueRef) -> Result<u32, JsError>
fn js_array_get_length(&self, array: &JSValueRef) -> Result<u32, JsError>
get the length of an Array
sourcefn js_array_create(&self) -> Result<JSValueRef, JsError>
fn js_array_create(&self) -> Result<JSValueRef, JsError>
create a new Array
sourcefn js_array_traverse<F, R>(
&self,
array: &JSValueRef,
visitor: F
) -> Result<Vec<R>, JsError> where
F: Fn(u32, &JSValueRef) -> Result<R, JsError>,
fn js_array_traverse<F, R>(
&self,
array: &JSValueRef,
visitor: F
) -> Result<Vec<R>, JsError> where
F: Fn(u32, &JSValueRef) -> Result<R, JsError>,
traverse all objects in an Array
sourcefn js_array_traverse_mut<F>(
&self,
array: &Self::JsValueAdapterType,
visitor: F
) -> Result<(), JsError> where
F: FnMut(u32, &Self::JsValueAdapterType) -> Result<(), JsError>,
fn js_array_traverse_mut<F>(
&self,
array: &Self::JsValueAdapterType,
visitor: F
) -> Result<(), JsError> where
F: FnMut(u32, &Self::JsValueAdapterType) -> Result<(), JsError>,
traverse all objects in an Array
sourcefn js_null_create(&self) -> Result<JSValueRef, JsError>
fn js_null_create(&self) -> Result<JSValueRef, JsError>
create a null value
sourcefn js_undefined_create(&self) -> Result<JSValueRef, JsError>
fn js_undefined_create(&self) -> Result<JSValueRef, JsError>
create an undefined value
sourcefn js_i32_create(&self, val: i32) -> Result<JSValueRef, JsError>
fn js_i32_create(&self, val: i32) -> Result<JSValueRef, JsError>
create a Number value based on an i32
sourcefn js_string_create(&self, val: &str) -> Result<JSValueRef, JsError>
fn js_string_create(&self, val: &str) -> Result<JSValueRef, JsError>
create a String value
sourcefn js_boolean_create(&self, val: bool) -> Result<JSValueRef, JsError>
fn js_boolean_create(&self, val: bool) -> Result<JSValueRef, JsError>
create a Boolean value
sourcefn js_f64_create(&self, val: f64) -> Result<JSValueRef, JsError>
fn js_f64_create(&self, val: f64) -> Result<JSValueRef, JsError>
create a Number value based on an f64
sourcefn js_promise_create(&self) -> Result<Box<dyn JsPromiseAdapter<Self>>, JsError>
fn js_promise_create(&self) -> Result<Box<dyn JsPromiseAdapter<Self>>, JsError>
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
sourcefn js_promise_add_reactions(
&self,
promise: &Self::JsValueAdapterType,
then: Option<Self::JsValueAdapterType>,
catch: Option<Self::JsValueAdapterType>,
finally: Option<Self::JsValueAdapterType>
) -> Result<(), JsError>
fn js_promise_add_reactions(
&self,
promise: &Self::JsValueAdapterType,
then: Option<Self::JsValueAdapterType>,
catch: Option<Self::JsValueAdapterType>,
finally: Option<Self::JsValueAdapterType>
) -> Result<(), JsError>
add reactions to an existing Promise object
sourcefn js_promise_cache_add(
&self,
promise_ref: Box<dyn JsPromiseAdapter<Self>>
) -> usize
fn js_promise_cache_add(
&self,
promise_ref: Box<dyn JsPromiseAdapter<Self>>
) -> usize
cache a JsPromiseAdapter so it can be accessed later based on an id, while cached the JsPromiseAdapter object will not be garbage collected
sourcefn js_promise_cache_consume(&self, id: usize) -> Box<dyn JsPromiseAdapter<Self>>
fn js_promise_cache_consume(&self, id: usize) -> Box<dyn JsPromiseAdapter<Self>>
Consume a JsPromiseAdapter (remove from cache)
sourcefn js_cache_add(&self, object: &JSValueRef) -> i32
fn js_cache_add(&self, object: &JSValueRef) -> i32
cache a Object so it can be accessed later based on an id, while cached the Object will not be garbage collected
sourcefn js_cache_dispose(&self, id: i32)
fn js_cache_dispose(&self, id: i32)
remove an Object from the cache
sourcefn js_cache_with<C, R>(&self, id: i32, consumer: C) -> R where
C: FnOnce(&JSValueRef) -> R,
fn js_cache_with<C, R>(&self, id: i32, consumer: C) -> R where
C: FnOnce(&JSValueRef) -> R,
use an Object in the cache
sourcefn js_cache_consume(&self, id: i32) -> JSValueRef
fn js_cache_consume(&self, id: i32) -> JSValueRef
get and remove an Object from the cache
sourcefn js_instance_of(&self, object: &JSValueRef, constructor: &JSValueRef) -> bool
fn js_instance_of(&self, object: &JSValueRef, constructor: &JSValueRef) -> bool
check if a JsValueAdapter is an instance of another JsValueAdapter
sourcefn js_json_stringify(
&self,
object: &JSValueRef,
opt_space: Option<&str>
) -> Result<String, JsError>
fn js_json_stringify(
&self,
object: &JSValueRef,
opt_space: Option<&str>
) -> Result<String, JsError>
turn any JsValueAdapter into a JSON string
sourcefn js_json_parse(&self, json_string: &str) -> Result<JSValueRef, JsError>
fn js_json_parse(&self, json_string: &str) -> Result<JSValueRef, JsError>
parse a JSON string into a JsValueAdapter
sourcefn js_typed_array_uint8_create(
&self,
buffer: Vec<u8>
) -> Result<Self::JsValueAdapterType, JsError>
fn js_typed_array_uint8_create(
&self,
buffer: Vec<u8>
) -> Result<Self::JsValueAdapterType, JsError>
create a new typed array
sourcefn js_typed_array_uint8_create_copy(
&self,
buffer: &[u8]
) -> Result<Self::JsValueAdapterType, JsError>
fn js_typed_array_uint8_create_copy(
&self,
buffer: &[u8]
) -> Result<Self::JsValueAdapterType, JsError>
create a new typed array
fn js_typed_array_detach_buffer(
&self,
array: &Self::JsValueAdapterType
) -> Result<Vec<u8>, JsError>
fn js_typed_array_copy_buffer(
&self,
array: &Self::JsValueAdapterType
) -> Result<Vec<u8>, JsError>
sourcefn to_js_value_facade(
&self,
js_value: &Self::JsValueAdapterType
) -> Result<JsValueFacade, JsError> where
Self: 'static,
fn to_js_value_facade(
&self,
js_value: &Self::JsValueAdapterType
) -> Result<JsValueFacade, JsError> where
Self: 'static,
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
sourcefn from_js_value_facade(
&self,
value_facade: JsValueFacade
) -> Result<Self::JsValueAdapterType, JsError> where
Self: 'static,
fn from_js_value_facade(
&self,
value_facade: JsValueFacade
) -> Result<Self::JsValueAdapterType, JsError> where
Self: 'static,
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
sourcefn js_array_push_element(
&self,
array: &Self::JsValueAdapterType,
element: &Self::JsValueAdapterType
) -> Result<u32, JsError>
fn js_array_push_element(
&self,
array: &Self::JsValueAdapterType,
element: &Self::JsValueAdapterType
) -> Result<u32, JsError>
push an element into an Array
sourcefn js_promise_create_resolving_async<P, R, M>(
&self,
producer: P,
mapper: M
) -> Result<Self::JsValueAdapterType, JsError> where
R: 'static + Send,
P: 'static + Future<Output = Result<R, JsError>> + Send,
M: 'static + FnOnce(&<<<<<Self::JsRuntimeAdapterType as JsRuntimeAdapter>::JsRuntimeFacadeType as JsRuntimeFacade>::JsRuntimeFacadeInnerType as JsRuntimeFacadeInner>::JsRuntimeFacadeType as JsRuntimeFacade>::JsRuntimeAdapterType as JsRuntimeAdapter>::JsRealmAdapterType, R) -> Result<<<<<<<Self::JsRuntimeAdapterType as JsRuntimeAdapter>::JsRuntimeFacadeType as JsRuntimeFacade>::JsRuntimeFacadeInnerType as JsRuntimeFacadeInner>::JsRuntimeFacadeType as JsRuntimeFacade>::JsRuntimeAdapterType as JsRuntimeAdapter>::JsRealmAdapterType as JsRealmAdapter>::JsValueAdapterType, JsError> + Send,
Self: 'static,
fn js_promise_create_resolving_async<P, R, M>(
&self,
producer: P,
mapper: M
) -> Result<Self::JsValueAdapterType, JsError> where
R: 'static + Send,
P: 'static + Future<Output = Result<R, JsError>> + Send,
M: 'static + FnOnce(&<<<<<Self::JsRuntimeAdapterType as JsRuntimeAdapter>::JsRuntimeFacadeType as JsRuntimeFacade>::JsRuntimeFacadeInnerType as JsRuntimeFacadeInner>::JsRuntimeFacadeType as JsRuntimeFacade>::JsRuntimeAdapterType as JsRuntimeAdapter>::JsRealmAdapterType, R) -> Result<<<<<<<Self::JsRuntimeAdapterType as JsRuntimeAdapter>::JsRuntimeFacadeType as JsRuntimeFacade>::JsRuntimeFacadeInnerType as JsRuntimeFacadeInner>::JsRuntimeFacadeType as JsRuntimeFacade>::JsRuntimeAdapterType as JsRuntimeAdapter>::JsRealmAdapterType as JsRealmAdapter>::JsValueAdapterType, JsError> + Send,
Self: 'static,
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
sourcefn js_promise_create_resolving<P, R, M>(
&self,
producer: P,
mapper: M
) -> Result<Self::JsValueAdapterType, JsError> where
R: 'static + Send,
P: 'static + FnOnce() -> Result<R, JsError> + Send,
M: 'static + FnOnce(&<<<<<Self::JsRuntimeAdapterType as JsRuntimeAdapter>::JsRuntimeFacadeType as JsRuntimeFacade>::JsRuntimeFacadeInnerType as JsRuntimeFacadeInner>::JsRuntimeFacadeType as JsRuntimeFacade>::JsRuntimeAdapterType as JsRuntimeAdapter>::JsRealmAdapterType, R) -> Result<<<<<<<Self::JsRuntimeAdapterType as JsRuntimeAdapter>::JsRuntimeFacadeType as JsRuntimeFacade>::JsRuntimeFacadeInnerType as JsRuntimeFacadeInner>::JsRuntimeFacadeType as JsRuntimeFacade>::JsRuntimeAdapterType as JsRuntimeAdapter>::JsRealmAdapterType as JsRealmAdapter>::JsValueAdapterType, JsError> + Send,
Self: 'static,
fn js_promise_create_resolving<P, R, M>(
&self,
producer: P,
mapper: M
) -> Result<Self::JsValueAdapterType, JsError> where
R: 'static + Send,
P: 'static + FnOnce() -> Result<R, JsError> + Send,
M: 'static + FnOnce(&<<<<<Self::JsRuntimeAdapterType as JsRuntimeAdapter>::JsRuntimeFacadeType as JsRuntimeFacade>::JsRuntimeFacadeInnerType as JsRuntimeFacadeInner>::JsRuntimeFacadeType as JsRuntimeFacade>::JsRuntimeAdapterType as JsRuntimeAdapter>::JsRealmAdapterType, R) -> Result<<<<<<<Self::JsRuntimeAdapterType as JsRuntimeAdapter>::JsRuntimeFacadeType as JsRuntimeFacade>::JsRuntimeFacadeInnerType as JsRuntimeFacadeInner>::JsRuntimeFacadeType as JsRuntimeFacade>::JsRuntimeAdapterType as JsRuntimeAdapter>::JsRealmAdapterType as JsRealmAdapter>::JsValueAdapterType, JsError> + Send,
Self: 'static,
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
sourcefn js_instance_of_by_name(
&self,
object: &Self::JsValueAdapterType,
constructor_name: &str
) -> Result<bool, JsError>
fn js_instance_of_by_name(
&self,
object: &Self::JsValueAdapterType,
constructor_name: &str
) -> Result<bool, JsError>
check if a JsValueAdapter is an instance of a constructor by name Read more
Auto Trait Implementations
impl !RefUnwindSafe for QuickJsRealmAdapter
impl !Send for QuickJsRealmAdapter
impl !Sync for QuickJsRealmAdapter
impl Unpin for QuickJsRealmAdapter
impl !UnwindSafe for QuickJsRealmAdapter
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more