Expand description
Core types and traits for the Jolt JavaScript runtime.
This crate defines the JsRuntime trait that all Jolt backends implement,
along with shared types (JsValue, JsEntry, JoltError) used to
exchange data between Rust and JavaScript.
§Usage
Most users should depend on the jolt facade crate
rather than using jolt_core directly. Use this crate when you need the
trait or types without pulling in a specific backend.
ⓘ
use jolt_core::{JsRuntime, JsValue, JoltError};
fn run_js(rt: &mut impl JsRuntime) -> Result<JsValue, JoltError> {
rt.eval("1 + 1")
}Structs§
- JsEntry
- A key-value pair in a
JsValue::Object.
Enums§
- Jolt
Error - Errors produced by Jolt runtime operations.
- JsValue
- A value that can cross the Rust–JavaScript boundary.
Traits§
- JsRuntime
- A JavaScript runtime capable of evaluating code and exchanging values with Rust.
Type Aliases§
- JsResult
Future - A boxed future returning a Result — used for async runtime methods.