Zum Inhalt springen
Kitbay
Skill

implementing-jsc-classes-rust

NOASSERTIONAktualisiert am 11. Nov. 202696.758GitHub-Sterne

A contributor guide in the Bun repository for adding a JavaScript class implemented in Rust, using Bun's bindings generator.

Was der Skill vermittelt

A contributor guide in the Bun repository for adding a JavaScript class implemented in Rust, using Bun's bindings generator. The class is described in a .bind.ts schema (constructor arguments, methods, getters, internal fields), and the generator produces the JavaScriptCore cell, prototype, constructor and argument conversion that call into a matching Rust struct, so any mismatch fails at compile time. It explains when the struct should be reference-counted, which capabilities a method can request to allocate, throw or run JavaScript, why JavaScript values must never be kept in struct fields, and which files in the repository serve as worked examples. It is only useful when changing Bun's own source.

Funktionen

In der Dokumentation nicht angegeben