[][src]Function js_sandbox::eval_json

pub fn eval_json(js_expr: &str) -> Result<JsValue, AnyError>

Evaluates a standalone Javascript expression, and returns the result as a JSON value.

If there is an error, Err will be returned. This function is primarily useful for small standalone experiments. Usually, you would want to use the Script struct for more sophisticated Rust->JS interaction.