wstd crate, which provides Rust bindings for WASI-HTTP.
Rust and Cargo are required. On Windows, also install Visual Studio Build Tools with the Desktop development with C++ workload.
Existing apps built with the
fastedge crate and wasm32-wasip1 use a different setup — covered in the Legacy Rust guide.Add the WebAssembly target
FastEdge runs applications compiled towasm32-wasip2. Add the target once — it applies to all future builds:
Configure a project
FastEdge applications compile to WebAssembly libraries rather than standalone executables, so start with a Rust library project. Two changes from the defaults are needed: the output type must becdylib (a format the WASI runtime can load), and wstd must be listed as a dependency.
-
Create the library crate:
-
Replace the contents of
Cargo.toml:Withoutcrate-type = ["cdylib"], the build succeeds but the output can’t run as a FastEdge application.
Verify the toolchain
A minimal handler is enough to confirm the toolchain produces a valid WebAssembly component. Replacesrc/lib.rs:
./target/wasm32-wasip2/release/my_app.wasm.