Expand description
JavaScriptCore bindings for Ultralight.
This module provides a high-level API for working with JavaScriptCore in Ultralight. It is a thin wrapper around the C API provided by JavaScriptCore.
§Example
let object = context.global_object();
let string = JSValue::new_string(&context, "Hello, world!");
object.set_property("greeting", &string, JSPropertyAttributes::default());
// this can be called from JavaScript
let rust_callback = JSObject::new_function_with_callback(&context, |ctx, this, args| {
Ok(JSValue::new_string(ctx, "Hello from Rust!"))
});
object.set_property("rustCallback", &rust_callback, JSPropertyAttributes::default());
Structs§
- JSContext
- JavaScript execution context.
- JSObject
- A JavaScript object.
- JSProperty
Attributes - Attributes for JavaScript properties.
- JSProperty
Name Array - A reference to an array of property names.
- JSString
- A JavaScript string.
- JSTyped
Array - A JavaScript Typed Array object.
- JSValue
- A JavaScript value.
Enums§
- JSType
- An enum identifying the type of a
JSValue
. - JSTyped
Array Type - An enum identifying the Typed Array type of a
JSTypedArray
.