Crate rquickjs_core

Source
Expand description

§High-level bindings to QuickJS

The rquickjs crate provides safe high-level bindings to the QuickJS JavaScript engine. This crate is heavily inspired by the rlua crate.

Re-exports§

pub use runtime::Runtime;
pub use context::Context;
pub use context::Ctx;
pub use class::Class;
pub use context::AsyncContext;futures
pub use runtime::AsyncRuntime;futures

Modules§

allocator
Tools for using different allocators with QuickJS.
array
JavaScript array types.
atom
QuickJS atom functionality.
class
JavaScript classes defined from Rust.
context
JS Contexts related types.
convert
Utilities for converting to and from JavaScript values.
function
JavaScript function functionality
loaderloader
Loaders and resolvers for loading JS modules.
markers
Utility types and traits.
module
Types for loading and handling JS modules.
object
Module for types dealing with JS objects.
prelude
A group of often used types.
promise
Javascript promises and future integration.
qjs
Native low-level bindings
runtime
QuickJS runtime related types.

Macros§

async_withfutures
A macro for safely using an asynchronous context while capturing the environment.
module_init
Helper macro to provide module init function. Use for exporting module definitions to be loaded as part of a dynamic library.

Structs§

Array
Rust representation of a JavaScript object optimized as an array.
ArrayBuffer
Rust representation of a JavaScript object of class ArrayBuffer.
Atom
A QuickJS Atom.
BigInt
Rust representation of a JavaScript big int.
CString
Rust representation of a JavaScript C string.
Coerced
The wrapper for values to force coercion
Exception
A JavaScript instance of Error
Filter
The property filter
Function
A JavaScript function.
Module
A JavaScript module.
Null
The placeholder which treated as null value
Object
Rust representation of a JavaScript object.
Persistent
The wrapper for JS values to keep it from GC
Promise
A JavaScript promise.
String
Rust representation of a JavaScript string.
Symbol
Rust representation of a JavaScript symbol.
TypedArray
Rust representation of a JavaScript objects of TypedArray classes.
Undefined
The placeholder which treated as undefined value
Value
Any JavaScript value

Enums§

CaughtError
An error type containing possible thrown exception values.
Error
Error type of the library.
Type
The type of JavaScript value

Traits§

CatchResultExt
Extension trait to easily turn results with Error into results with CaughtError
FromAtom
Trait for converting values from atoms.
FromIteratorJs
The Rust’s FromIterator trait to use with Ctx
FromJs
For converting JavaScript values to Rust values
IntoAtom
Trait for converting values to atoms.
IntoJs
For converting Rust values to JavaScript values
IteratorJs
The Rust’s Iterator trait extension which works with Ctx
JsLifetime
The trait which signifies a type using the rquickjs 'js lifetime trick for maintaining safety around Javascript values.
ThrowResultExt
Extension trait to easily turn results with CaughtError into results with Error

Type Aliases§

CaughtResult
Result type containing an the JavaScript exception if there was one.
Result
Result type used throughout the library.