Appearance
Guides
Fresh 🌱Conceptual guides for working with JavaScript values from Rust. Where the SOPs are procedures, these are explanations of how each piece of the bridge works.
Reading order
flowchart TD
INTRO[Introduction] --> PRIM[Primitive Types]
PRIM --> OBJ[Objects]
OBJ --> ARR[Arrays]
PRIM --> FN[Functions]
FN --> CALL[Calling JavaScript]
FN --> ERR[Error Handling]
FN --> ASYNC[Async Tasks & Promises]
OBJ --> BOX[Boxed Data: JsBox]
OBJ --> TA[Buffers & Typed Arrays]
style INTRO fill:#10b981,color:#fff
style ASYNC fill:#6366f1,color:#fff
style BOX fill:#f59e0b,color:#fffAll guides
| Guide | Covers |
|---|---|
| Introduction to Neon | What Neon is, why you would use it, and the core mental model. |
| Primitive Types | Numbers, strings, booleans, null, undefined. |
| Objects | Creating objects, getting/setting properties, converting Rust structs to JS. |
| Arrays | Creating arrays, indexed access, converting to and from Vec. |
| Functions | Defining, exporting, reading arguments, type-checking, optional args. |
| Calling JavaScript from Rust | call, construct, bind, and Root for persistent references. |
| Error Handling | Throwing exceptions, the ? operator, and the extract Error type. |
| Async Tasks, Promises & Channels | Worker pool tasks, Channel, Promise, async exports with futures. |
| Boxed Native Data (JsBox) | Embedding Rust structs inside JS objects with Finalize. |
| Buffers & Typed Arrays | Zero-copy access to binary data with JsTypedArray. |
The cx is everything
Across all of these guides, the runtime context (cx) is the constant. It is your handle to the JavaScript engine: you create values with it, read arguments from it, and return results through it.