Crate rusty_jsc

Source
Expand description

This library provides a Rust API for the JavaScriptCore engine.

§Example

The JavaScriptCore engine lets you evaluate JavaScript scripts from your own application. You first need to create a JSContext object and then call its evaluate_script method.

use rusty_jsc::JSContext;

let mut context = JSContext::default();
match context.evaluate_script("'hello, world'", 1) {
    Ok(value) => {
        println!("{}", value.to_string(&context).unwrap());
    }
    Err(e) => {
        println!(
            "Uncaught: {}",
            e.to_string(&context).unwrap()
        )
    }
}

Modules§

private

Macros§

callback_closure

Structs§

JSContext
A JavaScript execution context.
JSObject
A JavaScript object.
JSString
A JavaScript string.
JSValue
A JavaScript value.
JSVirtualMachine
A JavaScript virtual machine.

Type Aliases§

JSObjectCallAsFunctionCallback

Attribute Macros§

callback