Crate rusty_qjs

Source
Expand description

Rust bindings to QuickJS.

Modules§

  • Errors for working with rusty_qjs.

Structs§

  • function call context.
  • JSContext represents a Javascript context (or Realm). Each JSContext has its own global objects and system objects. There can be several JSContexts per JSRuntime and they can share objects, similar to frames of the same origin sharing Javascript objects in a web browser.
  • JSRuntime represents a Javascript runtime corresponding to an object heap. Several runtimes can exist at the same time but they cannot exchange objects. Inside a given runtime, no multi-threading is supported.
  • A QuickJS Value, JSValue represents a Javascript value which can be a primitive type or an object. Reference counting is implemented by QuickjsRc trait.
  • Same as JSContext but gets freed when it drops.
  • Same as JSRuntime but gets freed when it drops.

Traits§

  • JSValue is using reference counting, so it is important to explicitly duplicate or free JSValues.