Converting Rust into WebAssembly via wasm-bindgen
Learn how to connect Rust WebAssembly and JavaScript using wasm-bindgen.
We'll cover the following
So far, we’ve seen simple examples. But how can we pass functions and classes from JavaScript into WebAssembly and vice versa? In order to do more advanced bindings, Rust provides us with wasm-bindgen
. Let’s start with a “Hello World” example with wasm-bindgen
.
Getting started with the project
Create a new project with Cargo:
Get hands-on with 1200+ tech skills courses.