Embedded JavaScript (QuickJS through rquickjs) for extensions (oxa-ext) and codemode
(oxa-codemode). The only crate that names rquickjs.
| Module | Task | Provides |
|---|---|---|
runtime.rs |
A15 | Limits, Runtime (eval, modules, calls, limits), InterruptHandle, ModuleRef |
host.rs |
A15 | HostFn, CallCx, FnRef, RuntimeThread, Slots, CallbackPort |
module.rs |
A15 | ModuleLoader, MapLoader, join_specifier, strip_types |
lib.rs |
architect | contracts (read its crate docs first) |
- No ambient authority: a fresh runtime can compute and nothing else. Capabilities are host
functions; the embedder checks
Policyinside them. - Value bridge (crate docs): JSON 1:1, functions as
{"$fn": id}(FnRef), bytes as{"$bytes": base64}, errors as{"$error": ..}. - Limits: memory cap and per-call deadline produce
OxaError { code: "script" }; the process never dies and never hangs because of a script. - Threads:
Runtimeis!Send.RuntimeThreadis theSend + Syncowner used byHooksimplementations.RuntimeThread::run(job, serve)blocks; host functions reach the caller's thread withCallCx::upcall(dialogs), and the caller reaches blocked script functions withCallbackPort::call(custom components). - Promises: awaited by pumping jobs; a promise that can never settle is an error (no timers).
- Reload: dropping a runtime invalidates its
FnRefs andModuleRefs; stale use is an error.
Host-function binding; ES module loader; memory cap and deadline interrupt a runaway script; no
ambient fs/net. Tests: tests/a15_*.rs.
oxa-ext (E1-E4, F1-F3), oxa-codemode (E6, F4).