The Rust WebAssemply bookcache has a detailed introduction to WebAssembly in Rust; unfortunately it's example setup is somewhat complicated and requires the use of
npm just to run show a simple Hello World! message in the browser.
Luckily, there's a simpler way to get started if you don't care about
Clone the example project template:
cargo generate --git https://github.com/rustwasm/wasm-pack-template
which will prompt you for a project name, in the following we'll assume you used