liveBook · Manning

Hello-world-rust template

As explained in Server-Side WebAssembly

The hello-world-rust template is a project scaffold for creating a Rust WebAssembly component configured for wasmCloud.

The hello-world-rust template creates a foundational Rust project for a wasmCloud WebAssembly component, supplying the project structure, WIT definition, manifest, and implementation starting point. section 6.1

Create the scaffold

Install wash, then run `wash new component hello-world-wasmcloud --template-name hello-world-rust`. Add the compilation target with `rustup target add wasm32-wasip2`.

wash new component hello-world-wasmcloud --template-name hello-world-rust

Use the project-generation command as the entry point for inspecting the template’s files and configuration. section 6.1

How Server-Side WebAssembly covers it

How deep it goes
Defines project files, WIT interfaces, manifest settings, and a minimal handler implementation.
Examples
Uses hello-world-wasmcloud, world.wit, wasmcloud.toml, and a handler returning “Hello from Rust!”.
What it assumes
Requires wash and the wasm32-wasip2 Rust target before compiling the generated component.
What you can do after
Build it from scratch with wash and compile it for wasm32-wasip2.
How it connects
Connects Rust, WebAssembly components, wasmCloud, WIT, WASI, and HTTP.

This explainer was generated by Manning's knowledge graph from the text of Server-Side WebAssembly. The section links point to the parts of the book it draws on.