Docs.rs
  • quickjs-rusty-0.9.3
    • quickjs-rusty 0.9.3
    • Permalink
    • Docs.rs crate page
    • MIT
    • Links
    • Repository
    • crates.io
    • Source
    • Owners
    • Icemic
    • Dependencies
      • anyhow ^1 normal
      • chrono ^0.4.7 normal optional
      • libquickjs-ng-sys ^0.9.4 normal
      • log ^0.4 normal
      • num-bigint ^0.4.4 normal optional
      • num-traits ^0.2.0 normal optional
      • serde ^1 normal optional
      • thiserror ^2 normal optional
      • serde_json ^1 dev
    • Versions
    • 50% of the crate is documented
  • Platform
    • i686-unknown-linux-gnu
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Badges
    • Builds
    • Metadata
    • Shorthand URLs
    • Download
    • Rustdoc JSON
    • Build queue
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation

Crate quickjs_rusty

quickjs_rusty0.9.3

  • All Items

Sections

  • Quickstart:

Crate Items

  • Modules
  • Macros
  • Structs
  • Traits
  • Type Aliases

Crates

  • quickjs_rusty

Crate quickjs_rusty

Source
Expand description

quickjs-rusty is a a Rust wrapper for QuickJS-NG, a new Javascript engine by Fabrice Bellard.

It enables easy and straight-forward execution of modern Javascript from Rust.

§Quickstart:

use quickjs_rusty::Context;

let context = Context::builder().build().unwrap();

// Eval.

let value = context.eval("1 + 2", false).unwrap();
assert_eq!(value.to_int(), Ok(3));

let value = context.eval_as::<String>(" var x = 100 + 250; x.toString() ").unwrap();
assert_eq!(&value, "350");

// Callbacks.

context.add_callback("myCallback", |a: i32, b: i32| a + b).unwrap();

context.eval(r#"
    // x will equal 30
    var x = myCallback(10, 20);
"#, false).unwrap();

Re-exports§

pub use self::context::*;
pub use self::errors::*;
pub use self::value::*;

Modules§

compile
Utils to compile script to bytecode and run script from bytecode
console
Javascript console integration. See the ConsoleBackend trait for more info.
context
errors
module_loader
serde
Serde integration.
utils
utils
value

Macros§

owned

Structs§

Arguments
A wrapper around Vec, used for vararg callbacks.
JSContext

Traits§

Callback
The Callback trait is implemented for functions/closures that can be used as callbacks in the JS runtime.

Type Aliases§

RawJSValue

Results

Settings
Help
No results :(
Try on DuckDuckGo?

Or try looking in one of these:
  • The Rust Reference for technical details about the language.
  • Rust By Example for expository code examples.
  • The Rust Book for introductions to language features and the language itself.
  • Docs.rs for documentation of crates released on crates.io.
No results :(
Try on DuckDuckGo?

Or try looking in one of these:
  • The Rust Reference for technical details about the language.
  • Rust By Example for expository code examples.
  • The Rust Book for introductions to language features and the language itself.
  • Docs.rs for documentation of crates released on crates.io.
No results :(
Try on DuckDuckGo?

Or try looking in one of these:
  • The Rust Reference for technical details about the language.
  • Rust By Example for expository code examples.
  • The Rust Book for introductions to language features and the language itself.
  • Docs.rs for documentation of crates released on crates.io.